Commit 33be1114 by liulianglang

合成作战工作室代码提交

parent 613bd30a
package org.springblade.founder.hcypgl.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springblade.founder.gnsyrzlog.LogOper;
import org.springblade.founder.hcypgl.entity.TbYwDzqqFjVo;
import org.springblade.founder.hcypgl.entity.TbYwHcypglCygl;
import org.springblade.founder.hcypgl.entity.TbYwHcypglFkxx;
import org.springblade.founder.hcypgl.entity.TbYwHcypglXx;
import org.springblade.founder.hcypgl.mapper.TbYwHcypglXxMapper;
import org.springblade.founder.hcypgl.service.TbYwHcypglXxService;
import org.springblade.founder.utils.EasyUIPage;
import org.springblade.founder.utils.R;
import org.springblade.modules.system.entity.SysNewUser;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.URLEncoder;
import java.util.Base64;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 合成研判管理模块请求主表(TbYwHcypglXx)表控制层
*
* @author liulianglang
* @since 2023-11-21 10:09:03
*/
@RestController
@RequestMapping("/hcypgl")
public class TbYwHcypglXxController {
/**
* 服务对象
*/
@Resource
private TbYwHcypglXxService tbYwHcypglXxService;
@Resource
private TbYwHcypglXxMapper tbYwHcypglXxMapper;
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@PostMapping("selectOne")
public R selectOne(String id) {
return R.ok().data("rows",tbYwHcypglXxService.queryById(id));
}
@PostMapping("/insertXzqqXx")
public R insertXzqqXx(TbYwHcypglXx tbYwHcypglXx,
@RequestParam(value = "lajdsfile",required = false) MultipartFile lajdsfile,
@RequestParam(value = "qtfile",required = false) MultipartFile qtfile
) {
tbYwHcypglXxService.insert(tbYwHcypglXx,lajdsfile,qtfile);
return R.ok().data("xxzjbh","");
}
@PostMapping("/selectAll")
public R selectAll(TbYwHcypglXx tbYwHcypglXx){
try {
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(tbYwHcypglXx.getPage());
easyUIPage.setPagePara(tbYwHcypglXx.getLimit());
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
tbYwHcypglXx.setPage(begin);
tbYwHcypglXx.setLimit(end);
Map<String,Object> map = new HashMap<>();
List<TbYwHcypglXx> list = tbYwHcypglXxService.queryAll(tbYwHcypglXx);
int count = tbYwHcypglXxService.queryAllCount(tbYwHcypglXx);
map.put("rows",list);
map.put("total",count);
return R.ok().data(map);
} catch (Exception e) {
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("/updateXzqqXx")
public R updateXzqqXx(TbYwHcypglXx tbYwHcypglXx, @RequestParam(value = "lajdsfile",required = false) MultipartFile lajdsfile,
@RequestParam(value = "qtfile",required = false) MultipartFile qtfile
) {
tbYwHcypglXxService.update(tbYwHcypglXx,lajdsfile,qtfile);
return R.ok().data("xxzjbh","");
}
@PostMapping("/deleteById")
public R deleteById(TbYwHcypglXx tbYwHcypglXx){
try {
tbYwHcypglXxService.deleteById(tbYwHcypglXx.getXxzjbh());
return R.ok();
}catch (Exception e){
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("/shXzqqXx")
public R shXzqqXx(TbYwHcypglXx tbYwHcypglXx) {
try {
tbYwHcypglXxService.shXzqqXx(tbYwHcypglXx);
return R.ok().data("xxzjbh","");
}catch (Exception e){
e.printStackTrace();
return R.error(e.getMessage());
}
}
@RequestMapping(value = "/imgInfo", method = {RequestMethod.POST, RequestMethod.GET})
@ApiOperation(value = "查询详情页附件信息", notes = "信息主键编号")
public R queryImgInfo(@ApiParam(name = "xxzjbh", value = "信息主键编号")
@RequestParam(required = true) String xxzjbh) {
List<TbYwDzqqFjVo> xxVo = tbYwHcypglXxService.queryImgInfo(xxzjbh);
if (xxVo == null) {
return R.error("该主键号无法查到附件信息");
}
return R.ok().data("detail", xxVo);
}
@PostMapping("/insertFkXx")
public R insertFkXx(TbYwHcypglFkxx tbYwHcypglFkxx, @RequestParam(value = "fkfile",required = false) MultipartFile fkfile
) {
tbYwHcypglXxService.insertFkXx(tbYwHcypglFkxx,fkfile);
return R.ok().data("xxzjbh","");
}
@PostMapping("/updateFkXx")
public R updateFkXx(TbYwHcypglFkxx tbYwHcypglFkxx, @RequestParam(value = "fkfile",required = false) MultipartFile fkfile
) {
tbYwHcypglXxService.updateFkXx(tbYwHcypglFkxx,fkfile);
return R.ok().data("xxzjbh","");
}
@PostMapping("selectFkXxOne")
public R selectFkXxOne(String id) {
return R.ok().data("rows",tbYwHcypglXxService.selectFkXxOne(id));
}
@PostMapping("selectJsXxOne")
public R selectJsXxOne(String id) {
return R.ok().data("rows",tbYwHcypglXxService.selectJsXxOne(id));
}
@PostMapping("/selectUserNewList")
public R selectUserNewList(SysNewUser sysNewUser){
try {
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(sysNewUser.getPage());
easyUIPage.setPagePara(sysNewUser.getLimit());
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
sysNewUser.setBegin(begin);
sysNewUser.setEnd(end);
Map<String,Object> map = new HashMap<>();
List<SysNewUser> list = tbYwHcypglXxService.getUserNewList(sysNewUser);
if(list == null){
return R.error("无权限查看");
}else{
int count = tbYwHcypglXxService.getUserNewCount(sysNewUser);
map.put("rows",list);
map.put("total",count);
return R.ok().data(map);
}
} catch (Exception e) {
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("/selectCyglList")
public R selectCyglList(SysNewUser sysNewUser){
try {
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(sysNewUser.getPage());
easyUIPage.setPagePara(sysNewUser.getLimit());
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
sysNewUser.setBegin(begin);
sysNewUser.setEnd(end);
Map<String,Object> map = new HashMap<>();
List<SysNewUser> list = tbYwHcypglXxService.selectCyglList(sysNewUser);
if(list == null){
return R.error("无权限查看");
}else{
int count = tbYwHcypglXxService.selectCyglListCount(sysNewUser);
map.put("rows",list);
map.put("total",count);
return R.ok().data(map);
}
} catch (Exception e) {
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("/deleteCyglById")
public R deleteCyglById(TbYwHcypglXx tbYwHcypglXx){
try {
tbYwHcypglXxService.deleteCyglById(tbYwHcypglXx.getXxzjbh());
return R.ok();
}catch (Exception e){
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("/updateCyglById")
public R updateCyglById(TbYwHcypglCygl tbYwHcypglCygl){
try {
tbYwHcypglXxService.updateCyglById(tbYwHcypglCygl);
return R.ok();
}catch (Exception e){
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("/insertCyglById")
public R insertCyglById(TbYwHcypglCygl tbYwHcypglCygl){
try {
tbYwHcypglXxService.insertCyglById(tbYwHcypglCygl);
return R.ok();
}catch (Exception e){
e.printStackTrace();
return R.error(e.getMessage());
}
}
@RequestMapping("/downLoadFile")
@ApiOperation(value = "附件文书下载", notes = "附件文书下载")
public void downloadFlws(@RequestParam("xxzjbh") String xxzjbh, HttpServletResponse response) throws Exception {
InputStream in = null;
BufferedOutputStream out = null;
List<TbYwDzqqFjVo> lajdsFj = tbYwHcypglXxMapper.selectFjById( xxzjbh);
if(lajdsFj!=null&&lajdsFj.size()>0)
{
TbYwDzqqFjVo fjVo=lajdsFj.get(0);
if (fjVo != null) {
String fileName = URLEncoder.encode(fjVo.getDzwjbt(), "UTF-8").replaceAll("\\+", "%20");
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName);
try {
in = new ByteArrayInputStream(fjVo.getDzwjnr());
out = new BufferedOutputStream(response.getOutputStream());
byte[] buff = new byte[8192];
int bytesRead;
while ((bytesRead = in.read(buff, 0, buff.length)) != -1) {
out.write(buff, 0, bytesRead);
}
out.flush();
} catch (Exception e) {
e.printStackTrace();
System.out.println("下载文件异常,检查是否根路径错误或文件已挪至其他位置" + e.getMessage());
} finally {
if (in != null) {
in.close();
}
if (out != null) {
out.close();
}
}
}
}
return;
}
}
package org.springblade.founder.hcypgl.entity;
import lombok.Data;
/**
* 调证请求附件信息视图对象*
*
* @author zzj*
*/
@Data
public class TbYwDzqqFjVo extends TbYwHcypglFj {
/**
* 立案决定书在法律文书表的信息主键编号*
*/
private String flwsXxzjbh;
/**
* 附件类型翻译*
*/
private String fjlxText;
/**
* 电子文件内容base64预览对象*
*/
private String dzwjnrBase64;
}
package org.springblade.founder.hcypgl.entity;
import lombok.Data;
import org.springblade.modules.system.entity.XzxtUser;
import java.io.Serializable;
import java.util.Date;
@Data
public class TbYwHcypglCygl implements Serializable {
private static final long serialVersionUID = 634307427993037567L;
/**
* 信息主键编号
*/
private String xxzjbh;
/**
* 关联信息主键编号
*/
private String glxxzjbh;
/**
* 单位组号
*/
private String dwz;
/**
* 信息删除判断标志
*/
private String xxscPdbz;
/**
* 信息登记单位_公安机关机构代码/采用GA 380《全国公安机关机构代码编码规则》统一编制的代码/CODE_GXS
*/
private String xxdjdwGajgjgdm;
/**
* 信息登记单位_公安机关名称
*/
private String xxdjdwGajgmc;
/**
* 信息登记人员_姓名
*/
private String xxdjryXm;
/**
* 信息登记人员_公民身份号码/符合GB 11643《公民身份号码》
*/
private String xxdjryGmsfhm;
/**
* 信息登记人员_联系电话
*/
private String xxdjryLxdh;
/**
* 登记时间
*/
private Date djsj;
/**
* 信息操作单位_公安机关机构代码/采用GA 380《全国公安机关机构代码编码规则》统一编制的代码/CODE_GXS
*/
private String xxczdwGajgjgdm;
/**
* 信息操作单位_公安机关名称
*/
private String xxczdwGajgmc;
/**
* 信息操作人员_姓名
*/
private String xxczryXm;
/**
* 信息操作人员_公民身份号码/符合GB 11643《公民身份号码》
*/
private String xxczryGmsfhm;
/**
* 更新时间
*/
private Date gxsj;
/**
* 成员角色
*/
private String cyjs;
// 更新人员
public void setUpUser(XzxtUser user){
this.xxczryXm=user.getRealname();
this.xxczdwGajgjgdm=user.getUnitcode();
this.xxczdwGajgmc=user.getUnitname();
this.xxczryGmsfhm=user.getIdentitycard();
this.gxsj = new Date();
}
public void setDjUser(XzxtUser user){
this.xxdjryXm=user.getRealname();
this.xxdjdwGajgjgdm=user.getUnitcode();
this.xxdjdwGajgmc=user.getUnitname();
this.xxdjryGmsfhm=user.getIdentitycard();
this.xxdjryLxdh=user.getPhone();
this.xxscPdbz="0";
this.xxczryXm=user.getRealname();
this.xxczdwGajgjgdm=user.getUnitcode();
this.xxczdwGajgmc=user.getUnitname();
this.xxczryGmsfhm=user.getIdentitycard();
this.gxsj = new Date();
this.djsj = new Date();
}
}
package org.springblade.founder.hcypgl.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class TbYwHcypglFj implements Serializable {
private static final long serialVersionUID = 632112287108925469L;
/**
* 信息主键编号
*/
private String xxzjbh;
/**
* 关联的调证信息主键编号
*/
private String dzXxzjbh;
/**
* 电子文件标题
*/
private String dzwjbt;
/**
* 电子文件格式
*/
private String dzwjgs;
/**
* 电子文件位置
*/
private String dzwjwz;
/**
* 电子文件内容
*/
private byte[] dzwjnr;
/**
* 附件类型,1-立案决定书,2-其它附件,3-反馈附件
*/
private String fjlx;
/**
* 创建时间
*/
private Date createTime;
/**
* 创建人
*/
private String createBy;
/**
* 更新时间
*/
private Date updateTime;
/**
* 更新人
*/
private String updateBy;
/**
* 信息删除判断标志
*/
private String xxscPdbz;
}
package org.springblade.founder.hcypgl.entity;
import lombok.Data;
import org.springblade.modules.system.entity.XzxtUser;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@Data
public class TbYwHcypglFkxx implements Serializable {
private static final long serialVersionUID = -22350871634937379L;
/**
* 信息主键编号
*/
private String xxzjbh;
private String removezpStr;
/**
* 关联信息主键编号
*/
private String glxxzjbh;
private String xzzt;
/**
* 反馈内容
*/
private String fknr;
private List<TbYwDzqqFjVo> wj;
/**
* 信息删除判断标志
*/
private String xxscPdbz;
/**
* 信息登记单位_公安机关机构代码/采用GA 380《全国公安机关机构代码编码规则》统一编制的代码/CODE_GXS
*/
private String xxdjdwGajgjgdm;
/**
* 信息登记单位_公安机关名称
*/
private String xxdjdwGajgmc;
/**
* 信息登记人员_姓名
*/
private String xxdjryXm;
/**
* 信息登记人员_公民身份号码/符合GB 11643《公民身份号码》
*/
private String xxdjryGmsfhm;
/**
* 信息登记人员_联系电话
*/
private String xxdjryLxdh;
/**
* 登记时间
*/
private Date djsj;
/**
* 信息操作单位_公安机关机构代码/采用GA 380《全国公安机关机构代码编码规则》统一编制的代码/CODE_GXS
*/
private String xxczdwGajgjgdm;
/**
* 信息操作单位_公安机关名称
*/
private String xxczdwGajgmc;
/**
* 信息操作人员_姓名
*/
private String xxczryXm;
/**
* 信息操作人员_公民身份号码/符合GB 11643《公民身份号码》
*/
private String xxczryGmsfhm;
/**
* 更新时间
*/
private Date gxsj;
// 更新人员
public void setUpUser(XzxtUser user){
this.xxczryXm=user.getRealname();
this.xxczdwGajgjgdm=user.getUnitcode();
this.xxczdwGajgmc=user.getUnitname();
this.xxczryGmsfhm=user.getIdentitycard();
this.gxsj = new Date();
}
public void setDjUser(XzxtUser user){
this.xxdjryXm=user.getRealname();
this.xxdjdwGajgjgdm=user.getUnitcode();
this.xxdjdwGajgmc=user.getUnitname();
this.xxdjryGmsfhm=user.getIdentitycard();
this.xxdjryLxdh=user.getPhone();
this.xxscPdbz="0";
this.xxczryXm=user.getRealname();
this.xxczdwGajgjgdm=user.getUnitcode();
this.xxczdwGajgmc=user.getUnitname();
this.xxczryGmsfhm=user.getIdentitycard();
this.gxsj = new Date();
this.djsj = new Date();
}
}
package org.springblade.founder.hcypgl.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.springblade.modules.system.entity.XzxtUser;
import java.io.Serializable;
import java.util.Date;
@Data
public class TbYwHcypglXx implements Serializable {
private static final long serialVersionUID = 495366910065813829L;
/**
* 信息主键编号
*/
private String xxzjbh;
//分页查询开始位置
private Integer page;
//分页查询结束位置
private Integer limit;
/**
* 关联的案件编号
*/
private String asjbh;
private String grade; //等级
private String dwcxsql;
private String unitcode;
private String sfbj;
/**
* 案件名称
*/
private String ajmc;
private String removezpStr;
/**
* 案件类别代码
*/
private String ajlbdm;
/**
* 立案单位代码
*/
private String ladwdm;
/**
* 简要案情
*/
private String jayq;
/**
* 立案日期
*/
private String larq;
/**
* 线索类型
*/
private String xslx;
/**
* 线索号码
*/
private String xshm;
/**
* 线索描述
*/
private String xsms;
/**
* 申请时间
*/
private Date sqsj;
/**
* 审批人身份证号
*/
private String sprSfzh;
/**
* 审批意见
*/
private String spyj;
/**
* 审批时间
*/
private Date spsj;
/**
* 协作状态 0-草稿,1-待审批,2-审批不通过,3-审批通过,4-待市反馈,5-市已反馈,6-待市审批,7-市审批通过
* 8-市审批不通过 ,9-待省反馈,10-省已反馈
*/
private String xzzt;
private String xzztStr;
/**
* 信息删除判断标志
*/
private String xxscPdbz;
/**
* 信息登记单位_公安机关机构代码/采用GA 380《全国公安机关机构代码编码规则》统一编制的代码/CODE_GXS
*/
private String xxdjdwGajgjgdm;
/**
* 信息登记单位_公安机关名称
*/
private String xxdjdwGajgmc;
/**
* 信息登记人员_姓名
*/
private String xxdjryXm;
/**
* 信息登记人员_公民身份号码/符合GB 11643《公民身份号码》
*/
private String xxdjryGmsfhm;
/**
* 信息登记人员_联系电话
*/
private String xxdjryLxdh;
/**
* 登记时间
*/
private Date djsj;
/**
* 信息操作单位_公安机关机构代码/采用GA 380《全国公安机关机构代码编码规则》统一编制的代码/CODE_GXS
*/
private String xxczdwGajgjgdm;
/**
* 信息操作单位_公安机关名称
*/
private String xxczdwGajgmc;
/**
* 信息操作人员_姓名
*/
private String xxczryXm;
/**
* 信息操作人员_公民身份号码/符合GB 11643《公民身份号码》
*/
private String xxczryGmsfhm;
/**
* 更新时间
*/
private Date gxsj;
private String userId;
// 更新人员
public void setUpUser(XzxtUser user){
this.xxczryXm=user.getRealname();
this.xxczdwGajgjgdm=user.getUnitcode();
this.xxczdwGajgmc=user.getUnitname();
this.xxczryGmsfhm=user.getIdentitycard();
this.gxsj = new Date();
}
public void setDjUser(XzxtUser user){
this.xxdjryXm=user.getRealname();
this.xxdjdwGajgjgdm=user.getUnitcode();
this.xxdjdwGajgmc=user.getUnitname();
this.xxdjryGmsfhm=user.getIdentitycard();
this.xxdjryLxdh=user.getPhone();
this.xxscPdbz="0";
this.xxczryXm=user.getRealname();
this.xxczdwGajgjgdm=user.getUnitcode();
this.xxczdwGajgmc=user.getUnitname();
this.xxczryGmsfhm=user.getIdentitycard();
this.gxsj = new Date();
this.djsj = new Date();
}
}
package org.springblade.founder.hcypgl.mapper;
import org.springblade.founder.hcypgl.entity.*;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.modules.system.entity.SysNewUser;
import org.springframework.stereotype.Component;
/**
* 合成研判管理模块请求主表(TbYwHcypglXx)表数据库访问层
*
* @author liulianglang
* @since 2023-11-21 10:08:56
*/
@Component
@Mapper
public interface TbYwHcypglXxMapper {
/**
* 通过ID查询单条数据
*
* @param xxzjbh 主键
* @return 实例对象
*/
TbYwHcypglXx queryById(String xxzjbh);
/**
* 查询指定行数据
*
* @param offset 查询起始位置
* @param limit 查询条数
* @return 对象列表
*/
List<TbYwHcypglXx> queryAllByLimit(@Param("offset") int offset, @Param("limit") int limit);
/*查询字典*/
String queryNameByCode(@Param(value = "groupid") String groupid,
@Param(value = "code") String code);
/**
* 通过实体作为筛选条件查询
*
* @param tbYwHcypglXx 实例对象
* @return 对象列表
*/
List<TbYwHcypglXx> queryAll(TbYwHcypglXx tbYwHcypglXx);
int queryAllCount(TbYwHcypglXx tbYwHcypglXx);
/**
* 新增数据
*
* @param tbYwHcypglXx 实例对象
* @return 影响行数
*/
int insert(TbYwHcypglXx tbYwHcypglXx);
int insertFkXx(TbYwHcypglFkxx tbYwHcypglFkxx);
int updateFkXx(TbYwHcypglFkxx tbYwHcypglFkxx);
TbYwHcypglFkxx selectFkXxOne(String xxzjbh);
/**
* 批量新增数据(MyBatis原生foreach方法)
*
* @param entities List<TbYwHcypglXx> 实例对象列表
* @return 影响行数
*/
int insertBatch(@Param("entities") List<TbYwHcypglXx> entities);
/**
* 批量新增或按主键更新数据(MyBatis原生foreach方法)
*
* @param entities List<TbYwHcypglXx> 实例对象列表
* @return 影响行数
*/
int insertOrUpdateBatch(@Param("entities") List<TbYwHcypglXx> entities);
/**
* 修改数据
*
* @param tbYwHcypglXx 实例对象
* @return 影响行数
*/
int update(TbYwHcypglXx tbYwHcypglXx);
int insertFj(TbYwHcypglFj tbYwHcypglFj);
/**
* 通过主键删除数据
*
* @param
* @return 影响行数
*/
int deleteById(TbYwHcypglXx tbYwHcypglXx);
int deleteCyglById(TbYwHcypglCygl tbYwHcypglCygl);
int updateCyglById(TbYwHcypglCygl tbYwHcypglCygl);
int insertCyglById(TbYwHcypglCygl tbYwHcypglCygl);
List<TbYwDzqqFjVo> selectFjInfo(@Param("fjlx") String fjlx, @Param("dzXxzjbh") String dzXxzjbh);
List<TbYwDzqqFjVo> selectFjById(@Param("xxzjbh") String xxzjbh);
void updateDzqqFjXxscPdbz(@Param("dzXxzjbh") String dzXxzjbh, @Param("fjlx") String fjlx, @Param("xxzjbh") String xxzjbh);
// 获取用户 个数
int getUserNewCount(SysNewUser sysNewUser)throws Exception;
// 获取用户 列表
List<SysNewUser> getUserNewList(SysNewUser sysNewUser)throws Exception;
int selectCyglListCount(SysNewUser sysNewUser)throws Exception;
List<SysNewUser> selectCyglList(SysNewUser sysNewUser)throws Exception;
String selectJsXxOne (String userId);
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.springblade.founder.hcypgl.mapper.TbYwHcypglXxMapper">
<!--查询单个-->
<select id="queryById" resultType="org.springblade.founder.hcypgl.entity.TbYwHcypglXx">
select
xxzjbh,asjbh, ajmc, ajlbdm, ladwdm, jayq, larq, xslx, xshm, xsms, sqsj, spr_sfzh, spyj, spsj, xzzt, xxsc_pdbz, xxdjdw_gajgjgdm, xxdjdw_gajgmc, xxdjry_xm, xxdjry_gmsfhm, xxdjry_lxdh, djsj, xxczdw_gajgjgdm, xxczdw_gajgmc, xxczry_xm, xxczry_gmsfhm, gxsj
from xzxt.tb_yw_hcypgl_xx
where xxzjbh = #{xxzjbh}
</select>
<!--查询指定行数据-->
<select id="queryAllByLimit" resultType="org.springblade.founder.hcypgl.entity.TbYwHcypglXx">
select
asjbh, ajmc, ajlbdm, ladwdm, jayq, larq, xslx, xshm, xsms, sqsj, spr_sfzh, spyj, spsj, xzzt, xxsc_pdbz, xxdjdw_gajgjgdm, xxdjdw_gajgmc, xxdjry_xm, xxdjry_gmsfhm, xxdjry_lxdh, djsj, xxczdw_gajgjgdm, xxczdw_gajgmc, xxczry_xm, xxczry_gmsfhm, gxsj
from xzxt.tb_yw_hcypgl_xx
limit #{offset}, #{limit}
</select>
<select id="queryNameByCode" resultType="java.lang.String" parameterType="java.lang.String">
SELECT name FROM sys_dictitem
WHERE scbz='0'
<if test="groupid != null and groupid != ''">
AND groupid=#{groupid}
</if>
<if test="code != null and code != ''">
AND code=#{code}
</if>
limit 1
</select>
<!--通过实体作为筛选条件查询-->
<select id="queryAll" resultType="org.springblade.founder.hcypgl.entity.TbYwHcypglXx">
select
xxzjbh,asjbh, ajmc, ajlbdm, ladwdm, jayq, larq, xslx, xshm, xsms, sqsj, spr_sfzh, spyj, spsj, xzzt,
(case when xzzt = '0' then '草稿' when xzzt = '1' then '待审批' when xzzt = '2' then '审批不通过' when xzzt = '4' then '待本级反馈'
when xzzt = '5' then '本级已反馈' when xzzt = '6' then '待审批' when xzzt = '8' then '审批不通过'
when xzzt = '9' then '待上级反馈'
when xzzt = '10' then '上级已反馈'
else '已完成' end) as xzztStr,grade,
xxsc_pdbz, xxdjdw_gajgjgdm, xxdjdw_gajgmc, xxdjry_xm, xxdjry_gmsfhm, xxdjry_lxdh, djsj, xxczdw_gajgjgdm, xxczdw_gajgmc, xxczry_xm, xxczry_gmsfhm, gxsj
from tb_yw_hcypgl_xx
<where>
and xxsc_pdbz = '0'
<if test="xxzjbh != null and xxzjbh != ''">
and xxzjbh = #{xxzjbh}
</if>
<if test="asjbh != null and asjbh != ''">
and asjbh like concat(concat('%',#{asjbh}),'%')
</if>
<if test="ajmc != null and ajmc != ''">
and ajmc like concat(concat('%',#{ajmc}),'%')
</if>
<if test="ajlbdm != null and ajlbdm != ''">
and ajlbdm = #{ajlbdm}
</if>
<if test="ladwdm != null and ladwdm != ''">
and ladwdm = #{ladwdm}
</if>
<if test="jayq != null and jayq != ''">
and jayq = #{jayq}
</if>
<if test="larq != null">
and larq = #{larq}
</if>
<if test="xslx != null and xslx != ''">
and xslx = #{xslx}
</if>
<if test="xshm != null and xshm != ''">
and xshm = #{xshm}
</if>
<if test="xsms != null and xsms != ''">
and xsms = #{xsms}
</if>
<if test="sqsj != null">
and sqsj = #{sqsj}
</if>
<if test="sprSfzh != null and sprSfzh != ''">
and spr_sfzh = #{sprSfzh}
</if>
<if test="spyj != null and spyj != ''">
and spyj = #{spyj}
</if>
<if test="spsj != null">
and spsj = #{spsj}
</if>
<if test="xzzt != null and xzzt != ''">
and xzzt = #{xzzt}
</if>
<if test="xxscPdbz != null and xxscPdbz != ''">
and xxsc_pdbz = #{xxscPdbz}
</if>
<if test="xxdjdwGajgjgdm != null and xxdjdwGajgjgdm != ''">
and xxdjdw_gajgjgdm = #{xxdjdwGajgjgdm}
</if>
<if test="xxdjdwGajgmc != null and xxdjdwGajgmc != ''">
and xxdjdw_gajgmc = #{xxdjdwGajgmc}
</if>
<if test="xxdjryXm != null and xxdjryXm != ''">
and xxdjry_xm = #{xxdjryXm}
</if>
<if test="xxdjryGmsfhm != null and xxdjryGmsfhm != ''">
and xxdjry_gmsfhm = #{xxdjryGmsfhm}
</if>
<if test="xxdjryLxdh != null and xxdjryLxdh != ''">
and xxdjry_lxdh = #{xxdjryLxdh}
</if>
<if test="djsj != null">
and djsj = #{djsj}
</if>
<if test="xxczdwGajgjgdm != null and xxczdwGajgjgdm != ''">
and xxczdw_gajgjgdm = #{xxczdwGajgjgdm}
</if>
<if test="xxczdwGajgmc != null and xxczdwGajgmc != ''">
and xxczdw_gajgmc = #{xxczdwGajgmc}
</if>
<if test="xxczryXm != null and xxczryXm != ''">
and xxczry_xm = #{xxczryXm}
</if>
<if test="xxczryGmsfhm != null and xxczryGmsfhm != ''">
and xxczry_gmsfhm = #{xxczryGmsfhm}
</if>
<if test="gxsj != null">
and gxsj = #{gxsj}
</if>
<include refid="qxpd-where"/>
</where>
order by djsj desc limit #{page},#{limit}
</select>
<sql id="qxpd-where">
<if test="sfbj == 'bdw'.toString()">
and xxdjdw_gajgjgdm like concat( #{unitcode},'%')
and grade=#{grade}
</if>
<if test="sfbj == 'bxq'.toString()">
<if test="grade == 'S'.toString()">
and xxdjdw_gajgjgdm like concat( #{unitcode},'%')
and xzzt in ('9','10')
</if>
<if test="grade == 'D'.toString()">
and xxdjdw_gajgjgdm like concat( #{unitcode},'%')
and grade!=#{grade} and xzzt not in ('0','1','2')
</if>
<if test="grade == 'X'.toString()">
and xxdjdw_gajgjgdm like concat( #{unitcode},'%')
and grade!=#{grade}
</if>
</if>
<if test="sfbj == 'dsp'.toString()">
<if test="grade == 'D'.toString()">
and (
(xxdjdw_gajgjgdm like concat( #{unitcode},'%')
and grade =#{grade} and xzzt in ('1') ) or (xxdjdw_gajgjgdm like concat( #{unitcode},'%')
and grade!=#{grade} and xzzt in ('6'))
)
</if>
<if test="grade == 'X'.toString()">
and xxdjdw_gajgjgdm like concat( #{unitcode},'%')
and grade =#{grade} and xzzt in ('1')
</if>
</if>
<if test="dwcxsql !=null and dwcxsql!=''">
${dwcxsql}
</if>
</sql>
<!--通过实体作为筛选条件查询-->
<select id="queryAllCount" resultType="java.lang.Integer">
select
count(1)
from tb_yw_hcypgl_xx
<where>
and xxsc_pdbz = '0'
<if test="xxzjbh != null and xxzjbh != ''">
and xxzjbh = #{xxzjbh}
</if>
<if test="asjbh != null and asjbh != ''">
and asjbh like concat(concat('%',#{asjbh}),'%')
</if>
<if test="ajmc != null and ajmc != ''">
and ajmc like concat(concat('%',#{ajmc}),'%')
</if>
<if test="ajlbdm != null and ajlbdm != ''">
and ajlbdm = #{ajlbdm}
</if>
<if test="ladwdm != null and ladwdm != ''">
and ladwdm = #{ladwdm}
</if>
<if test="jayq != null and jayq != ''">
and jayq = #{jayq}
</if>
<if test="larq != null">
and larq = #{larq}
</if>
<if test="xslx != null and xslx != ''">
and xslx = #{xslx}
</if>
<if test="xshm != null and xshm != ''">
and xshm = #{xshm}
</if>
<if test="xsms != null and xsms != ''">
and xsms = #{xsms}
</if>
<if test="sqsj != null">
and sqsj = #{sqsj}
</if>
<if test="sprSfzh != null and sprSfzh != ''">
and spr_sfzh = #{sprSfzh}
</if>
<if test="spyj != null and spyj != ''">
and spyj = #{spyj}
</if>
<if test="spsj != null">
and spsj = #{spsj}
</if>
<if test="xzzt != null and xzzt != ''">
and xzzt = #{xzzt}
</if>
<if test="xxscPdbz != null and xxscPdbz != ''">
and xxsc_pdbz = #{xxscPdbz}
</if>
<if test="xxdjdwGajgjgdm != null and xxdjdwGajgjgdm != ''">
and xxdjdw_gajgjgdm = #{xxdjdwGajgjgdm}
</if>
<if test="xxdjdwGajgmc != null and xxdjdwGajgmc != ''">
and xxdjdw_gajgmc = #{xxdjdwGajgmc}
</if>
<if test="xxdjryXm != null and xxdjryXm != ''">
and xxdjry_xm = #{xxdjryXm}
</if>
<if test="xxdjryGmsfhm != null and xxdjryGmsfhm != ''">
and xxdjry_gmsfhm = #{xxdjryGmsfhm}
</if>
<if test="xxdjryLxdh != null and xxdjryLxdh != ''">
and xxdjry_lxdh = #{xxdjryLxdh}
</if>
<if test="djsj != null">
and djsj = #{djsj}
</if>
<if test="xxczdwGajgjgdm != null and xxczdwGajgjgdm != ''">
and xxczdw_gajgjgdm = #{xxczdwGajgjgdm}
</if>
<if test="xxczdwGajgmc != null and xxczdwGajgmc != ''">
and xxczdw_gajgmc = #{xxczdwGajgmc}
</if>
<if test="xxczryXm != null and xxczryXm != ''">
and xxczry_xm = #{xxczryXm}
</if>
<if test="xxczryGmsfhm != null and xxczryGmsfhm != ''">
and xxczry_gmsfhm = #{xxczryGmsfhm}
</if>
<if test="gxsj != null">
and gxsj = #{gxsj}
</if>
<include refid="qxpd-where"/>
</where>
</select>
<!--新增所有列-->
<insert id="insert" >
insert into tb_yw_hcypgl_xx(xxzjbh,grade,asjbh, ajmc, ajlbdm, ladwdm, jayq, larq, xslx, xshm, xsms, sqsj, spr_sfzh, spyj, spsj, xzzt, xxsc_pdbz, xxdjdw_gajgjgdm, xxdjdw_gajgmc, xxdjry_xm, xxdjry_gmsfhm, xxdjry_lxdh, djsj, xxczdw_gajgjgdm, xxczdw_gajgmc, xxczry_xm, xxczry_gmsfhm, gxsj)
values (#{xxzjbh},#{grade},#{asjbh}, #{ajmc}, #{ajlbdm}, #{ladwdm}, #{jayq}, #{larq}, #{xslx}, #{xshm}, #{xsms}, #{sqsj}, #{sprSfzh}, #{spyj}, #{spsj}, #{xzzt}, #{xxscPdbz}, #{xxdjdwGajgjgdm}, #{xxdjdwGajgmc}, #{xxdjryXm}, #{xxdjryGmsfhm}, #{xxdjryLxdh}, #{djsj}, #{xxczdwGajgjgdm}, #{xxczdwGajgmc}, #{xxczryXm}, #{xxczryGmsfhm}, #{gxsj})
</insert>
<insert id="insertFkXx" >
insert into tb_yw_hcypgl_fkxx(xxzjbh,glxxzjbh, xxsc_pdbz, fknr, xxdjdw_gajgjgdm, xxdjdw_gajgmc, xxdjry_xm, xxdjry_gmsfhm, xxdjry_lxdh, djsj, xxczdw_gajgjgdm, xxczdw_gajgmc, xxczry_xm, xxczry_gmsfhm, gxsj)
values (#{xxzjbh},#{glxxzjbh}, #{xxscPdbz},#{fknr} , #{xxdjdwGajgjgdm}, #{xxdjdwGajgmc}, #{xxdjryXm}, #{xxdjryGmsfhm}, #{xxdjryLxdh}, #{djsj}, #{xxczdwGajgjgdm}, #{xxczdwGajgmc}, #{xxczryXm}, #{xxczryGmsfhm}, #{gxsj})
</insert>
<!--通过主键修改数据-->
<update id="updateFkXx">
update tb_yw_hcypgl_fkxx
<set>
<if test="glxxzjbh != null and glxxzjbh != ''">
glxxzjbh = #{glxxzjbh},
</if>
<if test="fknr != null and fknr != ''">
fknr = #{fknr},
</if>
<if test="xxscPdbz != null and xxscPdbz != ''">
xxsc_pdbz = #{xxscPdbz},
</if>
<if test="xxdjdwGajgjgdm != null and xxdjdwGajgjgdm != ''">
xxdjdw_gajgjgdm = #{xxdjdwGajgjgdm},
</if>
<if test="xxdjdwGajgmc != null and xxdjdwGajgmc != ''">
xxdjdw_gajgmc = #{xxdjdwGajgmc},
</if>
<if test="xxdjryXm != null and xxdjryXm != ''">
xxdjry_xm = #{xxdjryXm},
</if>
<if test="xxdjryGmsfhm != null and xxdjryGmsfhm != ''">
xxdjry_gmsfhm = #{xxdjryGmsfhm},
</if>
<if test="xxdjryLxdh != null and xxdjryLxdh != ''">
xxdjry_lxdh = #{xxdjryLxdh},
</if>
<if test="djsj != null">
djsj = #{djsj},
</if>
<if test="xxczdwGajgjgdm != null and xxczdwGajgjgdm != ''">
xxczdw_gajgjgdm = #{xxczdwGajgjgdm},
</if>
<if test="xxczdwGajgmc != null and xxczdwGajgmc != ''">
xxczdw_gajgmc = #{xxczdwGajgmc},
</if>
<if test="xxczryXm != null and xxczryXm != ''">
xxczry_xm = #{xxczryXm},
</if>
<if test="xxczryGmsfhm != null and xxczryGmsfhm != ''">
xxczry_gmsfhm = #{xxczryGmsfhm},
</if>
<if test="gxsj != null">
gxsj = #{gxsj},
</if>
</set>
where xxzjbh = #{xxzjbh}
</update>
<insert id="insertBatch" keyProperty="xxzjbh" useGeneratedKeys="true">
insert into xzxt.tb_yw_hcypgl_xx(asjbh, ajmc, ajlbdm, ladwdm, jayq, larq, xslx, xshm, xsms, sqsj, spr_sfzh, spyj, spsj, xzzt, xxsc_pdbz, xxdjdw_gajgjgdm, xxdjdw_gajgmc, xxdjry_xm, xxdjry_gmsfhm, xxdjry_lxdh, djsj, xxczdw_gajgjgdm, xxczdw_gajgmc, xxczry_xm, xxczry_gmsfhm, gxsj)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.asjbh}, #{entity.ajmc}, #{entity.ajlbdm}, #{entity.ladwdm}, #{entity.jayq}, #{entity.larq}, #{entity.xslx}, #{entity.xshm}, #{entity.xsms}, #{entity.sqsj}, #{entity.sprSfzh}, #{entity.spyj}, #{entity.spsj}, #{entity.xzzt}, #{entity.xxscPdbz}, #{entity.xxdjdwGajgjgdm}, #{entity.xxdjdwGajgmc}, #{entity.xxdjryXm}, #{entity.xxdjryGmsfhm}, #{entity.xxdjryLxdh}, #{entity.djsj}, #{entity.xxczdwGajgjgdm}, #{entity.xxczdwGajgmc}, #{entity.xxczryXm}, #{entity.xxczryGmsfhm}, #{entity.gxsj})
</foreach>
</insert>
<insert id="insertOrUpdateBatch" keyProperty="xxzjbh" useGeneratedKeys="true">
insert into xzxt.tb_yw_hcypgl_xx(asjbh, ajmc, ajlbdm, ladwdm, jayq, larq, xslx, xshm, xsms, sqsj, spr_sfzh, spyj, spsj, xzzt, xxsc_pdbz, xxdjdw_gajgjgdm, xxdjdw_gajgmc, xxdjry_xm, xxdjry_gmsfhm, xxdjry_lxdh, djsj, xxczdw_gajgjgdm, xxczdw_gajgmc, xxczry_xm, xxczry_gmsfhm, gxsj)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.asjbh}, #{entity.ajmc}, #{entity.ajlbdm}, #{entity.ladwdm}, #{entity.jayq}, #{entity.larq}, #{entity.xslx}, #{entity.xshm}, #{entity.xsms}, #{entity.sqsj}, #{entity.sprSfzh}, #{entity.spyj}, #{entity.spsj}, #{entity.xzzt}, #{entity.xxscPdbz}, #{entity.xxdjdwGajgjgdm}, #{entity.xxdjdwGajgmc}, #{entity.xxdjryXm}, #{entity.xxdjryGmsfhm}, #{entity.xxdjryLxdh}, #{entity.djsj}, #{entity.xxczdwGajgjgdm}, #{entity.xxczdwGajgmc}, #{entity.xxczryXm}, #{entity.xxczryGmsfhm}, #{entity.gxsj})
</foreach>
on duplicate key update
asjbh = values(asjbh) , ajmc = values(ajmc) , ajlbdm = values(ajlbdm) , ladwdm = values(ladwdm) , jayq = values(jayq) , larq = values(larq) , xslx = values(xslx) , xshm = values(xshm) , xsms = values(xsms) , sqsj = values(sqsj) , spr_sfzh = values(spr_sfzh) , spyj = values(spyj) , spsj = values(spsj) , xzzt = values(xzzt) , xxsc_pdbz = values(xxsc_pdbz) , xxdjdw_gajgjgdm = values(xxdjdw_gajgjgdm) , xxdjdw_gajgmc = values(xxdjdw_gajgmc) , xxdjry_xm = values(xxdjry_xm) , xxdjry_gmsfhm = values(xxdjry_gmsfhm) , xxdjry_lxdh = values(xxdjry_lxdh) , djsj = values(djsj) , xxczdw_gajgjgdm = values(xxczdw_gajgjgdm) , xxczdw_gajgmc = values(xxczdw_gajgmc) , xxczry_xm = values(xxczry_xm) , xxczry_gmsfhm = values(xxczry_gmsfhm) , gxsj = values(gxsj) </insert>
<!--通过主键修改数据-->
<update id="update">
update tb_yw_hcypgl_xx
<set>
<if test="asjbh != null and asjbh != ''">
asjbh = #{asjbh},
</if>
<if test="ajmc != null and ajmc != ''">
ajmc = #{ajmc},
</if>
<if test="ajlbdm != null and ajlbdm != ''">
ajlbdm = #{ajlbdm},
</if>
<if test="ladwdm != null and ladwdm != ''">
ladwdm = #{ladwdm},
</if>
<if test="jayq != null and jayq != ''">
jayq = #{jayq},
</if>
<if test="larq != null">
larq = #{larq},
</if>
<if test="xslx != null and xslx != ''">
xslx = #{xslx},
</if>
<if test="xshm != null and xshm != ''">
xshm = #{xshm},
</if>
<if test="xsms != null and xsms != ''">
xsms = #{xsms},
</if>
<if test="sqsj != null">
sqsj = #{sqsj},
</if>
<if test="sprSfzh != null and sprSfzh != ''">
spr_sfzh = #{sprSfzh},
</if>
<if test="spyj != null and spyj != ''">
spyj = #{spyj},
</if>
<if test="spsj != null">
spsj = #{spsj},
</if>
<if test="xzzt != null and xzzt != ''">
xzzt = #{xzzt},
</if>
<if test="xxscPdbz != null and xxscPdbz != ''">
xxsc_pdbz = #{xxscPdbz},
</if>
<if test="xxdjdwGajgjgdm != null and xxdjdwGajgjgdm != ''">
xxdjdw_gajgjgdm = #{xxdjdwGajgjgdm},
</if>
<if test="xxdjdwGajgmc != null and xxdjdwGajgmc != ''">
xxdjdw_gajgmc = #{xxdjdwGajgmc},
</if>
<if test="xxdjryXm != null and xxdjryXm != ''">
xxdjry_xm = #{xxdjryXm},
</if>
<if test="xxdjryGmsfhm != null and xxdjryGmsfhm != ''">
xxdjry_gmsfhm = #{xxdjryGmsfhm},
</if>
<if test="xxdjryLxdh != null and xxdjryLxdh != ''">
xxdjry_lxdh = #{xxdjryLxdh},
</if>
<if test="djsj != null">
djsj = #{djsj},
</if>
<if test="xxczdwGajgjgdm != null and xxczdwGajgjgdm != ''">
xxczdw_gajgjgdm = #{xxczdwGajgjgdm},
</if>
<if test="xxczdwGajgmc != null and xxczdwGajgmc != ''">
xxczdw_gajgmc = #{xxczdwGajgmc},
</if>
<if test="xxczryXm != null and xxczryXm != ''">
xxczry_xm = #{xxczryXm},
</if>
<if test="xxczryGmsfhm != null and xxczryGmsfhm != ''">
xxczry_gmsfhm = #{xxczryGmsfhm},
</if>
<if test="gxsj != null">
gxsj = #{gxsj},
</if>
</set>
where xxzjbh = #{xxzjbh}
</update>
<!--新增所有列-->
<insert id="insertFj" >
insert into tb_yw_hcypgl_fj(xxzjbh,dz_xxzjbh, dzwjbt, dzwjgs, dzwjwz, dzwjnr, fjlx, create_time, create_by, update_time, update_by, xxsc_pdbz)
values (#{xxzjbh},#{dzXxzjbh}, #{dzwjbt}, #{dzwjgs}, #{dzwjwz}, #{dzwjnr}, #{fjlx}, #{createTime}, #{createBy}, #{updateTime}, #{updateBy}, #{xxscPdbz})
</insert>
<!--通过主键删除-->
<update id="deleteById" >
UPDATE tb_yw_hcypgl_xx SET
<if test="xxczdwGajgjgdm != null and xxczdwGajgjgdm != ''">xxczdw_gajgjgdm =
#{ xxczdwGajgjgdm , jdbcType=VARCHAR },
</if>
<if test="xxczdwGajgmc != null and xxczdwGajgmc != ''">xxczdw_gajgmc = #{ xxczdwGajgmc , jdbcType=VARCHAR },
</if>
<if test="xxczryGmsfhm != null and xxczryGmsfhm != ''">xxczry_gmsfhm = #{ xxczryGmsfhm , jdbcType=VARCHAR },
</if>
<if test="xxczryXm != null and xxczryXm != ''">xxczry_xm = #{ xxczryXm , jdbcType=VARCHAR },</if>
xxsc_pdbz = '1',
gxsj = now()
WHERE xxzjbh = #{xxzjbh,jdbcType=VARCHAR}
</update>
<update id="deleteCyglById" >
UPDATE tb_yw_hcypgl_cygl SET
<if test="xxczdwGajgjgdm != null and xxczdwGajgjgdm != ''">xxczdw_gajgjgdm =
#{ xxczdwGajgjgdm , jdbcType=VARCHAR },
</if>
<if test="xxczdwGajgmc != null and xxczdwGajgmc != ''">xxczdw_gajgmc = #{ xxczdwGajgmc , jdbcType=VARCHAR },
</if>
<if test="xxczryGmsfhm != null and xxczryGmsfhm != ''">xxczry_gmsfhm = #{ xxczryGmsfhm , jdbcType=VARCHAR },
</if>
<if test="xxczryXm != null and xxczryXm != ''">xxczry_xm = #{ xxczryXm , jdbcType=VARCHAR },</if>
xxsc_pdbz = '1',
gxsj = now()
WHERE xxzjbh = #{xxzjbh,jdbcType=VARCHAR}
</update>
<update id="updateCyglById" >
UPDATE tb_yw_hcypgl_cygl SET
<if test="xxczdwGajgjgdm != null and xxczdwGajgjgdm != ''">xxczdw_gajgjgdm =
#{ xxczdwGajgjgdm , jdbcType=VARCHAR },
</if>
<if test="xxczdwGajgmc != null and xxczdwGajgmc != ''">xxczdw_gajgmc = #{ xxczdwGajgmc , jdbcType=VARCHAR },
</if>
<if test="xxczryGmsfhm != null and xxczryGmsfhm != ''">xxczry_gmsfhm = #{ xxczryGmsfhm , jdbcType=VARCHAR },
</if>
<if test="xxczryXm != null and xxczryXm != ''">xxczry_xm = #{ xxczryXm , jdbcType=VARCHAR },</if>
<if test="cyjs != null and cyjs != ''">
cyjs = #{ cyjs , jdbcType=VARCHAR },
</if>
gxsj = now()
WHERE xxzjbh = #{xxzjbh,jdbcType=VARCHAR}
</update>
<!--新增所有列-->
<insert id="insertCyglById" >
insert into tb_yw_hcypgl_cygl(xxzjbh,glxxzjbh, dwz, xxsc_pdbz, xxdjdw_gajgjgdm, xxdjdw_gajgmc, xxdjry_xm, xxdjry_gmsfhm, xxdjry_lxdh, djsj, xxczdw_gajgjgdm, xxczdw_gajgmc, xxczry_xm, xxczry_gmsfhm, gxsj, cyjs)
values (#{xxzjbh}, #{glxxzjbh}, #{dwz}, #{xxscPdbz}, #{xxdjdwGajgjgdm}, #{xxdjdwGajgmc}, #{xxdjryXm}, #{xxdjryGmsfhm}, #{xxdjryLxdh}, #{djsj}, #{xxczdwGajgjgdm}, #{xxczdwGajgmc}, #{xxczryXm}, #{xxczryGmsfhm}, #{gxsj}, #{cyjs})
</insert>
<select id="selectFjInfo" resultType="org.springblade.founder.hcypgl.entity.TbYwDzqqFjVo">
select xxzjbh xxzjbh,
dz_xxzjbh dzXxzjbh,
dzwjbt dzwjbt,
dzwjgs dzwjgs,
dzwjwz dzwjwz,
dzwjnr dzwjnr,
fjlx fjlx
from tb_yw_hcypgl_fj
where xxsc_pdbz = '0'
<if test="fjlx != null and fjlx != ''">
and fjlx = #{fjlx, jdbcType=VARCHAR}
</if>
and dz_xxzjbh = #{dzXxzjbh, jdbcType=VARCHAR}
order by fjlx asc
</select>
<select id="selectFjById" resultType="org.springblade.founder.hcypgl.entity.TbYwDzqqFjVo">
select xxzjbh xxzjbh,
dz_xxzjbh dzXxzjbh,
dzwjbt dzwjbt,
dzwjgs dzwjgs,
dzwjwz dzwjwz,
dzwjnr dzwjnr,
fjlx fjlx
from tb_yw_hcypgl_fj
where xxsc_pdbz = '0'
and xxzjbh = #{xxzjbh, jdbcType=VARCHAR}
</select>
<update id="updateDzqqFjXxscPdbz">
update tb_yw_hcypgl_fj
set xxsc_pdbz = '1'
<where>
<if test="dzXxzjbh != null and dzXxzjbh != ''">
and dz_xxzjbh = #{dzXxzjbh}
</if>
<if test="xxzjbh != null and xxzjbh != ''">
and xxzjbh = #{xxzjbh}
</if>
<if test="fjlx != null and fjlx != ''">
and fjlx = #{fjlx}
</if>
</where>
</update>
<select id="getUserNewList" resultType="org.springblade.modules.system.entity.SysNewUser">
SELECT
us.id as id,
(select name from sys_dictitem where groupid='CODE_UNIT' AND code=us.unitcode) as unitcode,
us.username as username,
us.password as password,
us.true_name as trueName,
us.open_flag as openFlag,
us.default_model as defaultModel,
us.remark as remark,
us.lrr as lrr,
us.lrsj as lrsj,
us.gxr as gxr,
us.gxsj as gxsj,
us.lrdwdm as lrdwdm,
us.lrdwmc as lrdwmc,
us.identitycard as identitycard,
(select name from sys_dictitem where groupid='CODE_XB' AND code=us.sex) as sex,
us.birthday as birthday,
us.telephone as telephone,
(SELECT name FROM sys_dictitem_xz WHERE code = us.unitcode) as unitname,
us.scbz as scbz,
us.ip as ip,
us.grade as grade,
us.policemanid as policemanid
FROM sys_user us
WHERE
us.scbz = '0' and us.id not in (select glxxzjbh from tb_yw_hcypgl_cygl cygl
where cygl.xxsc_pdbz='0' and dwz=#{unitcode}
)
<include refid="user-where"/>
order by us.lrsj desc
limit #{begin}, #{end}
</select>
<select id="getUserNewCount" resultType="java.lang.Integer">
SELECT count(*)
FROM sys_user us
WHERE
us.scbz = '0' and us.id not in (select glxxzjbh from tb_yw_hcypgl_cygl cygl
where cygl.xxsc_pdbz='0' and dwz=#{unitcode}
)
<include refid="user-where"/>
</select>
<select id="selectCyglList" resultType="org.springblade.modules.system.entity.SysNewUser">
SELECT
us.id as id,
(select name from sys_dictitem where groupid='CODE_UNIT' AND code=us.unitcode) as unitcode,
us.username as username,
us.password as password,
us.true_name as trueName,
us.open_flag as openFlag,
us.default_model as defaultModel,
us.remark as remark,
us.lrr as lrr,
us.lrsj as lrsj,
us.gxr as gxr,
us.gxsj as gxsj,
us.lrdwdm as lrdwdm,
us.lrdwmc as lrdwmc,
us.identitycard as identitycard,
(select name from sys_dictitem where groupid='CODE_XB' AND code=us.sex) as sex,
us.birthday as birthday,
us.telephone as telephone,
(SELECT name FROM sys_dictitem_xz WHERE code = us.unitcode) as unitname,
us.scbz as scbz,
us.ip as ip,
us.grade as grade,
us.policemanid as policemanid,
(select (case
when cyjs = '1' then '组长'
when cyjs = '2' then '研判员'
else cyjs end ) as jsrole
from tb_yw_hcypgl_cygl gl where gl.glxxzjbh=us.id and gl.xxsc_pdbz='0' ) as syRolesStr,
cygl.xxzjbh as cyxxzjbh
FROM tb_yw_hcypgl_cygl cygl left join sys_user us
ON us.id = cygl.glxxzjbh
WHERE
us.scbz = '0' and cygl.xxsc_pdbz='0' and dwz=#{unitcode}
<if test="cyjs != null and cyjs != ''">
and cygl.cyjs =#{cyjs}
</if>
<include refid="user-where"/>
order by us.lrsj desc
limit #{begin}, #{end}
</select>
<select id="selectCyglListCount" resultType="java.lang.Integer">
SELECT count(*)
FROM tb_yw_hcypgl_cygl cygl left join sys_user us
ON us.id = cygl.glxxzjbh
WHERE
us.scbz = '0' and cygl.xxsc_pdbz='0' and dwz=#{unitcode}
<if test="cyjs != null and cyjs != ''">
and cygl.cyjs =#{cyjs}
</if>
<include refid="user-where"/>
</select>
<!--查询单个-->
<select id="selectFkXxOne" resultType="org.springblade.founder.hcypgl.entity.TbYwHcypglFkxx">
select
xxzjbh, glxxzjbh, fknr, xxsc_pdbz, xxdjdw_gajgjgdm, xxdjdw_gajgmc, xxdjry_xm, xxdjry_gmsfhm, xxdjry_lxdh, djsj, xxczdw_gajgjgdm, xxczdw_gajgmc, xxczry_xm, xxczry_gmsfhm, gxsj
from tb_yw_hcypgl_fkxx
where glxxzjbh = #{xxzjbh}
</select>
<select id="selectJsXxOne" resultType="java.lang.String">
select cyjs from tb_yw_hcypgl_cygl where xxsc_pdbz='0' and glxxzjbh=#{userId}
</select>
<sql id="user-where">
<if test="username != null and username != ''">
and us.username LIKE concat('%',#{username},'%')
</if>
<if test="trueName != null and trueName != ''">
and us.true_name LIKE concat('%',#{trueName},'%')
</if>
<if test="policemanid != null and policemanid != ''">
and us.policemanid = #{ policemanid , jdbcType=VARCHAR }
</if>
<if test="openFlag != null and openFlag != ''">
and us.open_flag = #{ openFlag, jdbcType=VARCHAR }
</if>
<if test="unitcode != null and unitcode != ''">
and us.unitcode like concat(#{ unitcode, jdbcType=VARCHAR },'%')
</if>
<if test="grade != null and grade != ''">
and us.grade = #{ grade, jdbcType=VARCHAR }
</if>
</sql>
</mapper>
package org.springblade.founder.hcypgl.service;
import org.springblade.founder.hcypgl.entity.TbYwDzqqFjVo;
import org.springblade.founder.hcypgl.entity.TbYwHcypglCygl;
import org.springblade.founder.hcypgl.entity.TbYwHcypglFkxx;
import org.springblade.founder.hcypgl.entity.TbYwHcypglXx;
import org.springblade.modules.system.entity.SysNewUser;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
/**
* 合成研判管理模块请求主表(TbYwHcypglXx)表服务接口
*
* @author liulianglang
* @since 2023-11-21 10:08:59
*/
public interface TbYwHcypglXxService {
/**
* 通过ID查询单条数据
*
* @param xxzjbh 主键
* @return 实例对象
*/
TbYwHcypglXx queryById(String xxzjbh);
/**
* 查询多条数据
*
* @param offset 查询起始位置
* @param limit 查询条数
* @return 对象列表
*/
List<TbYwHcypglXx> queryAllByLimit(int offset, int limit);
List<TbYwHcypglXx> queryAll(TbYwHcypglXx tbYwHcypglXx);
int queryAllCount(TbYwHcypglXx TbYwHcypglXx);
/**
* 新增数据
*
* @param tbYwHcypglXx 实例对象
* @return 实例对象
*/
TbYwHcypglXx insert(TbYwHcypglXx tbYwHcypglXx,MultipartFile lajdsfile, MultipartFile qtfile);
/**
* 修改数据
*
* @param tbYwHcypglXx 实例对象
* @return 实例对象
*/
TbYwHcypglXx update(TbYwHcypglXx tbYwHcypglXx,MultipartFile lajdsfile, MultipartFile qtfile);
/**
* 通过主键删除数据
*
* @param xxzjbh 主键
* @return 是否成功
*/
boolean deleteById(String xxzjbh);
boolean deleteCyglById(String xxzjbh);
TbYwHcypglCygl updateCyglById(TbYwHcypglCygl tbYwHcypglCygl);
TbYwHcypglCygl insertCyglById(TbYwHcypglCygl tbYwHcypglCygl);
TbYwHcypglXx shXzqqXx(TbYwHcypglXx tbYwHcypglXx) throws Exception;
List<TbYwDzqqFjVo> queryImgInfo(String xxzjbh);
List<TbYwDzqqFjVo> encodeToString(List<TbYwDzqqFjVo> fjs);
// 获取用户 列表
List<SysNewUser> getUserNewList(SysNewUser sysNewUser)throws Exception;
// 获取用户 个数
int getUserNewCount(SysNewUser sysNewUser)throws Exception;
// 获取用户 列表
List<SysNewUser> selectCyglList(SysNewUser sysNewUser)throws Exception;
// 获取用户 个数
int selectCyglListCount(SysNewUser sysNewUser)throws Exception;
TbYwHcypglFkxx insertFkXx(TbYwHcypglFkxx tbYwHcypglFkxx, MultipartFile fkfile);
TbYwHcypglFkxx updateFkXx(TbYwHcypglFkxx tbYwHcypglFkxx, MultipartFile fkfile);
TbYwHcypglFkxx selectFkXxOne(String id);
String selectJsXxOne(String id);
}
package org.springblade.founder.hcypgl.service.impl;
import org.apache.pdfbox.cos.COSDocument;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.rendering.PDFRenderer;
import org.springblade.common.tool.HqXjDwCommon;
import org.springblade.core.secure.utils.SecureUtil;
import org.springblade.founder.hcypgl.entity.*;
import org.springblade.founder.hcypgl.mapper.TbYwHcypglXxMapper;
import org.springblade.founder.hcypgl.service.TbYwHcypglXxService;
import org.springblade.founder.hcypgl.entity.TbYwHcypglXx;
import org.springblade.founder.utils.SysXxzjbhService;
import org.springblade.modules.system.entity.SysNewUser;
import org.springblade.modules.system.entity.XzxtUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.*;
import java.util.List;
import static org.springblade.founder.utils.Utils.getOrderIdByUUId;
/**
* 合成研判管理模块请求主表(TbYwHcypglXx)表服务实现类
*
* @author liulianglang
* @since 2023-11-21 10:09:01
*/
@Service("tbYwHcypglXxService")
public class TbYwHcypglXxServiceImpl implements TbYwHcypglXxService {
@Resource
private TbYwHcypglXxMapper tbYwHcypglXxMapper;
@Autowired
private SysXxzjbhService xxzjbhService;
/**
* 通过ID查询单条数据
*
* @param xxzjbh 主键
* @return 实例对象
*/
@Override
public TbYwHcypglXx queryById(String xxzjbh) {
return this.tbYwHcypglXxMapper.queryById(xxzjbh);
}
/**
* 查询多条数据
*
* @param offset 查询起始位置
* @param limit 查询条数
* @return 对象列表
*/
@Override
public List<TbYwHcypglXx> queryAllByLimit(int offset, int limit) {
return this.tbYwHcypglXxMapper.queryAllByLimit(offset, limit);
}
@Override
public List<TbYwHcypglXx> queryAll(TbYwHcypglXx tbYwXzqqXx) {
XzxtUser xzxtUser = SecureUtil.getUserXzxt();
String idcardparam="";
String dwcxsql="";
String useId=xzxtUser.getTenantId();
String sfbjparam=tbYwXzqqXx.getSfbj();
//县级未反馈
String xwfkstr="4,6,7,8,9";
//县级已反馈
String xfkstr="5,10";
System.out.println("id="+xzxtUser.getTenantId()+"cxid"+tbYwXzqqXx.getUserId());
//本单位查询
String dm = xzxtUser.getUnitcode();
String grade = xzxtUser.getGrade();
if ("T".equals(grade) || "S".equals(grade)) {
dm = dm.substring(0, 2);
} else if ("D".equals(grade)) {
dm = dm.substring(0, 4);
} else if ("X".equals(grade)) {
dm = dm.substring(0, 8);
} else if ("K".equals(grade)) {
dm = dm.substring(0, 10);
}
//
// 下级单位查询
tbYwXzqqXx.setUnitcode(dm);
tbYwXzqqXx.setGrade(grade);
if(!StringUtils.isEmpty(tbYwXzqqXx.getXzzt())){
if (!"D".equals(xzxtUser.getGrade()) && !"S".equals(xzxtUser.getGrade())) {
if("4".equals(tbYwXzqqXx.getXzzt())){
dwcxsql="and xzzt in ('4','6','7','8','9')";
tbYwXzqqXx.setDwcxsql(dwcxsql);
tbYwXzqqXx.setXzzt("");
}
if("5".equals(tbYwXzqqXx.getXzzt())){
dwcxsql="and xzzt in ('5','10')";
tbYwXzqqXx.setDwcxsql(dwcxsql);
tbYwXzqqXx.setXzzt("");
}
}
if ("D".equals(xzxtUser.getGrade()) ) {
if("1".equals(tbYwXzqqXx.getXzzt())){
dwcxsql="and xzzt in ('1','6')";
tbYwXzqqXx.setDwcxsql(dwcxsql);
tbYwXzqqXx.setXzzt("");
}
if("2".equals(tbYwXzqqXx.getXzzt())){
dwcxsql="and xzzt in ('2','8')";
tbYwXzqqXx.setDwcxsql(dwcxsql);
tbYwXzqqXx.setXzzt("");
}
if("4".equals(tbYwXzqqXx.getXzzt())){
dwcxsql="and xzzt in ('4','9')";
tbYwXzqqXx.setDwcxsql(dwcxsql);
tbYwXzqqXx.setXzzt("");
}
if("5".equals(tbYwXzqqXx.getXzzt())){
dwcxsql="and xzzt in ('5','10')";
tbYwXzqqXx.setDwcxsql(dwcxsql);
tbYwXzqqXx.setXzzt("");
}
}
}
List<TbYwHcypglXx> list=tbYwHcypglXxMapper.queryAll(tbYwXzqqXx);
/**
* 协作状态 0-草稿,1-待审批,2-审批不通过,3-审批通过,4-待市反馈,5-市已反馈,6-待市审批,7-市审批通过
* 8-市审批不通过 ,9-待省反馈,10-省已反馈
*/
for (TbYwHcypglXx xx:list) {
if (!"D".equals(xzxtUser.getGrade()) && !"S".equals(xzxtUser.getGrade())) {
String zt=xx.getXzzt();
if(Integer.parseInt(zt)>3){
if( xwfkstr.contains(zt)){
xx.setXzztStr("待反馈");
}else {
xx.setXzztStr("已反馈");
}
}
}
if("S".equals(xzxtUser.getGrade())){
String zt=xx.getXzzt();
if("9".equals(zt)){
xx.setXzztStr("待本级反馈");
}else if("10".equals(zt)){
xx.setXzztStr("本级已反馈");
}
}
if("bdw".equals(sfbjparam)) {
if ("D".equals(xzxtUser.getGrade())) {
String zt = xx.getXzzt();
if ("4".equals(zt)) {
xx.setXzztStr("待反馈");
} else if ("5".equals(zt)) {
xx.setXzztStr("已反馈");
}
}
}
}
return list;
}
@Override
public int queryAllCount(TbYwHcypglXx tbYwHcypglXx) {
XzxtUser xzxtUser = SecureUtil.getUserXzxt();
String idcardparam="";
return this.tbYwHcypglXxMapper.queryAllCount(tbYwHcypglXx);
}
/**
* 新增数据
*
* @param tbYwHcypglXx 实例对象
* @return 实例对象
*/
@Override
public TbYwHcypglXx insert(TbYwHcypglXx tbYwHcypglXx, MultipartFile lajdsfile, MultipartFile qtfile) {
XzxtUser xzxtUser = SecureUtil.getUserXzxt();
tbYwHcypglXx.setDjUser(xzxtUser);
String blxxzjbh = xxzjbhService.getXxzjbh(xzxtUser.getUnitcode(),null);//xxzjbh
tbYwHcypglXx.setXxzjbh(blxxzjbh);
tbYwHcypglXx.setGrade(xzxtUser.getGrade());
// tbYwHcypglXx.setXzzt("1");
// if(!StringUtils.isEmpty(tbYwHcypglXx.getLadwdm())){
// tbYwHcypglXx.setXzdwmc(tbYwHcypglXxMapper.queryNameByCode("CODE_UNIT",tbYwHcypglXx.getXzdwdm()));
// }
tbYwHcypglXxMapper.insert(tbYwHcypglXx);
try {
if (lajdsfile != null) {
saveAttachment(blxxzjbh, lajdsfile, "1");
}
if (qtfile != null) {
saveAttachment(blxxzjbh, qtfile, "2");
}
}catch (Exception e){
e.printStackTrace();
}
return tbYwHcypglXx;
}
@Override
public TbYwHcypglFkxx insertFkXx(TbYwHcypglFkxx tbYwHcypglFkxx, MultipartFile fkfile){
XzxtUser xzxtUser = SecureUtil.getUserXzxt();
tbYwHcypglFkxx.setDjUser(xzxtUser);
String blxxzjbh=getOrderIdByUUId();
tbYwHcypglFkxx.setXxzjbh(blxxzjbh);
tbYwHcypglXxMapper.insertFkXx(tbYwHcypglFkxx);
TbYwHcypglXx tbYwHcypglXx=new TbYwHcypglXx();
tbYwHcypglXx.setXzzt(tbYwHcypglFkxx.getXzzt());
tbYwHcypglXx.setXxzjbh(tbYwHcypglFkxx.getGlxxzjbh());
tbYwHcypglXx.setUpUser(xzxtUser);
tbYwHcypglXxMapper.update(tbYwHcypglXx);
try {
if (fkfile != null) {
saveAttachment(blxxzjbh, fkfile, "3");
}
}catch (Exception e){
e.printStackTrace();
}
return tbYwHcypglFkxx;
}
@Override
public TbYwHcypglFkxx updateFkXx(TbYwHcypglFkxx tbYwHcypglFkxx, MultipartFile fkfile){
XzxtUser xzxtUser = SecureUtil.getUserXzxt();
tbYwHcypglFkxx.setUpUser(xzxtUser);
tbYwHcypglXxMapper.updateFkXx(tbYwHcypglFkxx);
try {
if (fkfile != null) {
saveAttachment(tbYwHcypglFkxx.getXxzjbh(), fkfile, "3");
}
String removezpStr=tbYwHcypglFkxx.getRemovezpStr();
if (StringUtils.hasText(removezpStr)) {
String[] removedXxzjbhs = removezpStr.split(",");
for (String fjXxzjbh : removedXxzjbhs) {
tbYwHcypglXxMapper.updateDzqqFjXxscPdbz(tbYwHcypglFkxx.getXxzjbh(), "", fjXxzjbh);
}
}
}catch (Exception e){
e.printStackTrace();
}
return tbYwHcypglFkxx;
}
@Override
public TbYwHcypglFkxx selectFkXxOne(String id) {
TbYwHcypglFkxx xx=tbYwHcypglXxMapper.selectFkXxOne(id);
List<TbYwDzqqFjVo> fj = tbYwHcypglXxMapper.selectFjInfo(null, xx.getXxzjbh());
if(fj!=null){
fj = encodeToString(fj);
xx.setWj(fj);
}
return xx;
}
@Override
public String selectJsXxOne(String id) {
return tbYwHcypglXxMapper.selectJsXxOne(id);
}
//保存附件至tb_yw_xzqq_fj表
private void saveAttachment(String dzXxzjbh, MultipartFile multipartFile, String fjlx) throws IOException {
XzxtUser userXzxt = SecureUtil.getUserXzxt();
TbYwHcypglFj fj = new TbYwHcypglFj();
fj.setXxzjbh(getOrderIdByUUId());
fj.setDzXxzjbh(dzXxzjbh);
String dzwjbt = multipartFile.getOriginalFilename();
fj.setDzwjbt(dzwjbt);
String dzwjgs = dzwjbt.substring(dzwjbt.lastIndexOf("."));
fj.setDzwjgs(dzwjgs.toLowerCase());
fj.setDzwjnr(multipartFile.getBytes());
fj.setFjlx(fjlx);
fj.setCreateTime(new Date());
fj.setCreateBy(userXzxt.getIdentitycard());
fj.setUpdateTime(new Date());
fj.setUpdateBy(userXzxt.getIdentitycard());
fj.setXxscPdbz("0");
tbYwHcypglXxMapper.insertFj(fj);
}
/**
* 修改数据
*
* @param tbYwHcypglXx 实例对象
* @return 实例对象
*/
@Override
public TbYwHcypglXx update(TbYwHcypglXx tbYwHcypglXx,MultipartFile lajdsfile, MultipartFile qtfile) {
XzxtUser xzxtUser = SecureUtil.getUserXzxt();
String blxxzjbh=tbYwHcypglXx.getXxzjbh();
tbYwHcypglXx.setUpUser(xzxtUser);
this.tbYwHcypglXxMapper.update(tbYwHcypglXx);
try {
if (lajdsfile != null) {
saveAttachment(blxxzjbh, lajdsfile, "1");
}
if (qtfile != null) {
saveAttachment(blxxzjbh, qtfile, "2");
}
String removezpStr=tbYwHcypglXx.getRemovezpStr();
if (StringUtils.hasText(removezpStr)) {
String[] removedXxzjbhs = removezpStr.split(",");
for (String fjXxzjbh : removedXxzjbhs) {
tbYwHcypglXxMapper.updateDzqqFjXxscPdbz(blxxzjbh, "", fjXxzjbh);
}
}
}catch (Exception e){
e.printStackTrace();
}
return null;
}
/**
* 通过主键删除数据
*
* @param xxzjbh 主键
* @return 是否成功
*/
@Override
public boolean deleteById(String xxzjbh) {
TbYwHcypglXx tbYwHcypglXx =new TbYwHcypglXx();
XzxtUser xzxtUser = SecureUtil.getUserXzxt();
tbYwHcypglXx.setUpUser(xzxtUser);
tbYwHcypglXx.setXxzjbh(xxzjbh);
return this.tbYwHcypglXxMapper.deleteById(tbYwHcypglXx) > 0;
}
@Override
public boolean deleteCyglById(String xxzjbh) {
TbYwHcypglCygl tbYwHcypglCygl =new TbYwHcypglCygl();
XzxtUser xzxtUser = SecureUtil.getUserXzxt();
tbYwHcypglCygl.setUpUser(xzxtUser);
tbYwHcypglCygl.setXxzjbh(xxzjbh);
return this.tbYwHcypglXxMapper.deleteCyglById(tbYwHcypglCygl) > 0;
}
@Override
public TbYwHcypglCygl updateCyglById(TbYwHcypglCygl tbYwHcypglCygl) {
XzxtUser xzxtUser = SecureUtil.getUserXzxt();
tbYwHcypglCygl.setUpUser(xzxtUser);
tbYwHcypglXxMapper.updateCyglById(tbYwHcypglCygl);
return null;
}
@Override
public TbYwHcypglCygl insertCyglById(TbYwHcypglCygl tbYwHcypglCygl) {
XzxtUser xzxtUser = SecureUtil.getUserXzxt();
tbYwHcypglCygl.setDjUser(xzxtUser);
String blxxzjbh=getOrderIdByUUId();
tbYwHcypglCygl.setXxzjbh(blxxzjbh);
String dm = xzxtUser.getUnitcode();
String grade = xzxtUser.getGrade();
if ("T".equals(grade) || "S".equals(grade)) {
dm = dm.substring(0, 2);
} else if ("D".equals(grade)) {
dm = dm.substring(0, 4);
} else if ("X".equals(grade)) {
dm = dm.substring(0, 8);
} else if ("K".equals(grade)) {
dm = dm.substring(0, 10);
}
tbYwHcypglCygl.setDwz(dm);
tbYwHcypglXxMapper.insertCyglById(tbYwHcypglCygl);
return null;
}
@Override
public TbYwHcypglXx shXzqqXx(TbYwHcypglXx tbYwHcypglXx) throws Exception {
XzxtUser xzxtUser = SecureUtil.getUserXzxt();
this.tbYwHcypglXxMapper.update(tbYwHcypglXx);
return tbYwHcypglXx;
}
@Override
public List<TbYwDzqqFjVo> queryImgInfo(String xxzjbh) {
TbYwDzqqFjVo vo = new TbYwDzqqFjVo();
//查询立案决定书
List<TbYwDzqqFjVo> lajdsFj = tbYwHcypglXxMapper.selectFjInfo(null, xxzjbh);
if(lajdsFj!=null) {
lajdsFj = encodeToString(lajdsFj);
}
return lajdsFj;
}
@Override
public List<TbYwDzqqFjVo> encodeToString(List<TbYwDzqqFjVo> fjs) {
//Base64.Encoder encoder = Base64.getEncoder();
List<TbYwDzqqFjVo> resultFj = new ArrayList<>();
for (TbYwDzqqFjVo fj : fjs) {
// 返回Base64编码过的字节数组字符串
//String zp64bite = encoder.encodeToString(fj.getDzwjnr());
//fj.setDzwjnrBase64(QqzcFinalConstants.PIC_PREFIX + zp64bite);
//fj.setDzwjnr(new byte[0]);
String dzwjgs = fj.getDzwjgs();
byte[] dzwjnr = fj.getDzwjnr();
if (dzwjnr == null || dzwjnr.length == 0) {
continue;
}
if (".jpg,.JPG,.png,.PNG,.webp,.WEBP".contains(dzwjgs)) {
fj.setDzwjnrBase64(
"data:image/jpg;base64," + Base64.getEncoder().encodeToString(fj.getDzwjnr()));
} else if (".pdf,.PDF".contains(dzwjgs.toLowerCase())) {
//PDF的转为img
try {
pdf2img(fj);
} catch (IOException e) {
e.printStackTrace();
System.out.println("pdf转图片格式出现错误: {}");
}
}
fj.setDzwjnr(null);
resultFj.add(fj);
}
return resultFj;
}
public void pdf2img(TbYwDzqqFjVo fjVo) throws IOException {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
PDDocument doc = null;
try {
doc = PDDocument.load(fjVo.getDzwjnr());
PDFRenderer renderer = new PDFRenderer(doc);
int pages = doc.getNumberOfPages();
List<BufferedImage> images = new ArrayList<>();
BufferedImage image = null;
StringBuilder builder = new StringBuilder();
for (int i = 0; i < pages; i++) {
BufferedImage bufferedImage = renderer.renderImage(i);
images.add(bufferedImage);
}
if (images.size() > 1) {
//多张的话合并为一张
image = mergeImage(images);
} else {
image = images.get(0);
}
ImageIO.write(image, "jpg", byteArrayOutputStream);
String imageBase64 = builder.append("data:image/jpg;base64,").
append(Base64.getEncoder().encodeToString(byteArrayOutputStream.toByteArray())).toString();
fjVo.setDzwjnrBase64(imageBase64);
builder.delete(0, builder.length());
} finally {
byteArrayOutputStream.close();
if (doc != null) {
COSDocument document = doc.getDocument();
document.close();
doc.close();
}
}
}
public BufferedImage mergeImage(List<BufferedImage> images) {
//总高
int heightAll = 0;
//总宽
int widthAll = 0;
for (BufferedImage image : images) {
heightAll += image.getHeight();
widthAll = image.getWidth();
}
//新建一个 BufferedImage
BufferedImage destImage = new BufferedImage(widthAll, heightAll, BufferedImage.TYPE_INT_RGB);
Graphics2D graphics = destImage.createGraphics();
//纵向绘图
int height = 0;
for (BufferedImage image : images) {
graphics.drawImage(image, 0, height, null);
height += image.getHeight();
}
graphics.dispose();
return destImage;
}
// 用户的个数
@Override
public int getUserNewCount(SysNewUser sysNewUser) throws Exception {
XzxtUser xzxtUser = SecureUtil.getUserXzxt();
String dwUnitCode = xzxtUser.getUnitcode(); //当前单位代码
// sysNewUser.setUnitcode(dwUnitCode);
String dm = xzxtUser.getUnitcode();
String grade = xzxtUser.getGrade();
if ("T".equals(grade) || "S".equals(grade)) {
dm = dm.substring(0, 2);
} else if ("D".equals(grade)) {
dm = dm.substring(0, 4);
} else if ("X".equals(grade)) {
dm = dm.substring(0, 8);
} else if ("K".equals(grade)) {
dm = dm.substring(0, 10);
}
sysNewUser.setUnitcode(dm);
sysNewUser.setGrade(grade);
return tbYwHcypglXxMapper.getUserNewCount(sysNewUser);
}
// 用户的列表展示
@Override
public List<SysNewUser> getUserNewList(SysNewUser sysNewUser) throws Exception {
XzxtUser xzxtUser = SecureUtil.getUserXzxt();
String dwUnitCode = xzxtUser.getUnitcode(); //当前单位代码
String dm = xzxtUser.getUnitcode();
String grade = xzxtUser.getGrade();
if ("T".equals(grade) || "S".equals(grade)) {
dm = dm.substring(0, 2);
} else if ("D".equals(grade)) {
dm = dm.substring(0, 4);
} else if ("X".equals(grade)) {
dm = dm.substring(0, 8);
} else if ("K".equals(grade)) {
dm = dm.substring(0, 10);
}
sysNewUser.setUnitcode(dm);
sysNewUser.setGrade(grade);
List<SysNewUser> userNewList = tbYwHcypglXxMapper.getUserNewList(sysNewUser);
return userNewList;
}
// 用户的列表展示
@Override
public List<SysNewUser> selectCyglList(SysNewUser sysNewUser) throws Exception {
XzxtUser xzxtUser = SecureUtil.getUserXzxt();
String dwUnitCode = xzxtUser.getUnitcode(); //当前单位代码
String dm = xzxtUser.getUnitcode();
String grade = xzxtUser.getGrade();
if ("T".equals(grade) || "S".equals(grade)) {
dm = dm.substring(0, 2);
} else if ("D".equals(grade)) {
dm = dm.substring(0, 4);
} else if ("X".equals(grade)) {
dm = dm.substring(0, 8);
} else if ("K".equals(grade)) {
dm = dm.substring(0, 10);
}
sysNewUser.setUnitcode(dm);
sysNewUser.setGrade(grade);
List<SysNewUser> userNewList = tbYwHcypglXxMapper.selectCyglList(sysNewUser);
return userNewList;
}
@Override
public int selectCyglListCount(SysNewUser sysNewUser) throws Exception {
XzxtUser xzxtUser = SecureUtil.getUserXzxt();
String dwUnitCode = xzxtUser.getUnitcode(); //当前单位代码
String dm = xzxtUser.getUnitcode();
String grade = xzxtUser.getGrade();
if ("T".equals(grade) || "S".equals(grade)) {
dm = dm.substring(0, 2);
} else if ("D".equals(grade)) {
dm = dm.substring(0, 4);
} else if ("X".equals(grade)) {
dm = dm.substring(0, 8);
} else if ("K".equals(grade)) {
dm = dm.substring(0, 10);
}
sysNewUser.setUnitcode(dm);
sysNewUser.setGrade(grade);
return tbYwHcypglXxMapper.selectCyglListCount(sysNewUser);
}
}
package org.springblade.founder.shzy.controller;
import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.codec.Charsets;
import org.springblade.founder.gnsyrzlog.LogOper;
import org.springblade.founder.shzy.entity.KuaishouGjXx;
import org.springblade.founder.shzy.entity.KuaishouZcXx;
import org.springblade.founder.shzy.entity.SysYhczrz;
import org.springblade.founder.shzy.entity.TbShzysjDdxx;
import org.springblade.founder.shzy.service.KuaiShouService;
import org.springblade.founder.shzy.util.YhczRzUtil;
import org.springblade.founder.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping(value = "/ks")
public class KuaiShouController {
@Autowired
private KuaiShouService kuaiShouService;
@PostMapping("zcxxList")
@ApiOperation(value = "注册信息", notes = "注册信息")
@LogOper(czxxLbdm = "01", yymcJyqk = "快手注册信息查询", czxxJyqk = "快手注册信息查询列表")
public R zcxxList(KuaishouZcXx zc) {
try{
SysYhczrz sysYhczrz=new SysYhczrz();
sysYhczrz.setCzlx("查询");
sysYhczrz.setCzlxdm("04");
Map<String, Object> map = JSON.parseObject(JSON.toJSONString(zc));
sysYhczrz.setYymcdm("B0703");
sysYhczrz.setYymcJyqk("快手注册信息查询");
YhczRzUtil.doCzrz(sysYhczrz,map);
return R.ok().data(kuaiShouService.queryZcxxBySjh(zc));
}catch (Exception e){
e.printStackTrace();
return R.error(e.getMessage());
}
}
@RequestMapping("/exportZcxxList")
@ResponseBody
public void exportZcxxList(KuaishouZcXx zc, HttpServletResponse response, HttpServletRequest request) throws IOException {
SysYhczrz sysYhczrz=new SysYhczrz();
sysYhczrz.setCzlx("导出");
sysYhczrz.setCzlxdm("06");
Map<String, Object> map = JSON.parseObject(JSON.toJSONString(zc));
sysYhczrz.setYymcdm("B070301");
sysYhczrz.setYymcJyqk("导出快手注册信息");
YhczRzUtil.doCzrz(sysYhczrz,map);
zc.setLimit(10000);
zc.setPage(1);
Map<String, Object> result = kuaiShouService.queryZcxxBySjh(zc);
List<KuaishouZcXx> dzqqXxList = (List<KuaishouZcXx>) result.get("rows");
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding(Charsets.UTF_8.name());
String fileName = URLEncoder.encode("注册信息", Charsets.UTF_8.name());
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
EasyExcel.write(response.getOutputStream(), KuaishouZcXx.class).sheet("注册信息").doWrite(dzqqXxList);
}
@PostMapping("gjxxList")
@ApiOperation(value = "快手轨迹信息", notes = "快手轨迹信息")
@LogOper(czxxLbdm = "01", yymcJyqk = "快手轨迹信息查询", czxxJyqk = "快手轨迹信息查询列表")
public R gjxxList(KuaishouGjXx gjXx) {
try{
SysYhczrz sysYhczrz=new SysYhczrz();
sysYhczrz.setCzlx("查询");
sysYhczrz.setCzlxdm("04");
Map<String, Object> map = JSON.parseObject(JSON.toJSONString(gjXx));
sysYhczrz.setYymcdm("B070302");
sysYhczrz.setYymcJyqk("快手账号轨迹信息查询");
YhczRzUtil.doCzrz(sysYhczrz,map);
return R.ok().data(kuaiShouService.gjxxList(gjXx));
}catch (Exception e){
e.printStackTrace();
return R.error(e.getMessage());
}
}
@RequestMapping("/exportGjxxList")
@ResponseBody
public void exportGjxxList(KuaishouGjXx gjXx, HttpServletResponse response, HttpServletRequest request) throws IOException {
SysYhczrz sysYhczrz=new SysYhczrz();
sysYhczrz.setCzlx("导出");
sysYhczrz.setCzlxdm("06");
Map<String, Object> map = JSON.parseObject(JSON.toJSONString(gjXx));
sysYhczrz.setYymcdm("B070303");
sysYhczrz.setYymcJyqk("导出快手账号轨迹信息");
YhczRzUtil.doCzrz(sysYhczrz,map);
gjXx.setLimit(10000);
gjXx.setPage(1);
Map<String, Object> result = kuaiShouService.gjxxList(gjXx);
List<KuaishouGjXx> dzqqXxList = (List<KuaishouGjXx>) result.get("rows");
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding(Charsets.UTF_8.name());
String fileName = URLEncoder.encode("轨迹信息", Charsets.UTF_8.name());
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
EasyExcel.write(response.getOutputStream(), KuaishouGjXx.class).sheet("轨迹信息").doWrite(dzqqXxList);
}
}
package org.springblade.founder.shzy.controller;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.ApiOperation;
import org.springblade.founder.gnsyrzlog.LogOper;
import org.springblade.founder.shzy.entity.SysYhczrz;
import org.springblade.founder.shzy.entity.TbSfDrsj;
import org.springblade.founder.shzy.entity.TbShzysjDdxx;
import org.springblade.founder.shzy.service.MtxxService;
import org.springblade.founder.shzy.util.YhczRzUtil;
import org.springblade.founder.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping(value = "/mt")
public class MtxxController {
@Autowired
private MtxxService mtxxService;
@PostMapping("queryMtxxBySjh")
@ApiOperation(value = "美团信息", notes = "美团信息")
@LogOper(czxxLbdm = "01", yymcJyqk = "历史社会资源查询", czxxJyqk = "外卖记录查询列表")
public R queryMtxxBySjh(TbShzysjDdxx mtxx) {
try{
SysYhczrz sysYhczrz=new SysYhczrz();
sysYhczrz.setCzlx("查询");
sysYhczrz.setCzlxdm("04");
Map<String, Object> map = JSON.parseObject(JSON.toJSONString(mtxx));
sysYhczrz.setYymcdm("B0701");
sysYhczrz.setYymcJyqk("外卖记录查询");
YhczRzUtil.doCzrz(sysYhczrz,map);
return R.ok().data(mtxxService.queryMtxxBySjh(mtxx));
}catch (Exception e){
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("queryWlxxBySjh")
@ApiOperation(value = "物流信息", notes = "物流信息")
@LogOper(czxxLbdm = "01", yymcJyqk = "历史社会资源查询", czxxJyqk = "查询物流信息")
public R queryWlxxBySjh(TbSfDrsj wlxx) {
try{
SysYhczrz sysYhczrz=new SysYhczrz();
sysYhczrz.setCzlx("查询");
sysYhczrz.setCzlxdm("04");
Map<String, Object> map = JSON.parseObject(JSON.toJSONString(wlxx));
sysYhczrz.setYymcdm("B0702");
sysYhczrz.setYymcJyqk("物流记录查询");
YhczRzUtil.doCzrz(sysYhczrz,map);
return R.ok().data(mtxxService.queryWlxxBySjh(wlxx));
}catch (Exception e){
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("doAnalyseWlxxBySjh")
@ApiOperation(value = "物流信息", notes = "物流信息")
public R doAnalyseWlxxBySjh(TbSfDrsj wlxx) {
try{
return R.ok().data(mtxxService.queryWlxxBySjh(wlxx));
}catch (Exception e){
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("mtRqsjBySjh")
@ApiOperation(value = "美团日期统计", notes = "美团日期统计")
@LogOper(czxxLbdm = "01", yymcJyqk = "历史社会资源查询", czxxJyqk = "美团年份日期统计")
public R mtRqsjBySjh(TbShzysjDdxx tbShzysjDdxx) {
try{
return R.ok().data(mtxxService.mtRqsjBySjh(tbShzysjDdxx));
}catch (Exception e){
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("mtYuefRqsjBySjh")
@ApiOperation(value = "美团日期统计", notes = "美团日期统计")
@LogOper(czxxLbdm = "01", yymcJyqk = "历史社会资源查询", czxxJyqk = "美团月份日期统计")
public R mtYuefRqsjBySjh(TbShzysjDdxx tbShzysjDdxx) {
try{
return R.ok().data(mtxxService.mtYuefRqsjBySjh(tbShzysjDdxx));
}catch (Exception e){
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("mtBrxdCountBySjh")
@ApiOperation(value = "美团本人下单统计", notes = "美团本人下单统计")
@LogOper(czxxLbdm = "01", yymcJyqk = "历史社会资源查询", czxxJyqk = "美团本人下单统计")
public R mtBrxdCountBySjh(TbShzysjDdxx tbShzysjDdxx) {
try{
return R.ok().data(mtxxService.mtBrxdCountBySjh(tbShzysjDdxx));
}catch (Exception e){
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("mtShdztjBySjh")
@ApiOperation(value = "美团地址统计", notes = "美团地址统计")
@LogOper(czxxLbdm = "01", yymcJyqk = "历史社会资源查询", czxxJyqk = "美团地址统计")
public R mtShdztjBySjh(TbShzysjDdxx tbShzysjDdxx) {
try{
return R.ok().data(mtxxService.mtShdztjBySjh(tbShzysjDdxx));
}catch (Exception e){
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("mtQmdtjBySjh")
@ApiOperation(value = "美团亲密度统计", notes = "美团亲密度统计")
@LogOper(czxxLbdm = "01", yymcJyqk = "历史社会资源查询", czxxJyqk = "美团亲密度统计")
public R mtQmdtjBySjh(TbShzysjDdxx tbShzysjDdxx) {
try{
return R.ok().data(mtxxService.mtQmdtjBySjh(tbShzysjDdxx));
}catch (Exception e){
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("mtDzListTjBySjh")
@ApiOperation(value = "美团地址列表查询", notes = "美团地址列表查询")
@LogOper(czxxLbdm = "01", yymcJyqk = "历史社会资源查询", czxxJyqk = "美团地址列表查询")
public R mtDzListTjBySjh(TbShzysjDdxx tbShzysjDdxx) {
try{
SysYhczrz sysYhczrz=new SysYhczrz();
sysYhczrz.setCzlx("查询");
sysYhczrz.setCzlxdm("04");
Map<String, Object> map = JSON.parseObject(JSON.toJSONString(tbShzysjDdxx));
sysYhczrz.setYymcdm("B070102");
sysYhczrz.setYymcJyqk("外卖同一地址下单次数快捷查询");
YhczRzUtil.doCzrz(sysYhczrz,map);
return R.ok().data(mtxxService.mtDzListTjBySjh(tbShzysjDdxx));
}catch (Exception e){
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("mtQmdListTjBySjh")
@ApiOperation(value = "美团亲密度列表查询", notes = "美团亲密度列表查询")
@LogOper(czxxLbdm = "01", yymcJyqk = "历史社会资源查询", czxxJyqk = "美团亲密度列表查询")
public R mtQmdListTjBySjh(TbShzysjDdxx tbShzysjDdxx) {
try{
SysYhczrz sysYhczrz=new SysYhczrz();
sysYhczrz.setCzlx("查询");
sysYhczrz.setCzlxdm("04");
Map<String, Object> map = JSON.parseObject(JSON.toJSONString(tbShzysjDdxx));
sysYhczrz.setYymcdm("B070104");
sysYhczrz.setYymcJyqk("外卖关系亲密度快捷查询");
YhczRzUtil.doCzrz(sysYhczrz,map);
return R.ok().data(mtxxService.mtQmdListTjBySjh(tbShzysjDdxx));
}catch (Exception e){
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("wlRqsjBySjh")
@ApiOperation(value = "物流日期统计", notes = "物流日期统计")
@LogOper(czxxLbdm = "01", yymcJyqk = "历史社会资源查询", czxxJyqk = "物流年份日期统计")
public R wlRqsjBySjh(TbSfDrsj tbSfDrsj) {
try{
return R.ok().data(mtxxService.wlRqsjBySjh(tbSfDrsj));
}catch (Exception e){
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("wlYuefRqsjBySjh")
@ApiOperation(value = "物流月份日期统计", notes = "物流月份日期统计")
@LogOper(czxxLbdm = "01", yymcJyqk = "历史社会资源查询", czxxJyqk = "物流月份日期统计")
public R wlYuefRqsjBySjh(TbSfDrsj tbSfDrsj) {
try{
return R.ok().data(mtxxService.wlYuefRqsjBySjh(tbSfDrsj));
}catch (Exception e){
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("wlBrjjBySjh")
@ApiOperation(value = "物流本人下单统计", notes = "物流本人下单统计")
@LogOper(czxxLbdm = "01", yymcJyqk = "历史社会资源查询", czxxJyqk = "物流本人下单统计")
public R wlBrjjBySjh(TbSfDrsj tbSfDrsj) {
try{
return R.ok().data(mtxxService.wlBrjjBySjh(tbSfDrsj));
}catch (Exception e){
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("wlShdztjBySjh")
@ApiOperation(value = "物流地址统计", notes = "物流地址统计")
@LogOper(czxxLbdm = "01", yymcJyqk = "历史社会资源查询", czxxJyqk = "物流地址统计")
public R wlShdztjBySjh(TbSfDrsj tbSfDrsj) {
try{
return R.ok().data(mtxxService.wlShdztjBySjh(tbSfDrsj));
}catch (Exception e){
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("wlSftjBySjh")
@ApiOperation(value = "物流省份统计", notes = "物流省份统计")
@LogOper(czxxLbdm = "01", yymcJyqk = "历史社会资源查询", czxxJyqk = "物流省份统计")
public R wlSftjBySjh(TbSfDrsj tbSfDrsj) {
try{
return R.ok().data(mtxxService.wlSftjBySjh(tbSfDrsj));
}catch (Exception e){
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("wlQmdtjBySjh")
@ApiOperation(value = "物流亲密度统计", notes = "物流亲密度统计")
@LogOper(czxxLbdm = "01", yymcJyqk = "历史社会资源查询", czxxJyqk = "物流亲密度统计")
public R wlQmdtjBySjh(TbSfDrsj tbSfDrsj) {
try{
return R.ok().data(mtxxService.wlQmdtjBySjh(tbSfDrsj));
}catch (Exception e){
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("wlDzListTjBySjh")
@ApiOperation(value = "物流地址列表查询统计", notes = "物流地址列表查询统计")
@LogOper(czxxLbdm = "01", yymcJyqk = "历史社会资源查询", czxxJyqk = "物流地址列表查询")
public R wlDzListTjBySjh(TbSfDrsj tbSfDrsj) {
try{
SysYhczrz sysYhczrz=new SysYhczrz();
sysYhczrz.setCzlx("查询");
sysYhczrz.setCzlxdm("04");
Map<String, Object> map = JSON.parseObject(JSON.toJSONString(tbSfDrsj));
sysYhczrz.setYymcdm("B070203");
sysYhczrz.setYymcJyqk("物流同一地址下单次数快捷查询");
YhczRzUtil.doCzrz(sysYhczrz,map);
return R.ok().data(mtxxService.wlDzListTjBySjh(tbSfDrsj));
}catch (Exception e){
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("wlQmdListTjBySjh")
@ApiOperation(value = "物流亲密度列表查询统计", notes = "物流亲密度列表查询统计")
@LogOper(czxxLbdm = "01", yymcJyqk = "历史社会资源查询", czxxJyqk = "物流亲密度列表查询")
public R wlQmdListTjBySjh(TbSfDrsj tbSfDrsj) {
try{
SysYhczrz sysYhczrz=new SysYhczrz();
sysYhczrz.setCzlx("查询");
sysYhczrz.setCzlxdm("04");
Map<String, Object> map = JSON.parseObject(JSON.toJSONString(tbSfDrsj));
sysYhczrz.setYymcdm("B070205");
sysYhczrz.setYymcJyqk("物流关系亲密度快捷查询");
YhczRzUtil.doCzrz(sysYhczrz,map);
return R.ok().data(mtxxService.wlQmdListTjBySjh(tbSfDrsj));
}catch (Exception e){
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("wlSfListTjBySjh")
@ApiOperation(value = "物流省份列表查询统计", notes = "物流省份列表查询统计")
@LogOper(czxxLbdm = "01", yymcJyqk = "历史社会资源查询", czxxJyqk = "物流省份列表查询")
public R wlSfListTjBySjh(TbSfDrsj tbSfDrsj) {
try{
SysYhczrz sysYhczrz=new SysYhczrz();
sysYhczrz.setCzlx("查询");
sysYhczrz.setCzlxdm("04");
Map<String, Object> map = JSON.parseObject(JSON.toJSONString(tbSfDrsj));
sysYhczrz.setYymcdm("B070201");
sysYhczrz.setYymcJyqk("物流省份快捷查询");
YhczRzUtil.doCzrz(sysYhczrz,map);
return R.ok().data(mtxxService.wlSfListTjBySjh(tbSfDrsj));
}catch (Exception e){
e.printStackTrace();
return R.error(e.getMessage());
}
}
}
package org.springblade.founder.shzy.controller;
import io.swagger.annotations.ApiOperation;
import org.springblade.founder.shzy.entity.TbSfDrsj;
import org.springblade.founder.shzy.entity.TbShzysjDdxx;
import org.springblade.founder.shzy.service.MtxxService;
import org.springblade.founder.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping(value = "/xhmt")
public class XhMtController {
@Autowired
private MtxxService mtxxService;
@PostMapping("mtQmdtjMclb")
@ApiOperation(value = "美团亲密度统计列表", notes = "美团亲密度统计列表")
public R mtQmdtjMclb(TbShzysjDdxx tbShzysjDdxx) {
try{
return R.ok().data(mtxxService.mtQmdtjMclb(tbShzysjDdxx));
}catch (Exception e){
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("mtdztjMclb")
@ApiOperation(value = "美团亲密度统计列表", notes = "美团亲密度统计列表")
public R mtdztjMclb(TbShzysjDdxx tbShzysjDdxx) {
try{
return R.ok().data(mtxxService.mtdztjMclb(tbShzysjDdxx));
}catch (Exception e){
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("wlQmdtjMclb")
@ApiOperation(value = "物流亲密度统计列表", notes = "物流亲密度统计列表")
public R wlQmdtjMclb(TbShzysjDdxx tbShzysjDdxx) {
try{
return R.ok().data(mtxxService.wlQmdtjMclb(tbShzysjDdxx));
}catch (Exception e){
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("wldztjMclb")
@ApiOperation(value = "物流dz统计列表", notes = "物流dz统计列表")
public R wldztjMclb(TbShzysjDdxx tbShzysjDdxx) {
try{
return R.ok().data(mtxxService.wldztjMclb(tbShzysjDdxx));
}catch (Exception e){
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("queryWlxxBySjh")
@ApiOperation(value = "物流信息", notes = "物流信息")
public R queryWlxxBySjh(TbSfDrsj wlxx) {
try{
return R.ok().data(mtxxService.queryWlxxBySjhtest(wlxx));
}catch (Exception e){
e.printStackTrace();
return R.error(e.getMessage());
}
}
}
package org.springblade.founder.shzy.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CountNameVo {
/**
* 百分比
*/
private String bfb;
private String maxsj;
/**
* 总数
*/
private Long count;
public Long getCount() {
return count;
}
public void setCount(Long count) {
this.count = count;
}
public String getBfb() {
return bfb;
}
public void setBfb(String bfb) {
this.bfb = bfb;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
/**
* 名称
*/
private String name;
/**
* 代码
*/
private String code;
}
package org.springblade.founder.shzy.entity;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
@Data
@ExcelIgnoreUnannotated
@ColumnWidth(25)
public class KuaishouGjXx {
/**
* 信息主键编号
*/
private String xxzjbh;
/**
* 用户ID
*/
private String userId;
/**
* 活动时间
*/
@ExcelProperty(value = "活动时间")
private String activeTime;
/**
* 活动类型
*/
@ExcelProperty(value = "活动类型")
private String activeType;
/**
* 活动IP
*/
@ExcelProperty(value = "活动IP")
private String activeIp;
/**
* 端口号
*/
@ExcelProperty(value = "端口号")
private String activePort;
/**
* 活动地点
*/
@ExcelProperty(value = "活动地点")
private String activeLocation;
/**
* 活动经纬度
*/
@ExcelProperty(value = "活动经纬度")
private String longitudeLatitude;
private int page;
private int limit;
private String paramSjh;
}
package org.springblade.founder.shzy.entity;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@Data
@ExcelIgnoreUnannotated
@ColumnWidth(25)
public class KuaishouZcXx {
/**
* 信息主键编号
*/
private String xxzjbh;
/**
* 用户ID
*/
@ExcelProperty(value = "用户ID")
private String userId;
/**
* 快手号
*/
@ExcelProperty(value = "快手号")
private String kwaiNumber;
/**
* 用户名
*/
@ExcelProperty(value = "用户名")
private String userName;
/**
* 真实姓名
*/
@ExcelProperty(value = "真实姓名")
private String realName;
/**
* 身份证号
*/
@ExcelProperty(value = "身份证号")
private String identitycard;
/**
* OPENID
*/
@ExcelProperty(value = "OPENID")
private String openId;
/**
* 注册时间
*/
@ExcelProperty(value = "注册时间")
private String registrationTime;
/**
* 注册IP
*/
@ExcelProperty(value = "注册IP")
private String registrationIp;
/**
* 注册地
*/
@ExcelProperty(value = "注册地")
private String registrationLocation;
/**
* 注册方式
*/
@ExcelProperty(value = "注册方式")
private String registrationMethod;
/**
* 手机号码
*/
@ExcelProperty(value = "手机号码")
private String phoneNumber;
private int page;
private int limit;
private String paramSjh;
}
package org.springblade.founder.shzy.entity;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
@TableName("sys_yhczrz")
@ApiModel(value = "SysYhczrz", description = "用户操作日志对象")
@ColumnWidth(30)
public class SysYhczrz {
@ApiModelProperty(value = "日志流水号")
@TableField("rzlsh")
private String rzlsh;
@ApiModelProperty(value = "访问时间")
@TableField("fwsj")
private Date fwsj;
@ApiModelProperty(value = "应用名称")
@TableField("yymc_jyqk")
private String yymcJyqk;
@ApiModelProperty(value = "应用名称代码")
@TableField("yymcdm")
private String yymcdm;
@ApiModelProperty(value = "用户_姓名")
@TableField("yh_xm")
private String yhXm;
@ApiModelProperty(value = "用户_公民身份号码")
@TableField("yh_gmsfhm")
private String yhGmsfhm;
@ApiModelProperty(value = "用户IP")
@TableField("yh_ip")
private String yhIp;
@ApiModelProperty(value = "用户单位公安机关机构代码")
@TableField("yhdw_gajgjgdm")
private String yhdwGajgjgdm;
@ApiModelProperty(value = "用户单位名称")
@TableField("yhdw_gajgmc")
private String yhdwGajgmc;
@ApiModelProperty(value = "操作类型代码")
@TableField("czlxdm")
private String czlxdm;
@ApiModelProperty(value = "操作类型")
@TableField("czlx")
private String czlx;
@ApiModelProperty(value = "操作信息参数")
@TableField("czxx_param")
private String czxxParam;
@ApiModelProperty(value = "信息删除_判断标识")
@TableField("xxsc_pdbz")
private String xxscPdbz;
@ApiModelProperty(value = "信息登记单位_公安机关机构代码")
@TableField("xxdjdw_gajgjgdm")
private String xxdjdwGajgjgdm;
@ApiModelProperty(value = "信息登记单位_公安机关名称")
@TableField("xxdjdw_gajgmc")
private String xxdjdwGajgmc;
@ApiModelProperty(value = "信息登记人员_姓名")
@TableField("xxdjry_xm")
private String xxdjryXm;
@ApiModelProperty(value = "信息登记人员_公民身份号码")
@TableField("xxdjry_gmsfhm")
private String xxdjryGmsfhm;
@ApiModelProperty(value = "信息登记人员_联系电话")
@TableField("xxdjry_lxdh")
private String xxdjryLxdh;
@ApiModelProperty(value = "登记时间")
@TableField("djsj")
private Date djsj;
@ApiModelProperty(value = "信息操作单位_公安机关机构代码")
@TableField("xxczdw_gajgjgdm")
private String xxczdwGajgjgdm;
@ApiModelProperty(value = "信息操作单位_公安机关名称")
@TableField("xxczdw_gajgmc")
private String xxczdwGajgmc;
@ApiModelProperty(value = "信息操作人员_姓名")
@TableField("xxczry_xm")
private String xxczryXm;
@ApiModelProperty(value = "信息操作人员_公民身份号码")
@TableField("xxczry_gmsfhm")
private String xxczryGmsfhm;
@ApiModelProperty(value = "改写时间")
@TableField("gxsj")
private Date gxsj;
@ApiModelProperty(value = "信息来源描述")
@TableField("xxlyms")
private String xxlyms;
@ApiModelProperty(value = "比对原因")
@ExcelIgnore
@TableField(exist = false)
private String zpms;
@ApiModelProperty(value = "信息主键编号")
@ExcelIgnore
@TableField(exist = false)
private String xxzjbh;
@ApiModelProperty(value = "任务id")
@ExcelIgnore
@TableField(exist = false)
private String taskId;
}
package org.springblade.founder.shzy.entity;
import lombok.Data;
@Data
public class TbDbKdxx {
/**
* 自增主键
*/
private Integer id;
/**
* 运单号
*/
private String ydh;
/**
* 收货日期
*/
private String shrq;
/**
* 发货人
*/
private String fhr;
/**
* 发货人-手机号码
*/
private String fhrSjhm;
/**
* 发货人-电话号码
*/
private String fhrDhhm;
/**
* 发货人-地址
*/
private String fhrDz;
/**
* 商品名称
*/
private String spmc;
/**
* 数量
*/
private String sl;
/**
* 重量
*/
private String zl;
/**
* 体积
*/
private String tj;
/**
* 出发城市
*/
private String cfcs;
/**
* 到大城市
*/
private String ddcs;
/**
* 发货部门
*/
private String fhbm;
/**
* 收货人
*/
private String shr;
/**
* 收货人-手机号码
*/
private String shrSjhm;
/**
* 收货人-电话号码
*/
private String shrDhhm;
/**
* 收货人-地址
*/
private String shrDz;
}
package org.springblade.founder.shzy.entity;
import lombok.Data;
import java.util.Date;
//物流信息(顺丰)
@Data
public class TbSfDrsj {
private String paramSjh;
private String paramSjh2;
private String paramdz2;
private String id;
/**
* 运单号
*/
private String ydh;
/**
* 寄件时间
*/
private String jjsj;
private String jjsjStart;
private String jjsjEnd;
/**
* 寄件地址
*/
private String jjdz;
/**
* 寄件公司
*/
private String jjgs;
/**
* 寄件联系人
*/
private String jjlxr;
/**
* 寄件电话
*/
private String jjdh;
/**
* 寄件手机号
*/
private String jjsjh;
/**
* 收件地址
*/
private String sjdz;
/**
* 收件公司
*/
private String sjgs;
/**
* 收件联系人
*/
private String sjlxr;
/**
* 收件电话
*/
private String sjdh;
/**
* 收件手机号
*/
private String sjsjh;
/**
* 收件员
*/
private String sjy;
/**
* 原寄地
*/
private String yjd;
/**
* 目的地
*/
private String mdd;
/**
* 寄方客户编号
*/
private String jfkhbm;
/**
* 付款方式
*/
private String fkfs;
/**
*
*/
private String dshkje;
private String tjnr;
private String jfzl;
private String js;
private String yf;
private String pfkhbm;
private String pjy;
private Date lrsj;
private String filename;
private Date rksj;
private Integer qxbj;
private String yjdpd;
private String yjdpm;
private String yjdcd;
private String yjdcm;
private String mddpd;
private String mddpm;
private String mddcd;
private String mddcm;
private int page;
private int limit;
private String yuefrqparam; //月份日期时间
private String rqparam;
private String sfparam; //省份字段查询
private String dzcs;
private String sfbr;
private String qmcs;
private String xdsjStart;
private String xdsjEnd;
private String cxlx="1";
}
package org.springblade.founder.shzy.entity;
import lombok.Data;
import java.util.Date;
//美团信息
@Data
public class TbShzysjDdxx {
/**
* 自增主键
*/
private Integer id;
/**
* 订单ID
*/
private String ddid;
/**
* 收单手机号码
*/
private String xdsjhm;
/**
* 下单时间
*/
private Date xdsj;
private String xdsjStart;
private String xdsjEnd;
/**
* 商品名称
*/
private String spmc;
/**
* 订单行政区划名称
*/
private String ddXzqhmc;
/**
* 收货人
*/
private String shr;
/**
* 收货人手机号码
*/
private String sdrsjhm;
/**
* 收货地址
*/
private String shdz;
/**
* 事件类型
*/
private String sjlx;
/**
* 线索类型
*/
private String xslx;
/**
* 线索数据
*/
private String xssj;
/**
* 数据入库时间
*/
private Date rksj;
/**
* 导入文件名称
*/
private String wjmc;
/**
* 删除标志: 0:有效;1;删除
*/
private String scbz;
private int page;
private int limit;
private String paramSjh;
private String rqparam; //日期时间
private String yuefrqparam; //月份日期时间
private String dzcs;
private String sfbr; //1:是本人 ,2非本人
private String qmcs;
private String sjhone;
private String sjhtwo;
private String shdzone;
private String shdzsjh;
}
package org.springblade.founder.shzy.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.founder.shzy.entity.KuaishouGjXx;
import org.springblade.founder.shzy.entity.KuaishouZcXx;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Mapper
public interface KuaiShouMapper {
List<KuaishouZcXx> queryZcxxBySjh(KuaishouZcXx kuaishouZcXx);
int queryZcxxBySjhCount(KuaishouZcXx kuaishouZcXx);
List<KuaishouGjXx> queryGjxxBySjh(KuaishouGjXx kuaishouGjXx);
int queryGjxxBySjhCount(KuaishouGjXx kuaishouGjXx);
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="org.springblade.founder.shzy.mapper.KuaiShouMapper">
<select id="queryZcxxBySjh" resultType="org.springblade.founder.shzy.entity.KuaishouZcXx">
select * from tb_yw_dzqq_kuaishou_info where
phone_number like concat(concat('%',#{paramSjh}),'%')
or user_name like concat(concat('%',#{paramSjh}),'%')
order by registration_time desc
limit #{page} ,#{limit}
</select>
<select id="queryZcxxBySjhCount" resultType="java.lang.Integer">
select count(*) from tb_yw_dzqq_kuaishou_info where
phone_number like concat(concat('%',#{paramSjh}),'%')
or user_name like concat(concat('%',#{paramSjh}),'%')
</select>
<select id="queryGjxxBySjh" resultType="org.springblade.founder.shzy.entity.KuaishouGjXx">
select * from tb_yw_dzqq_kuaishou_active_info where user_id=#{userId}
and SUBSTRING_INDEX(longitude_latitude,',',1)>=72 and SUBSTRING_INDEX(longitude_latitude,',',1) <![CDATA[<=]]> 136
and SUBSTRING_INDEX(longitude_latitude,',',-1)>=1 and SUBSTRING_INDEX(longitude_latitude,',',-1) <![CDATA[<=]]> 56
order by active_time desc
limit #{page} ,#{limit}
</select>
<select id="queryGjxxBySjhCount" resultType="java.lang.Integer">
select count(1) from tb_yw_dzqq_kuaishou_active_info where user_id=#{userId}
and SUBSTRING_INDEX(longitude_latitude,',',1)>=72 and SUBSTRING_INDEX(longitude_latitude,',',1) <![CDATA[<=]]> 136
and SUBSTRING_INDEX(longitude_latitude,',',-1)>=1 and SUBSTRING_INDEX(longitude_latitude,',',-1) <![CDATA[<=]]> 56
</select>
</mapper>
package org.springblade.founder.shzy.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.founder.shzy.entity.CountNameVo;
import org.springblade.founder.shzy.entity.TbSfDrsj;
import org.springblade.founder.shzy.entity.TbShzysjDdxx;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Mapper
public interface MtxxMapper {
List<TbShzysjDdxx> queryMtxxBySjh(TbShzysjDdxx tbShzysjDdxx);
int queryMtxxBySjhCount(TbShzysjDdxx tbShzysjDdxx);
List<TbShzysjDdxx> queryMtxxBySjhTj(TbShzysjDdxx tbShzysjDdxx);
List<TbShzysjDdxx> queryMtxxBySjhTj2(TbShzysjDdxx tbShzysjDdxx);
List<TbSfDrsj> queryWlxxBySjh(TbSfDrsj tbSfDrsj);
List<TbSfDrsj> queryWlxxBySjhtest(TbSfDrsj tbSfDrsj);
int queryWlxxBySjhCountTest(TbSfDrsj tbSfDrsj);
int queryWlxxBySjhCount(TbSfDrsj tbSfDrsj);
List<TbSfDrsj> queryWlxxBySjhTj(TbSfDrsj tbSfDrsj);
List<TbSfDrsj> queryWlxxBySjhTj2(TbSfDrsj tbSfDrsj);
//美团日期统计
List<CountNameVo> mtRqsjBySjh(TbShzysjDdxx tbShzysjDdxx);
//美团月份日期统计
List<CountNameVo> mtYuefRqsjBySjh(TbShzysjDdxx tbShzysjDdxx);
//美团本人下单统计
int mtBrxdCountBySjh(TbShzysjDdxx tbShzysjDdxx);
//美团收货地址统计
List<CountNameVo> mtShdztjBySjh(TbShzysjDdxx tbShzysjDdxx);
//美团亲密度统计
List<CountNameVo> mtQmdtjBySjh(TbShzysjDdxx tbShzysjDdxx);
//细化美团亲密度列表
List<CountNameVo> mtQmdtjMclb(TbShzysjDdxx tbShzysjDdxx);
List<CountNameVo> mtdztjMclb(TbShzysjDdxx tbShzysjDdxx);
//end
//细化物流亲密度列表
List<CountNameVo> wlQmdtjMclb(TbShzysjDdxx tbShzysjDdxx);
List<CountNameVo> wldztjMclb(TbShzysjDdxx tbShzysjDdxx);
//end
//物流日期统计
List<CountNameVo> wlRqsjBySjh(TbSfDrsj tbSfDrsj);
//物流月份日期统计
List<CountNameVo> wlYuefRqsjBySjh(TbSfDrsj tbSfDrsj);
//物流本人寄件统计
int wlBrjjBySjh(TbSfDrsj tbSfDrsj);
//物流地址统计
List<CountNameVo> wlShdztjBySjh(TbSfDrsj tbSfDrsj);
//物流省份统计
List<CountNameVo> wlSftjBySjh(TbSfDrsj tbSfDrsj);
//物流亲密度统计
List<CountNameVo> wlQmdtjBySjh(TbSfDrsj tbSfDrsj);
}
This source diff could not be displayed because it is too large. You can view the blob instead.
package org.springblade.founder.shzy.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.founder.shzy.entity.CountNameVo;
import org.springblade.founder.shzy.entity.TbDbKdxx;
import org.springblade.founder.shzy.entity.TbSfDrsj;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Mapper
public interface WlxxMapper {
//德邦
List<TbDbKdxx> queryWlxxBySjh(TbDbKdxx tbDbKdxx);
//德邦
List<TbSfDrsj> queryWlxxBySjh2(TbSfDrsj tbDbKdxx);
int queryWlxxBySjhCount(TbDbKdxx tbDbKdxx);
//物流日期统计
List<CountNameVo> wlRqsjBySjh(TbSfDrsj mtxx);
//物流月份日期统计
List<CountNameVo> wlYuefRqsjBySjh(TbSfDrsj mtxx);
//物流本人寄件统计
int wlBrjjBySjh(TbSfDrsj mtxx);
//物流地址统计
List<CountNameVo> wlShdztjBySjh(TbSfDrsj mtxx);
//物流省份统计
List<CountNameVo> wlSftjBySjh(TbSfDrsj mtxx);
//物流亲密度统计
List<CountNameVo> wlQmdtjBySjh(TbSfDrsj mtxx);
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="org.springblade.founder.shzy.mapper.WlxxMapper">
<select id="queryWlxxBySjh2" resultType="org.springblade.founder.shzy.entity.TbSfDrsj">
select id,
ydh,
shrq jjsj,
fhr_dz jjdz,
fhr jjlxr,
fhr_sjhm jjsjh,
shr_dz sjdz,
shr sjlxr,
shr_sjhm sjsjh,
cfcs yjdpm,
ddcs mddpm
from tb_db_kdxx wl
<where>
<if test="ydh != null and ydh != ''">
and ydh = #{ydh}
</if>
<if test="paramSjh != null and paramSjh != '' ">
and (fhr_sjhm = #{paramSjh,jdbcType=VARCHAR} or shr_sjhm = #{paramSjh,jdbcType=VARCHAR})
</if>
<if test="sfparam != null and sfparam != '' ">
and (
(fhr_sjhm = #{paramSjh,jdbcType=VARCHAR} and cfcs= #{sfparam,jdbcType=VARCHAR} ) or ( shr_sjhm = #{paramSjh,jdbcType=VARCHAR} and ddcs= #{sfparam,jdbcType=VARCHAR})
)
</if>
<if test="xdsjStart != null and xdsjStart != ''">
and shrq <![CDATA[>=]]> DATE_FORMAT(#{xdsjStart}, '%Y-%m-%d %H:%i:%S')
</if>
<if test="xdsjEnd != null and xdsjEnd != ''">
and shrq <![CDATA[<=]]> DATE_FORMAT(#{xdsjEnd}, '%Y-%m-%d %H:%i:%S')
</if>
<if test="yuefrqparam != null and yuefrqparam != ''">
and DATE_FORMAT(shrq,'%Y-%m') = #{yuefrqparam}
</if>
<if test="rqparam != null and rqparam != ''">
and DATE_FORMAT(shrq,'%Y') = #{rqparam}
</if>
<if test="sfbr != null and sfbr != '' and sfbr == '1'.toString()">
and fhr_sjhm = #{paramSjh,jdbcType=VARCHAR}
</if>
<if test="sfbr != null and sfbr != '' and sfbr == '2'.toString()">
and fhr_sjhm != #{paramSjh,jdbcType=VARCHAR}
</if>
<if test="dzcs != null and dzcs != '' and dzcs == '1'.toString()">
and (( fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} and fhr_dz in ( select name from (
select name,sum(count) count from (
select fhr_dz name, count(fhr_dz) count from tb_db_kdxx t where t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_dz
union all
select shr_dz name, count(shr_dz) count from tb_db_kdxx t where t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_dz
) t group by name having count <![CDATA[<=]]>2
) ss ) ) or ( shr_sjhm=#{paramSjh,jdbcType=VARCHAR} and shr_dz in ( select name from (
select name,sum(count) count from (
select fhr_dz name, count(fhr_dz) count from tb_db_kdxx t where t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_dz
union all
select shr_dz name, count(shr_dz) count from tb_db_kdxx t where t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_dz
) t group by name having count <![CDATA[<=]]>2
) ss ) ) )
</if>
<if test="dzcs != null and dzcs != '' and dzcs == '2'.toString()">
and (( fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} and fhr_dz in ( select name from (
select name,sum(count) count from (
select fhr_dz name, count(fhr_dz) count from tb_db_kdxx t where t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_dz
union all
select shr_dz name, count(shr_dz) count from tb_db_kdxx t where t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_dz
) t group by name having count =3
) ss ) ) or ( shr_sjhm=#{paramSjh,jdbcType=VARCHAR} and shr_dz in ( select name from (
select name,sum(count) count from (
select fhr_dz name, count(fhr_dz) count from tb_db_kdxx t where t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_dz
union all
select shr_dz name, count(shr_dz) count from tb_db_kdxx t where t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_dz
) t group by name having count =3
) ss ) ) )
</if>
<if test="dzcs != null and dzcs != '' and dzcs == '3'.toString()">
and (( fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} and fhr_dz in ( select name from (
select name,sum(count) count from (
select fhr_dz name, count(fhr_dz) count from tb_db_kdxx t where t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_dz
union all
select shr_dz name, count(shr_dz) count from tb_db_kdxx t where t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_dz
) t group by name having count =4
) ss ) ) or ( shr_sjhm=#{paramSjh,jdbcType=VARCHAR} and shr_dz in ( select name from (
select name,sum(count) count from (
select fhr_dz name, count(fhr_dz) count from tb_db_kdxx t where t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_dz
union all
select shr_dz name, count(shr_dz) count from tb_db_kdxx t where t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_dz
) t group by name having count =4
) ss ) ) )
</if>
<if test="dzcs != null and dzcs != '' and dzcs == '4'.toString()">
and (( fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} and fhr_dz in ( select name from (
select name,sum(count) count from (
select fhr_dz name, count(fhr_dz) count from tb_db_kdxx t where t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_dz
union all
select shr_dz name, count(shr_dz) count from tb_db_kdxx t where t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_dz
) t group by name having count >=5
) ss ) ) or ( shr_sjhm=#{paramSjh,jdbcType=VARCHAR} and shr_dz in ( select name from (
select name,sum(count) count from (
select fhr_dz name, count(fhr_dz) count from tb_db_kdxx t where t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_dz
union all
select shr_dz name, count(shr_dz) count from tb_db_kdxx t where t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_dz
) t group by name having count >=5
) ss ) ) )
</if>
<if test="qmcs != null and qmcs != '' and qmcs == '1'.toString()">
and ((fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} and shr_sjhm in (select name from (
select name,sum(count) count from (
select shr_sjhm name, count(shr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_sjhm
union all
select fhr_sjhm name, count(fhr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_sjhm
) t group by name having count <![CDATA[<=]]>2
) ss) ) or (shr_sjhm=#{paramSjh,jdbcType=VARCHAR} and fhr_sjhm in (select name from (
select name,sum(count) count from (
select shr_sjhm name, count(shr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_sjhm
union all
select fhr_sjhm name, count(fhr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_sjhm
) t group by name having count <![CDATA[<=]]>2
) ss) ) )
</if>
<if test="qmcs != null and qmcs != '' and qmcs == '2'.toString()">
and ((fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} and shr_sjhm in (select name from (
select name,sum(count) count from (
select shr_sjhm name, count(shr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_sjhm
union all
select fhr_sjhm name, count(fhr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_sjhm
) t group by name having count =3
) ss) ) or (shr_sjhm=#{paramSjh,jdbcType=VARCHAR} and fhr_sjhm in (select name from (
select name,sum(count) count from (
select shr_sjhm name, count(shr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_sjhm
union all
select fhr_sjhm name, count(fhr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_sjhm
) t group by name having count =3
) ss) ) )
</if>
<if test="qmcs != null and qmcs != '' and qmcs == '3'.toString()">
and ((fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} and shr_sjhm in (select name from (
select name,sum(count) count from (
select shr_sjhm name, count(shr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_sjhm
union all
select fhr_sjhm name, count(fhr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_sjhm
) t group by name having count =4
) ss) ) or (shr_sjhm=#{paramSjh,jdbcType=VARCHAR} and fhr_sjhm in (select name from (
select name,sum(count) count from (
select shr_sjhm name, count(shr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_sjhm
union all
select fhr_sjhm name, count(fhr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_sjhm
) t group by name having count =4
) ss) ) )
</if>
<if test="qmcs != null and qmcs != '' and qmcs == '4'.toString()">
and ((fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} and shr_sjhm in (select name from (
select name,sum(count) count from (
select shr_sjhm name, count(shr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_sjhm
union all
select fhr_sjhm name, count(fhr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_sjhm
) t group by name having count <![CDATA[>=]]>5
) ss) ) or (shr_sjhm=#{paramSjh,jdbcType=VARCHAR} and fhr_sjhm in (select name from (
select name,sum(count) count from (
select shr_sjhm name, count(shr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_sjhm
union all
select fhr_sjhm name, count(fhr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_sjhm
) t group by name having count <![CDATA[>=]]>5
) ss) ) )
</if>
</where>
</select>
<select id="queryWlxxBySjh" resultType="org.springblade.founder.shzy.entity.TbDbKdxx">
select ydh, shrq, fhr, fhr_sjhm, fhr_dhhm, fhr_dz, spmc, sl, zl, tj,
cfcs, ddcs, fhbm, shr, shr_sjhm, shr_dhhm, shr_dz
from tb_db_kdxx wl
<where>
<if test="ydh != null and ydh != ''">
and ydh = #{ydh}
</if>
<if test="paramSjh != null and paramSjh != '' ">
and (fhr_sjhm = #{paramSjh,jdbcType=VARCHAR} or shr_sjhm = #{paramSjh,jdbcType=VARCHAR})
</if>
<if test="sfparam != null and sfparam != '' ">
and (
(fhr_sjhm = #{paramSjh,jdbcType=VARCHAR} and cfcs= #{sfparam,jdbcType=VARCHAR} ) or ( shr_sjhm = #{paramSjh,jdbcType=VARCHAR} and ddcs= #{sfparam,jdbcType=VARCHAR})
)
</if>
<if test="xdsjStart != null and xdsjStart != ''">
and shrq <![CDATA[>=]]> DATE_FORMAT(#{xdsjStart}, '%Y-%m-%d %H:%i:%S')
</if>
<if test="xdsjEnd != null and xdsjEnd != ''">
and shrq <![CDATA[<=]]> DATE_FORMAT(#{xdsjEnd}, '%Y-%m-%d %H:%i:%S')
</if>
<if test="yuefrqparam != null and yuefrqparam != ''">
and DATE_FORMAT(shrq,'%Y-%m') = #{yuefrqparam}
</if>
<if test="rqparam != null and rqparam != ''">
and DATE_FORMAT(shrq,'%Y') = #{rqparam}
</if>
<if test="sfbr != null and sfbr != '' and sfbr == '1'.toString()">
and fhr_sjhm = #{paramSjh,jdbcType=VARCHAR}
</if>
<if test="sfbr != null and sfbr != '' and sfbr == '2'.toString()">
and fhr_sjhm != #{paramSjh,jdbcType=VARCHAR}
</if>
<if test="dzcs != null and dzcs != '' and dzcs == '1'.toString()">
and (( fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} and fhr_dz in ( select name from (
select name,sum(count) count from (
select fhr_dz name, count(fhr_dz) count from tb_db_kdxx t where t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_dz
union all
select shr_dz name, count(shr_dz) count from tb_db_kdxx t where t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_dz
) t group by name having count <![CDATA[<=]]>2
) ss ) ) or ( shr_sjhm=#{paramSjh,jdbcType=VARCHAR} and shr_dz in ( select name from (
select name,sum(count) count from (
select fhr_dz name, count(fhr_dz) count from tb_db_kdxx t where t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_dz
union all
select shr_dz name, count(shr_dz) count from tb_db_kdxx t where t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_dz
) t group by name having count <![CDATA[<=]]>2
) ss ) ) )
</if>
<if test="dzcs != null and dzcs != '' and dzcs == '2'.toString()">
and (( fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} and fhr_dz in ( select name from (
select name,sum(count) count from (
select fhr_dz name, count(fhr_dz) count from tb_db_kdxx t where t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_dz
union all
select shr_dz name, count(shr_dz) count from tb_db_kdxx t where t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_dz
) t group by name having count =3
) ss ) ) or ( shr_sjhm=#{paramSjh,jdbcType=VARCHAR} and shr_dz in ( select name from (
select name,sum(count) count from (
select fhr_dz name, count(fhr_dz) count from tb_db_kdxx t where t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_dz
union all
select shr_dz name, count(shr_dz) count from tb_db_kdxx t where t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_dz
) t group by name having count =3
) ss ) ) )
</if>
<if test="dzcs != null and dzcs != '' and dzcs == '3'.toString()">
and (( fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} and fhr_dz in ( select name from (
select name,sum(count) count from (
select fhr_dz name, count(fhr_dz) count from tb_db_kdxx t where t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_dz
union all
select shr_dz name, count(shr_dz) count from tb_db_kdxx t where t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_dz
) t group by name having count =4
) ss ) ) or ( shr_sjhm=#{paramSjh,jdbcType=VARCHAR} and shr_dz in ( select name from (
select name,sum(count) count from (
select fhr_dz name, count(fhr_dz) count from tb_db_kdxx t where t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_dz
union all
select shr_dz name, count(shr_dz) count from tb_db_kdxx t where t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_dz
) t group by name having count =4
) ss ) ) )
</if>
<if test="dzcs != null and dzcs != '' and dzcs == '4'.toString()">
and (( fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} and fhr_dz in ( select name from (
select name,sum(count) count from (
select fhr_dz name, count(fhr_dz) count from tb_db_kdxx t where t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_dz
union all
select shr_dz name, count(shr_dz) count from tb_db_kdxx t where t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_dz
) t group by name having count >=5
) ss ) ) or ( shr_sjhm=#{paramSjh,jdbcType=VARCHAR} and shr_dz in ( select name from (
select name,sum(count) count from (
select fhr_dz name, count(fhr_dz) count from tb_db_kdxx t where t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_dz
union all
select shr_dz name, count(shr_dz) count from tb_db_kdxx t where t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_dz
) t group by name having count >=5
) ss ) ) )
</if>
<if test="qmcs != null and qmcs != '' and qmcs == '1'.toString()">
and ((fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} and shr_sjhm in (select name from (
select name,sum(count) count from (
select shr_sjhm name, count(shr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_sjhm
union all
select fhr_sjhm name, count(fhr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_sjhm
) t group by name having count <![CDATA[<=]]>2
) ss) ) or (shr_sjhm=#{paramSjh,jdbcType=VARCHAR} and fhr_sjhm in (select name from (
select name,sum(count) count from (
select shr_sjhm name, count(shr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_sjhm
union all
select fhr_sjhm name, count(fhr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_sjhm
) t group by name having count <![CDATA[<=]]>2
) ss) ) )
</if>
<if test="qmcs != null and qmcs != '' and qmcs == '2'.toString()">
and ((fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} and shr_sjhm in (select name from (
select name,sum(count) count from (
select shr_sjhm name, count(shr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_sjhm
union all
select fhr_sjhm name, count(fhr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_sjhm
) t group by name having count =3
) ss) ) or (shr_sjhm=#{paramSjh,jdbcType=VARCHAR} and fhr_sjhm in (select name from (
select name,sum(count) count from (
select shr_sjhm name, count(shr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_sjhm
union all
select fhr_sjhm name, count(fhr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_sjhm
) t group by name having count =3
) ss) ) )
</if>
<if test="qmcs != null and qmcs != '' and qmcs == '3'.toString()">
and ((fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} and shr_sjhm in (select name from (
select name,sum(count) count from (
select shr_sjhm name, count(shr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_sjhm
union all
select fhr_sjhm name, count(fhr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_sjhm
) t group by name having count =4
) ss) ) or (shr_sjhm=#{paramSjh,jdbcType=VARCHAR} and fhr_sjhm in (select name from (
select name,sum(count) count from (
select shr_sjhm name, count(shr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_sjhm
union all
select fhr_sjhm name, count(fhr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_sjhm
) t group by name having count =4
) ss) ) )
</if>
<if test="qmcs != null and qmcs != '' and qmcs == '4'.toString()">
and ((fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} and shr_sjhm in (select name from (
select name,sum(count) count from (
select shr_sjhm name, count(shr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_sjhm
union all
select fhr_sjhm name, count(fhr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_sjhm
) t group by name having count <![CDATA[>=]]>5
) ss) ) or (shr_sjhm=#{paramSjh,jdbcType=VARCHAR} and fhr_sjhm in (select name from (
select name,sum(count) count from (
select shr_sjhm name, count(shr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_sjhm
union all
select fhr_sjhm name, count(fhr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_sjhm
) t group by name having count <![CDATA[>=]]>5
) ss) ) )
</if>
</where>
order by shrq desc
limit #{page} ,#{limit}
</select>
<select id="queryWlxxBySjhCount" resultType="java.lang.Integer">
select count(1) from tb_db_kdxx wl
<where>
<if test="ydh != null and ydh != ''">
and ydh = #{ydh}
</if>
<if test="paramSjh != null and paramSjh != '' ">
and (fhr_sjhm = #{paramSjh,jdbcType=VARCHAR} or shr_sjhm = #{paramSjh,jdbcType=VARCHAR})
</if>
<if test="sfparam != null and sfparam != '' ">
and (
(fhr_sjhm = #{paramSjh,jdbcType=VARCHAR} and cfcs= #{sfparam,jdbcType=VARCHAR} ) or ( shr_sjhm = #{paramSjh,jdbcType=VARCHAR} and ddcs= #{sfparam,jdbcType=VARCHAR})
)
</if>
<if test="xdsjStart != null and xdsjStart != ''">
and shrq <![CDATA[>=]]> DATE_FORMAT(#{xdsjStart}, '%Y-%m-%d %H:%i:%S')
</if>
<if test="xdsjEnd != null and xdsjEnd != ''">
and shrq <![CDATA[<=]]> DATE_FORMAT(#{xdsjEnd}, '%Y-%m-%d %H:%i:%S')
</if>
<if test="yuefrqparam != null and yuefrqparam != ''">
and DATE_FORMAT(shrq,'%Y-%m') = #{yuefrqparam}
</if>
<if test="rqparam != null and rqparam != ''">
and DATE_FORMAT(shrq,'%Y') = #{rqparam}
</if>
<if test="sfbr != null and sfbr != '' and sfbr == '1'.toString()">
and fhr_sjhm = #{paramSjh,jdbcType=VARCHAR}
</if>
<if test="sfbr != null and sfbr != '' and sfbr == '2'.toString()">
and fhr_sjhm != #{paramSjh,jdbcType=VARCHAR}
</if>
<if test="dzcs != null and dzcs != '' and dzcs == '1'.toString()">
and (( fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} and fhr_dz in ( select name from (
select name,sum(count) count from (
select fhr_dz name, count(fhr_dz) count from tb_db_kdxx t where t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_dz
union all
select shr_dz name, count(shr_dz) count from tb_db_kdxx t where t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_dz
) t group by name having count <![CDATA[<=]]>2
) ss ) ) or ( shr_sjhm=#{paramSjh,jdbcType=VARCHAR} and shr_dz in ( select name from (
select name,sum(count) count from (
select fhr_dz name, count(fhr_dz) count from tb_db_kdxx t where t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_dz
union all
select shr_dz name, count(shr_dz) count from tb_db_kdxx t where t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_dz
) t group by name having count <![CDATA[<=]]>2
) ss ) ) )
</if>
<if test="dzcs != null and dzcs != '' and dzcs == '2'.toString()">
and (( fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} and fhr_dz in ( select name from (
select name,sum(count) count from (
select fhr_dz name, count(fhr_dz) count from tb_db_kdxx t where t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_dz
union all
select shr_dz name, count(shr_dz) count from tb_db_kdxx t where t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_dz
) t group by name having count =3
) ss ) ) or ( shr_sjhm=#{paramSjh,jdbcType=VARCHAR} and shr_dz in ( select name from (
select name,sum(count) count from (
select fhr_dz name, count(fhr_dz) count from tb_db_kdxx t where t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_dz
union all
select shr_dz name, count(shr_dz) count from tb_db_kdxx t where t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_dz
) t group by name having count =3
) ss ) ) )
</if>
<if test="dzcs != null and dzcs != '' and dzcs == '3'.toString()">
and (( fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} and fhr_dz in ( select name from (
select name,sum(count) count from (
select fhr_dz name, count(fhr_dz) count from tb_db_kdxx t where t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_dz
union all
select shr_dz name, count(shr_dz) count from tb_db_kdxx t where t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_dz
) t group by name having count =4
) ss ) ) or ( shr_sjhm=#{paramSjh,jdbcType=VARCHAR} and shr_dz in ( select name from (
select name,sum(count) count from (
select fhr_dz name, count(fhr_dz) count from tb_db_kdxx t where t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_dz
union all
select shr_dz name, count(shr_dz) count from tb_db_kdxx t where t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_dz
) t group by name having count =4
) ss ) ) )
</if>
<if test="dzcs != null and dzcs != '' and dzcs == '4'.toString()">
and (( fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} and fhr_dz in ( select name from (
select name,sum(count) count from (
select fhr_dz name, count(fhr_dz) count from tb_db_kdxx t where t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_dz
union all
select shr_dz name, count(shr_dz) count from tb_db_kdxx t where t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_dz
) t group by name having count >=5
) ss ) ) or ( shr_sjhm=#{paramSjh,jdbcType=VARCHAR} and shr_dz in ( select name from (
select name,sum(count) count from (
select fhr_dz name, count(fhr_dz) count from tb_db_kdxx t where t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_dz
union all
select shr_dz name, count(shr_dz) count from tb_db_kdxx t where t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_dz
) t group by name having count >=5
) ss ) ) )
</if>
<if test="qmcs != null and qmcs != '' and qmcs == '1'.toString()">
and ((fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} and shr_sjhm in (select name from (
select name,sum(count) count from (
select shr_sjhm name, count(shr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_sjhm
union all
select fhr_sjhm name, count(fhr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_sjhm
) t group by name having count <![CDATA[<=]]>2
) ss) ) or (shr_sjhm=#{paramSjh,jdbcType=VARCHAR} and fhr_sjhm in (select name from (
select name,sum(count) count from (
select shr_sjhm name, count(shr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_sjhm
union all
select fhr_sjhm name, count(fhr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_sjhm
) t group by name having count <![CDATA[<=]]>2
) ss) ) )
</if>
<if test="qmcs != null and qmcs != '' and qmcs == '2'.toString()">
and ((fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} and shr_sjhm in (select name from (
select name,sum(count) count from (
select shr_sjhm name, count(shr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_sjhm
union all
select fhr_sjhm name, count(fhr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_sjhm
) t group by name having count =3
) ss) ) or (shr_sjhm=#{paramSjh,jdbcType=VARCHAR} and fhr_sjhm in (select name from (
select name,sum(count) count from (
select shr_sjhm name, count(shr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_sjhm
union all
select fhr_sjhm name, count(fhr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_sjhm
) t group by name having count =3
) ss) ) )
</if>
<if test="qmcs != null and qmcs != '' and qmcs == '3'.toString()">
and ((fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} and shr_sjhm in (select name from (
select name,sum(count) count from (
select shr_sjhm name, count(shr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_sjhm
union all
select fhr_sjhm name, count(fhr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_sjhm
) t group by name having count =4
) ss) ) or (shr_sjhm=#{paramSjh,jdbcType=VARCHAR} and fhr_sjhm in (select name from (
select name,sum(count) count from (
select shr_sjhm name, count(shr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_sjhm
union all
select fhr_sjhm name, count(fhr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_sjhm
) t group by name having count =4
) ss) ) )
</if>
<if test="qmcs != null and qmcs != '' and qmcs == '4'.toString()">
and ((fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} and shr_sjhm in (select name from (
select name,sum(count) count from (
select shr_sjhm name, count(shr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_sjhm
union all
select fhr_sjhm name, count(fhr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_sjhm
) t group by name having count <![CDATA[>=]]>5
) ss) ) or (shr_sjhm=#{paramSjh,jdbcType=VARCHAR} and fhr_sjhm in (select name from (
select name,sum(count) count from (
select shr_sjhm name, count(shr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.fhr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by shr_sjhm
union all
select fhr_sjhm name, count(fhr_sjhm) count from tb_db_kdxx t where t.shr_sjhm!=t.fhr_sjhm and t.shr_sjhm=#{paramSjh,jdbcType=VARCHAR} group by fhr_sjhm
) t group by name having count <![CDATA[>=]]>5
) ss) ) )
</if>
</where>
</select>
<select id="wlRqsjBySjh" resultType="org.springblade.founder.shzy.entity.CountNameVo">
select DATE_FORMAT(shrq, '%Y') name,count(1) count from
tb_db_kdxx where ( fhr_sjhm= #{paramSjh,jdbcType=VARCHAR} or shr_sjhm = #{paramSjh,jdbcType=VARCHAR} )
<if test="xdsjStart != null and xdsjStart != ''">
and shrq <![CDATA[>=]]> DATE_FORMAT(#{xdsjStart}, '%Y-%m-%d %H:%i:%S')
</if>
<if test="xdsjEnd != null and xdsjEnd != ''">
and shrq <![CDATA[<=]]> DATE_FORMAT(#{xdsjEnd}, '%Y-%m-%d %H:%i:%S')
</if>
group by DATE_FORMAT(shrq, '%Y')
</select>
<select id="wlYuefRqsjBySjh" resultType="org.springblade.founder.shzy.entity.CountNameVo">
select DATE_FORMAT(shrq, '%m') name,count(1) count from
tb_db_kdxx where
( fhr_sjhm= #{paramSjh,jdbcType=VARCHAR} or shr_sjhm = #{paramSjh,jdbcType=VARCHAR} )
<if test="rqparam != null and rqparam != ''">
and DATE_FORMAT(shrq,'%Y') = #{rqparam}
</if>
<if test="xdsjStart != null and xdsjStart != ''">
and shrq <![CDATA[>=]]> DATE_FORMAT(#{xdsjStart}, '%Y-%m-%d %H:%i:%S')
</if>
<if test="xdsjEnd != null and xdsjEnd != ''">
and shrq <![CDATA[<=]]> DATE_FORMAT(#{xdsjEnd}, '%Y-%m-%d %H:%i:%S')
</if>
group by DATE_FORMAT(shrq, '%m')
order by name asc
</select>
<select id="wlBrjjBySjh" resultType="java.lang.Integer">
select count(1) from tb_db_kdxx where
fhr_sjhm = #{paramSjh,jdbcType=VARCHAR}
<if test="xdsjStart != null and xdsjStart != ''">
and shrq <![CDATA[>=]]> DATE_FORMAT(#{xdsjStart}, '%Y-%m-%d %H:%i:%S')
</if>
<if test="xdsjEnd != null and xdsjEnd != ''">
and shrq <![CDATA[<=]]> DATE_FORMAT(#{xdsjEnd}, '%Y-%m-%d %H:%i:%S')
</if>
</select>
<select id="wlShdztjBySjh" resultType="org.springblade.founder.shzy.entity.CountNameVo">
select name,sum(count) count from (
select fhr_dz name, count(fhr_dz) count from tb_db_kdxx where fhr_sjhm=#{paramSjh,jdbcType=VARCHAR}
<if test="xdsjStart != null and xdsjStart != ''">
and shrq <![CDATA[>=]]> DATE_FORMAT(#{xdsjStart}, '%Y-%m-%d %H:%i:%S')
</if>
<if test="xdsjEnd != null and xdsjEnd != ''">
and shrq <![CDATA[<=]]> DATE_FORMAT(#{xdsjEnd}, '%Y-%m-%d %H:%i:%S')
</if>
group by fhr_dz
union all
select shr_dz name, count(shr_dz) count from tb_db_kdxx where shr_sjhm=#{paramSjh,jdbcType=VARCHAR}
<if test="xdsjStart != null and xdsjStart != ''">
and shrq <![CDATA[>=]]> DATE_FORMAT(#{xdsjStart}, '%Y-%m-%d %H:%i:%S')
</if>
<if test="xdsjEnd != null and xdsjEnd != ''">
and shrq <![CDATA[<=]]> DATE_FORMAT(#{xdsjEnd}, '%Y-%m-%d %H:%i:%S')
</if>
group by shr_dz
) t group by name
</select>
<select id="wlSftjBySjh" resultType="org.springblade.founder.shzy.entity.CountNameVo">
select name,sum(count) count from (
select cfcs name, count(cfcs) count from tb_db_kdxx where fhr_sjhm=#{paramSjh,jdbcType=VARCHAR}
and cfcs is not null
<if test="xdsjStart != null and xdsjStart != ''">
and shrq <![CDATA[>=]]> DATE_FORMAT(#{xdsjStart}, '%Y-%m-%d %H:%i:%S')
</if>
<if test="xdsjEnd != null and xdsjEnd != ''">
and shrq <![CDATA[<=]]> DATE_FORMAT(#{xdsjEnd}, '%Y-%m-%d %H:%i:%S')
</if>
group by cfcs
union all
select ddcs name, count(ddcs) count from tb_db_kdxx where shr_sjhm=#{paramSjh,jdbcType=VARCHAR}
and ddcs is not null
<if test="xdsjStart != null and xdsjStart != ''">
and shrq <![CDATA[>=]]> DATE_FORMAT(#{xdsjStart}, '%Y-%m-%d %H:%i:%S')
</if>
<if test="xdsjEnd != null and xdsjEnd != ''">
and shrq <![CDATA[<=]]> DATE_FORMAT(#{xdsjEnd}, '%Y-%m-%d %H:%i:%S')
</if>
group by ddcs
) t group by name order by count desc
</select>
<select id="wlQmdtjBySjh" resultType="org.springblade.founder.shzy.entity.CountNameVo">
select name,sum(count) count from (
select shr_sjhm name, count(shr_sjhm) count from tb_db_kdxx where shr_sjhm!=fhr_sjhm and fhr_sjhm=#{paramSjh,jdbcType=VARCHAR}
<if test="xdsjStart != null and xdsjStart != ''">
and shrq <![CDATA[>=]]> DATE_FORMAT(#{xdsjStart}, '%Y-%m-%d %H:%i:%S')
</if>
<if test="xdsjEnd != null and xdsjEnd != ''">
and shrq <![CDATA[<=]]> DATE_FORMAT(#{xdsjEnd}, '%Y-%m-%d %H:%i:%S')
</if>
group by shr_sjhm
union all
select fhr_sjhm name, count(fhr_sjhm) count from tb_db_kdxx where shr_sjhm!=fhr_sjhm and shr_sjhm=#{paramSjh,jdbcType=VARCHAR}
<if test="xdsjStart != null and xdsjStart != ''">
and shrq <![CDATA[>=]]> DATE_FORMAT(#{xdsjStart}, '%Y-%m-%d %H:%i:%S')
</if>
<if test="xdsjEnd != null and xdsjEnd != ''">
and shrq <![CDATA[<=]]> DATE_FORMAT(#{xdsjEnd}, '%Y-%m-%d %H:%i:%S')
</if>
group by fhr_sjhm
) t group by name
</select>
</mapper>
package org.springblade.founder.shzy.service;
import org.springblade.founder.shzy.entity.KuaishouGjXx;
import org.springblade.founder.shzy.entity.KuaishouZcXx;
import java.util.Map;
public interface KuaiShouService {
Map<String, Object> queryZcxxBySjh(KuaishouZcXx zc);
Map<String, Object> gjxxList(KuaishouGjXx zc);
}
package org.springblade.founder.shzy.service;
import org.springblade.founder.shzy.entity.TbSfDrsj;
import org.springblade.founder.shzy.entity.TbShzysjDdxx;
import java.util.List;
import java.util.Map;
public interface MtxxService {
Map<String, Object> queryMtxxBySjh(TbShzysjDdxx mtxx);
Map<String, Object> queryWlxxBySjh(TbSfDrsj mtxx);
Map<String, Object> queryWlxxBySjhtest(TbSfDrsj mtxx);
Map<String, Object> doAnalyseWlxxBySjh(TbSfDrsj mtxx);
Map<String, Object> mtRqsjBySjh(TbShzysjDdxx mtxx);
Map<String, Object> mtYuefRqsjBySjh(TbShzysjDdxx mtxx);
Map<String, Object> mtBrxdCountBySjh(TbShzysjDdxx mtxx);
Map<String, Object> mtShdztjBySjh(TbShzysjDdxx mtxx);
Map<String, Object> mtQmdtjBySjh(TbShzysjDdxx mtxx);
//细化
Map<String, Object> mtQmdtjMclb(TbShzysjDdxx mtxx);
Map<String, Object> mtdztjMclb(TbShzysjDdxx mtxx);
//细化物流
Map<String, Object> wlQmdtjMclb(TbShzysjDdxx mtxx);
Map<String, Object> wldztjMclb(TbShzysjDdxx mtxx);
Map<String, Object> queryXhMtxxBySjh(TbShzysjDdxx mtxx);
//end
Map<String, Object> mtDzListTjBySjh(TbShzysjDdxx mtxx);
Map<String, Object> mtQmdListTjBySjh(TbShzysjDdxx mtxx);
Map<String, Object> wlRqsjBySjh(TbSfDrsj mtxx);
Map<String, Object> wlYuefRqsjBySjh(TbSfDrsj mtxx);
Map<String, Object> wlBrjjBySjh(TbSfDrsj mtxx);
Map<String, Object> wlShdztjBySjh(TbSfDrsj mtxx);
Map<String, Object> wlSftjBySjh(TbSfDrsj mtxx);
Map<String, Object> wlQmdtjBySjh(TbSfDrsj mtxx);
Map<String, Object> wlDzListTjBySjh(TbSfDrsj mtxx);
Map<String, Object> wlQmdListTjBySjh(TbSfDrsj mtxx);
Map<String, Object> wlSfListTjBySjh(TbSfDrsj mtxx);
}
package org.springblade.founder.shzy.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import org.springblade.founder.shzy.entity.KuaishouGjXx;
import org.springblade.founder.shzy.entity.KuaishouZcXx;
import org.springblade.founder.shzy.entity.TbSfDrsj;
import org.springblade.founder.shzy.mapper.KuaiShouMapper;
import org.springblade.founder.shzy.service.KuaiShouService;
import org.springblade.founder.utils.EasyUIPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
@DS("hunan_shzy")
public class KuaiShouServiceImpl implements KuaiShouService {
@Autowired
private KuaiShouMapper kuaiShouMapper;
@Override
public Map<String, Object> queryZcxxBySjh(KuaishouZcXx zc) {
Map<String, Object> rtMap = new HashMap<>();
List<KuaishouZcXx> listResult=new ArrayList<>();
long total=0;
rtMap.put("rows",new ArrayList<>());
rtMap.put("total",0);
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(zc.getPage());
easyUIPage.setPagePara(zc.getLimit());
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
zc.setPage(begin);
zc.setLimit(end);
listResult= kuaiShouMapper.queryZcxxBySjh(zc);
total= kuaiShouMapper.queryZcxxBySjhCount(zc);
rtMap.put("total",total);
rtMap.put("rows",listResult);
return rtMap;
}
@Override
public Map<String, Object> gjxxList(KuaishouGjXx gjXx) {
Map<String, Object> rtMap = new HashMap<>();
List<KuaishouGjXx> listResult=new ArrayList<>();
long total=0;
rtMap.put("rows",new ArrayList<>());
rtMap.put("total",0);
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(gjXx.getPage());
easyUIPage.setPagePara(gjXx.getLimit());
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
gjXx.setPage(begin);
gjXx.setLimit(end);
listResult= kuaiShouMapper.queryGjxxBySjh(gjXx);
total= kuaiShouMapper.queryGjxxBySjhCount(gjXx);
rtMap.put("total",total);
rtMap.put("rows",listResult);
return rtMap;
}
}
package org.springblade.founder.shzy.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import org.springblade.founder.shzy.entity.CountNameVo;
import org.springblade.founder.shzy.entity.TbSfDrsj;
import org.springblade.founder.shzy.entity.TbShzysjDdxx;
import org.springblade.founder.shzy.mapper.MtxxMapper;
import org.springblade.founder.shzy.mapper.WlxxMapper;
import org.springblade.founder.shzy.service.MtxxService;
import org.springblade.founder.utils.EasyUIPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.stream.Collectors;
@Service
@DS("hunan_shzy")
public class MtxxServiceImpl implements MtxxService {
@Autowired
private MtxxMapper mtxxMapper;
@Autowired
private WlxxMapper wlxxMapper;
@Override
public Map<String, Object> queryMtxxBySjh(TbShzysjDdxx mtxx) {
Map<String, Object> rtMap = new HashMap<>();
List<TbShzysjDdxx> listResult=new ArrayList<>();
long total=0;
rtMap.put("rows",new ArrayList<>());
rtMap.put("total",0);
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(mtxx.getPage());
easyUIPage.setPagePara(mtxx.getLimit());
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
mtxx.setPage(begin);
mtxx.setLimit(end);
listResult= mtxxMapper.queryMtxxBySjh(mtxx);
total=mtxxMapper.queryMtxxBySjhCount(mtxx);
rtMap.put("total",total);
rtMap.put("rows",listResult);
return rtMap;
}
@Override
public Map<String, Object> queryXhMtxxBySjh(TbShzysjDdxx mtxx) {
Map<String, Object> rtMap = new HashMap<>();
List<TbShzysjDdxx> listResult=new ArrayList<>();
long total=0;
rtMap.put("rows",new ArrayList<>());
rtMap.put("total",0);
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(mtxx.getPage());
easyUIPage.setPagePara(mtxx.getLimit());
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
mtxx.setPage(begin);
mtxx.setLimit(end);
listResult= mtxxMapper.queryMtxxBySjh(mtxx);
total=mtxxMapper.queryMtxxBySjhCount(mtxx);
rtMap.put("total",total);
rtMap.put("rows",listResult);
return rtMap;
}
@Override
public Map<String, Object> mtRqsjBySjh(TbShzysjDdxx mtxx) {
Map<String, Object> rtMap = new HashMap<>();
List<CountNameVo> listResult=new ArrayList<>();
long total=0;
rtMap.put("rows",new ArrayList<>());
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(mtxx.getPage());
easyUIPage.setPagePara(mtxx.getLimit());
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
mtxx.setPage(begin);
mtxx.setLimit(end);
listResult= mtxxMapper.mtRqsjBySjh(mtxx);
rtMap.put("rows",listResult);
return rtMap;
}
@Override
public Map<String, Object> mtYuefRqsjBySjh(TbShzysjDdxx mtxx) {
Map<String, Object> rtMap = new HashMap<>();
List<CountNameVo> listResult=new ArrayList<>();
long total=0;
rtMap.put("rows",new ArrayList<>());
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(mtxx.getPage());
easyUIPage.setPagePara(mtxx.getLimit());
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
mtxx.setPage(begin);
mtxx.setLimit(end);
listResult= mtxxMapper.mtYuefRqsjBySjh(mtxx);
rtMap.put("rows",listResult);
return rtMap;
}
@Override
public Map<String, Object> mtBrxdCountBySjh(TbShzysjDdxx mtxx) {
Map<String, Object> rtMap = new HashMap<>();
List<CountNameVo> listResult=new ArrayList<>();
long brtotal=0;
long fbrtotal=0;
long total=0;
rtMap.put("brxd",0);
rtMap.put("fbrxd",0);
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(mtxx.getPage());
easyUIPage.setPagePara(mtxx.getLimit());
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
mtxx.setPage(begin);
mtxx.setLimit(end);
brtotal= mtxxMapper.mtBrxdCountBySjh(mtxx);
total= mtxxMapper.queryMtxxBySjhCount(mtxx);
rtMap.put("brxd",brtotal);
rtMap.put("fbrxd",total-brtotal);
return rtMap;
}
@Override
public Map<String, Object> mtShdztjBySjh(TbShzysjDdxx mtxx) {
Map<String, Object> rtMap = new HashMap<>();
List<CountNameVo> listResult=new ArrayList<>();
long total=0;
long yidz=0;
long erdz=0;
long sandz=0;
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(mtxx.getPage());
easyUIPage.setPagePara(mtxx.getLimit());
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
mtxx.setPage(begin);
mtxx.setLimit(end);
listResult= mtxxMapper.mtShdztjBySjh(mtxx);
for (CountNameVo s:listResult){
if(s.getCount()==1){
yidz++;
}
if(s.getCount()==2){
erdz++;
}
if(s.getCount()>=3){
sandz++;
}
}
rtMap.put("yidz",yidz);
rtMap.put("erdz",erdz);
rtMap.put("sandz",sandz);
return rtMap;
}
@Override
public Map<String, Object> mtQmdtjBySjh(TbShzysjDdxx mtxx) {
Map<String, Object> rtMap = new HashMap<>();
List<CountNameVo> listResult=new ArrayList<>();
long total=0;
long erdz=0;
long sandz=0;
long sidz=0;
long wudz=0;
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(mtxx.getPage());
easyUIPage.setPagePara(mtxx.getLimit());
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
mtxx.setPage(begin);
mtxx.setLimit(end);
listResult= mtxxMapper.mtQmdtjBySjh(mtxx);
for (CountNameVo s:listResult){
if(s.getCount()<=2){
erdz++;
}
if(s.getCount()==3){
sandz++;
}
if(s.getCount()==4){
sidz++;
}
if(s.getCount()>=5){
wudz++;
}
}
rtMap.put("erdz",erdz);
rtMap.put("sandz",sandz);
rtMap.put("sidz",sidz);
rtMap.put("wudz",wudz);
return rtMap;
}
@Override
public Map<String, Object> mtQmdtjMclb(TbShzysjDdxx mtxx) {
Map<String, Object> rtMap = new HashMap<>();
List<CountNameVo> listResult=new ArrayList<>();
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(mtxx.getPage());
easyUIPage.setPagePara(mtxx.getLimit());
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
mtxx.setPage(begin);
mtxx.setLimit(end);
listResult= mtxxMapper.mtQmdtjMclb(mtxx);
rtMap.put("rows",listResult);
return rtMap;
}
@Override
public Map<String, Object> mtdztjMclb(TbShzysjDdxx mtxx) {
Map<String, Object> rtMap = new HashMap<>();
List<CountNameVo> listResult=new ArrayList<>();
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(mtxx.getPage());
easyUIPage.setPagePara(mtxx.getLimit());
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
mtxx.setPage(begin);
mtxx.setLimit(end);
listResult= mtxxMapper.mtdztjMclb(mtxx);
rtMap.put("rows",listResult);
return rtMap;
}
@Override
public Map<String, Object> wlQmdtjMclb(TbShzysjDdxx mtxx) {
Map<String, Object> rtMap = new HashMap<>();
List<CountNameVo> listResult=new ArrayList<>();
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(mtxx.getPage());
easyUIPage.setPagePara(mtxx.getLimit());
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
mtxx.setPage(begin);
mtxx.setLimit(end);
listResult= mtxxMapper.wlQmdtjMclb(mtxx);
rtMap.put("rows",listResult);
return rtMap;
}
@Override
public Map<String, Object> wldztjMclb(TbShzysjDdxx mtxx) {
Map<String, Object> rtMap = new HashMap<>();
List<CountNameVo> listResult=new ArrayList<>();
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(mtxx.getPage());
easyUIPage.setPagePara(mtxx.getLimit());
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
mtxx.setPage(begin);
mtxx.setLimit(end);
listResult= mtxxMapper.wldztjMclb(mtxx);
rtMap.put("rows",listResult);
return rtMap;
}
@Override
public Map<String, Object> mtDzListTjBySjh(TbShzysjDdxx mtxx) {
Map<String, Object> rtMap = new HashMap<>();
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("total",0);
List<TbShzysjDdxx> listResult=new ArrayList<>();
listResult= mtxxMapper.queryMtxxBySjhTj2(mtxx);
if(listResult!=null){
resultMap.put("total",listResult.size());
}
Map<String, List<TbShzysjDdxx>> studentGroup = listResult.stream().collect(Collectors.groupingBy(TbShzysjDdxx::getShdz));
for(Map.Entry<String, List<TbShzysjDdxx>> entry : studentGroup.entrySet()){
// 使用 Stream 排序
rtMap.put(entry.getKey(),entry.getValue().stream().sorted(Comparator.comparing(TbShzysjDdxx::getXdsj).reversed())
.collect(Collectors.toList()));
// List<TbShzysjDdxx> listsort = entry.getValue().stream().sorted(Comparator.comparing(TbShzysjDdxx::getXdsj).reversed())
// .collect(Collectors.toList());
// rtMap.put(entry.getKey(),entry.getValue());
}
resultMap.put("rows",rtMap);
return resultMap;
// return rtMap;
}
@Override
public Map<String, Object> mtQmdListTjBySjh(TbShzysjDdxx mtxx) {
Map<String, Object> rtMap = new HashMap<>();
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("total",0);
List<TbShzysjDdxx> listResult=new ArrayList<>();
listResult= mtxxMapper.queryMtxxBySjhTj2(mtxx);
if(listResult!=null){
resultMap.put("total",listResult.size());
}
Map<String, List<TbShzysjDdxx>> sdrsjhmGroup = listResult.stream().filter(u->!mtxx.getParamSjh().equals(u.getSdrsjhm()) ).collect(Collectors.groupingBy(TbShzysjDdxx::getSdrsjhm));
Map<String, List<TbShzysjDdxx>> xdsjhmGroup = listResult.stream().filter(u->!mtxx.getParamSjh().equals(u.getXdsjhm()) ).collect(Collectors.groupingBy(TbShzysjDdxx::getXdsjhm));
for(Map.Entry<String, List<TbShzysjDdxx>> entry : xdsjhmGroup.entrySet()){
if(sdrsjhmGroup.containsKey(entry.getKey())){
sdrsjhmGroup.get((entry.getKey())).addAll(entry.getValue());
}else {
sdrsjhmGroup.put(entry.getKey(),entry.getValue());
}
}
for(Map.Entry<String, List<TbShzysjDdxx>> entry : sdrsjhmGroup.entrySet()){
// 使用 Stream 排序
rtMap.put(entry.getKey(),entry.getValue().stream().sorted(Comparator.comparing(TbShzysjDdxx::getXdsj).reversed())
.collect(Collectors.toList()));
// List<TbShzysjDdxx> listsort = entry.getValue().stream().sorted(Comparator.comparing(TbShzysjDdxx::getXdsj).reversed())
// .collect(Collectors.toList());
// rtMap.put(entry.getKey(),entry.getValue());
}
resultMap.put("rows",rtMap);
return resultMap;
}
@Override
public Map<String, Object> wlDzListTjBySjh(TbSfDrsj mtxx) {
Map<String, Object> rtMap = new HashMap<>();
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("total",0);
List<TbSfDrsj> listResult=new ArrayList<>();
List<TbSfDrsj> dbResult=new ArrayList<>();
// listResult= mtxxMapper.queryWlxxBySjhTj2(mtxx);
if("1".equals(mtxx.getCxlx())){
listResult= mtxxMapper.queryWlxxBySjhTj2(mtxx);
}else if("2".equals(mtxx.getCxlx())) {
listResult= wlxxMapper.queryWlxxBySjh2(mtxx);
}else {
listResult= mtxxMapper.queryWlxxBySjhTj2(mtxx);
dbResult= wlxxMapper.queryWlxxBySjh2(mtxx);
listResult.addAll(dbResult);
}
if(listResult!=null){
resultMap.put("total",listResult.size());
}
//寄件与收件一样是不是会造成数据重复
Map<String, List<TbSfDrsj>> jjGroup = listResult.stream().filter(u->mtxx.getParamSjh().equals(u.getJjsjh())).collect(Collectors.groupingBy(TbSfDrsj::getJjdz));
Map<String, List<TbSfDrsj>> sjGroup = listResult.stream().filter(u->mtxx.getParamSjh().equals(u.getSjsjh()) ).collect(Collectors.groupingBy(TbSfDrsj::getSjdz));
// List<TbSfDrsj> s0=listResult.stream().filter(u->mtxx.getParamSjh().equals(u.getSjsjh()) ).collect(Collectors.toList());
for(Map.Entry<String, List<TbSfDrsj>> entry : jjGroup.entrySet()){
if(sjGroup.containsKey(entry.getKey())){
sjGroup.get((entry.getKey())).addAll(entry.getValue());
}else {
sjGroup.put(entry.getKey(),entry.getValue());
}
}
for(Map.Entry<String, List<TbSfDrsj>> entry : sjGroup.entrySet()){
// System.out.println("key :"+entry.getKey()+", value :"+entry.getValue());
rtMap.put(entry.getKey(),entry.getValue());
}
// return rtMap;
resultMap.put("rows",rtMap);
return resultMap;
}
@Override
public Map<String, Object> wlQmdListTjBySjh(TbSfDrsj mtxx) {
Map<String, Object> rtMap = new HashMap<>();
List<TbSfDrsj> listResult=new ArrayList<>();
List<TbSfDrsj> dbResult=new ArrayList<>();
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("total",0);
// listResult= mtxxMapper.queryWlxxBySjhTj2(mtxx);
// dbResult= wlxxMapper.queryWlxxBySjh2(mtxx);
// listResult.addAll(dbResult);
if("1".equals(mtxx.getCxlx())){
listResult= mtxxMapper.queryWlxxBySjhTj2(mtxx);
}else if("2".equals(mtxx.getCxlx())) {
listResult= wlxxMapper.queryWlxxBySjh2(mtxx);
}else {
listResult= mtxxMapper.queryWlxxBySjhTj2(mtxx);
dbResult= wlxxMapper.queryWlxxBySjh2(mtxx);
listResult.addAll(dbResult);
}
if(listResult!=null){
resultMap.put("total",listResult.size());
}
//寄件与收件一样是不是会造成数据重复
Map<String, List<TbSfDrsj>> jjGroup= listResult.stream().filter(u->!mtxx.getParamSjh().equals(u.getSjsjh()) ).collect(Collectors.groupingBy(TbSfDrsj::getSjsjh));
Map<String, List<TbSfDrsj>> sjGroup = listResult.stream().filter(u->!mtxx.getParamSjh().equals(u.getJjsjh()) ).collect(Collectors.groupingBy(TbSfDrsj::getJjsjh));
for(Map.Entry<String, List<TbSfDrsj>> entry : jjGroup.entrySet()){
if(sjGroup.containsKey(entry.getKey())){
sjGroup.get((entry.getKey())).addAll(entry.getValue());
}else {
sjGroup.put(entry.getKey(),entry.getValue());
}
}
for(Map.Entry<String, List<TbSfDrsj>> entry : sjGroup.entrySet()){
// System.out.println("key :"+entry.getKey()+", value :"+entry.getValue());
rtMap.put(entry.getKey(),entry.getValue());
}
// return rtMap;
resultMap.put("rows",rtMap);
return resultMap;
}
@Override
public Map<String, Object> wlSfListTjBySjh(TbSfDrsj mtxx) {
Map<String, Object> rtMap = new HashMap<>();
List<TbSfDrsj> listResult=new ArrayList<>();
listResult= mtxxMapper.queryWlxxBySjhTj2(mtxx);
//寄件与收件一样是不是会造成数据重复
Map<String, List<TbSfDrsj>> jjGroup= listResult.stream().filter(u->!mtxx.getParamSjh().equals(u.getJjsjh()) ).collect(Collectors.groupingBy(TbSfDrsj::getSjsjh));
Map<String, List<TbSfDrsj>> sjGroup = listResult.stream().filter(u->!mtxx.getParamSjh().equals(u.getSjsjh()) ).collect(Collectors.groupingBy(TbSfDrsj::getJjsjh));
for(Map.Entry<String, List<TbSfDrsj>> entry : jjGroup.entrySet()){
if(sjGroup.containsKey(entry.getKey())){
sjGroup.get((entry.getKey())).addAll(entry.getValue());
}else {
sjGroup.put(entry.getKey(),entry.getValue());
}
}
for(Map.Entry<String, List<TbSfDrsj>> entry : sjGroup.entrySet()){
System.out.println("key :"+entry.getKey()+", value :"+entry.getValue());
rtMap.put(entry.getKey(),entry.getValue());
}
return rtMap;
}
@Override
public Map<String, Object> wlRqsjBySjh(TbSfDrsj mtxx) {
Map<String, Object> rtMap = new HashMap<>();
List<CountNameVo> listResult=new ArrayList<>();
long total=0;
rtMap.put("rows",new ArrayList<>());
List<CountNameVo> list=new ArrayList<>();
List<CountNameVo> dbResult2=new ArrayList<>();
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(mtxx.getPage());
easyUIPage.setPagePara(mtxx.getLimit());
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
mtxx.setPage(begin);
mtxx.setLimit(end);
// listResult= mtxxMapper.wlRqsjBySjh(mtxx);
if("1".equals(mtxx.getCxlx())){
listResult= mtxxMapper.wlRqsjBySjh(mtxx);
}else if("2".equals(mtxx.getCxlx())) {
listResult=wlxxMapper.wlRqsjBySjh(mtxx);
}else {
listResult= mtxxMapper.wlRqsjBySjh(mtxx);
dbResult2=wlxxMapper.wlRqsjBySjh(mtxx);
listResult.addAll(dbResult2);
listResult.parallelStream().collect(Collectors.groupingBy(o -> (o.getName() ), Collectors.toList())).forEach((id, transfer) -> {
transfer.stream().reduce((a, b) -> new CountNameVo("","",a.getCount() + b.getCount(),a.getName(),"" )).ifPresent(list::add);
});
rtMap.put("rows",list);
return rtMap;
}
rtMap.put("rows",listResult);
return rtMap;
}
@Override
public Map<String, Object> wlYuefRqsjBySjh(TbSfDrsj mtxx) {
Map<String, Object> rtMap = new HashMap<>();
List<CountNameVo> listResult=new ArrayList<>();
List<CountNameVo> list=new ArrayList<>();
List<CountNameVo> dbResult2=new ArrayList<>();
long total=0;
rtMap.put("rows",new ArrayList<>());
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(mtxx.getPage());
easyUIPage.setPagePara(mtxx.getLimit());
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
mtxx.setPage(begin);
mtxx.setLimit(end);
// listResult= mtxxMapper.wlYuefRqsjBySjh(mtxx);
if("1".equals(mtxx.getCxlx())){
listResult= mtxxMapper.wlYuefRqsjBySjh(mtxx);
}else if("2".equals(mtxx.getCxlx())) {
listResult=wlxxMapper.wlYuefRqsjBySjh(mtxx);
}else {
listResult= mtxxMapper.wlYuefRqsjBySjh(mtxx);
dbResult2=wlxxMapper.wlYuefRqsjBySjh(mtxx);
listResult.addAll(dbResult2);
listResult.parallelStream().collect(Collectors.groupingBy(o -> (o.getName() ), Collectors.toList())).forEach((id, transfer) -> {
transfer.stream().reduce((a, b) -> new CountNameVo("","",a.getCount() + b.getCount(),a.getName(),"" )).ifPresent(list::add);
});
rtMap.put("rows",list);
return rtMap;
}
rtMap.put("rows",listResult);
return rtMap;
}
@Override
public Map<String, Object> wlBrjjBySjh(TbSfDrsj mtxx) {
Map<String, Object> rtMap = new HashMap<>();
List<CountNameVo> listResult=new ArrayList<>();
long jjtotal=0;
long sjtotal=0;
long total=0;
long dbtotal=0;
rtMap.put("jjtotal",0);
rtMap.put("sjtotal",0);
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(mtxx.getPage());
easyUIPage.setPagePara(mtxx.getLimit());
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
mtxx.setPage(begin);
mtxx.setLimit(end);
// jjtotal= mtxxMapper.wlBrjjBySjh(mtxx);
// total= mtxxMapper.queryWlxxBySjhCount(mtxx);
total= mtxxMapper.queryWlxxBySjhCountTest(mtxx);
if("1".equals(mtxx.getCxlx())){
jjtotal= mtxxMapper.wlBrjjBySjh(mtxx);
}else if("2".equals(mtxx.getCxlx())) {
jjtotal=wlxxMapper.wlBrjjBySjh(mtxx);
}else {
dbtotal=wlxxMapper.wlBrjjBySjh(mtxx);
jjtotal+=dbtotal;
}
rtMap.put("jjtotal",jjtotal);
rtMap.put("sjtotal",total-jjtotal);
return rtMap;
}
@Override
public Map<String, Object> wlShdztjBySjh(TbSfDrsj mtxx) {
Map<String, Object> rtMap = new HashMap<>();
List<CountNameVo> listResult=new ArrayList<>();
List<CountNameVo> list=new ArrayList<>();
List<CountNameVo> dbResult2=new ArrayList<>();
long total=0;
long erdz=0;
long sandz=0;
long sidz=0;
long wudz=0;
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(mtxx.getPage());
easyUIPage.setPagePara(mtxx.getLimit());
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
mtxx.setPage(begin);
mtxx.setLimit(end);
// listResult= mtxxMapper.wlShdztjBySjh(mtxx);
if("1".equals(mtxx.getCxlx())){
listResult= mtxxMapper.wlShdztjBySjh(mtxx);
for (CountNameVo s:listResult){
if(s.getCount()<=2){
erdz++;
}
if(s.getCount()==3){
sandz++;
}
if(s.getCount()==4){
sidz++;
}
if(s.getCount()>=5){
wudz++;
}
}
}else if("2".equals(mtxx.getCxlx())) {
listResult=wlxxMapper.wlShdztjBySjh(mtxx);
for (CountNameVo s:listResult){
if(s.getCount()<=2){
erdz++;
}
if(s.getCount()==3){
sandz++;
}
if(s.getCount()==4){
sidz++;
}
if(s.getCount()>=5){
wudz++;
}
}
}else {
listResult= mtxxMapper.wlShdztjBySjh(mtxx);
dbResult2=wlxxMapper.wlShdztjBySjh(mtxx);
listResult.addAll(dbResult2);
listResult.parallelStream().collect(Collectors.groupingBy(o -> (o.getName() ), Collectors.toList())).forEach((id, transfer) -> {
transfer.stream().reduce((a, b) -> new CountNameVo("","",a.getCount() + b.getCount(),a.getName(),"" )).ifPresent(list::add);
});
for (CountNameVo s:list){
if(s.getCount()<=2){
erdz++;
}
if(s.getCount()==3){
sandz++;
}
if(s.getCount()==4){
sidz++;
}
if(s.getCount()>=5){
wudz++;
}
}
}
// for (CountNameVo s:listResult){
// if(s.getCount()<=2){
// erdz++;
// }
// if(s.getCount()==3){
// sandz++;
// }
// if(s.getCount()==4){
// sidz++;
// }
// if(s.getCount()>=5){
// wudz++;
// }
// }
rtMap.put("erdz",erdz);
rtMap.put("sandz",sandz);
rtMap.put("sidz",sidz);
rtMap.put("wudz",wudz);
return rtMap;
}
@Override
public Map<String, Object> wlSftjBySjh(TbSfDrsj mtxx) {
Map<String, Object> rtMap = new HashMap<>();
List<CountNameVo> listResult=new ArrayList<>();
List<CountNameVo> list=new ArrayList<>();
List<CountNameVo> dbResult2=new ArrayList<>();
long total=0;
long erdz=0;
long sandz=0;
long sidz=0;
long wudz=0;
long qttotal=0;
long sum=0;
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(mtxx.getPage());
easyUIPage.setPagePara(mtxx.getLimit());
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
mtxx.setPage(begin);
mtxx.setLimit(end);
if("1".equals(mtxx.getCxlx())){
listResult= mtxxMapper.wlSftjBySjh(mtxx);
}else if("2".equals(mtxx.getCxlx())) {
}else {
listResult= mtxxMapper.wlSftjBySjh(mtxx);
}
// listResult= mtxxMapper.wlSftjBySjh(mtxx);
sum=listResult.stream().mapToLong(CountNameVo::getCount).sum();
// total= mtxxMapper.queryWlxxBySjhCount(mtxx);
total= mtxxMapper.queryWlxxBySjhCountTest(mtxx);
qttotal=total-sum;
if(qttotal>0){
CountNameVo qt=new CountNameVo();
qt.setCount(qttotal);
qt.setName("其他");
listResult.add(qt);
}
rtMap.put("rows",listResult);
return rtMap;
}
@Override
public Map<String, Object> wlQmdtjBySjh(TbSfDrsj mtxx) {
Map<String, Object> rtMap = new HashMap<>();
List<CountNameVo> listResult=new ArrayList<>();
List<CountNameVo> list=new ArrayList<>();
List<CountNameVo> dbResult2=new ArrayList<>();
long total=0;
long erdz=0;
long sandz=0;
long sidz=0;
long wudz=0;
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(mtxx.getPage());
easyUIPage.setPagePara(mtxx.getLimit());
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
mtxx.setPage(begin);
mtxx.setLimit(end);
listResult= mtxxMapper.wlQmdtjBySjh(mtxx);
if("1".equals(mtxx.getCxlx())){
listResult= mtxxMapper.wlQmdtjBySjh(mtxx);
for (CountNameVo s:listResult){
if(s.getCount()<=2){
erdz++;
}
if(s.getCount()==3){
sandz++;
}
if(s.getCount()==4){
sidz++;
}
if(s.getCount()>=5){
wudz++;
}
}
}else if("2".equals(mtxx.getCxlx())) {
listResult=wlxxMapper.wlQmdtjBySjh(mtxx);
for (CountNameVo s:listResult){
if(s.getCount()<=2){
erdz++;
}
if(s.getCount()==3){
sandz++;
}
if(s.getCount()==4){
sidz++;
}
if(s.getCount()>=5){
wudz++;
}
}
}else {
listResult= mtxxMapper.wlQmdtjBySjh(mtxx);
dbResult2=wlxxMapper.wlQmdtjBySjh(mtxx);
listResult.addAll(dbResult2);
listResult.parallelStream().collect(Collectors.groupingBy(o -> (o.getName() ), Collectors.toList())).forEach((id, transfer) -> {
transfer.stream().reduce((a, b) -> new CountNameVo("","",a.getCount() + b.getCount(),a.getName(),"" )).ifPresent(list::add);
});
for (CountNameVo s:listResult){
if(s.getCount()<=2){
erdz++;
}
if(s.getCount()==3){
sandz++;
}
if(s.getCount()==4){
sidz++;
}
if(s.getCount()>=5){
wudz++;
}
}
}
// for (CountNameVo s:listResult){
// if(s.getCount()<=2){
// erdz++;
// }
// if(s.getCount()==3){
// sandz++;
// }
// if(s.getCount()==4){
// sidz++;
// }
// if(s.getCount()>=5){
// wudz++;
// }
// }
rtMap.put("erdz",erdz);
rtMap.put("sandz",sandz);
rtMap.put("sidz",sidz);
rtMap.put("wudz",wudz);
return rtMap;
}
@Override
public Map<String, Object> queryWlxxBySjh(TbSfDrsj mtxx) {
Map<String, Object> rtMap = new HashMap<>();
List<TbSfDrsj> listResult=new ArrayList<>();
long total=0;
rtMap.put("rows",new ArrayList<>());
rtMap.put("total",0);
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(mtxx.getPage());
easyUIPage.setPagePara(mtxx.getLimit());
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
mtxx.setPage(begin);
mtxx.setLimit(end);
// listResult= mtxxMapper.queryWlxxBySjh(mtxx);
// total=mtxxMapper.queryWlxxBySjhCount(mtxx);
listResult= mtxxMapper.queryWlxxBySjhtest(mtxx);
total= mtxxMapper.queryWlxxBySjhCountTest(mtxx);
rtMap.put("total",total);
rtMap.put("rows",listResult);
return rtMap;
}
@Override
public Map<String, Object> queryWlxxBySjhtest(TbSfDrsj mtxx) {
Map<String, Object> rtMap = new HashMap<>();
List<TbSfDrsj> listResult=new ArrayList<>();
long total=0;
rtMap.put("rows",new ArrayList<>());
rtMap.put("total",0);
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(mtxx.getPage());
easyUIPage.setPagePara(mtxx.getLimit());
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
mtxx.setPage(begin);
mtxx.setLimit(end);
listResult= mtxxMapper.queryWlxxBySjhtest(mtxx);
total=mtxxMapper.queryWlxxBySjhCountTest(mtxx);
rtMap.put("total",total);
rtMap.put("rows",listResult);
return rtMap;
}
@Override
public Map<String, Object> doAnalyseWlxxBySjh(TbSfDrsj mtxx) {
Map<String, Object> rtMap = new HashMap<>();
List<TbSfDrsj> listResult=new ArrayList<>();
long total=0;
rtMap.put("rows",new ArrayList<>());
rtMap.put("total",0);
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(mtxx.getPage());
easyUIPage.setPagePara(mtxx.getLimit());
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
mtxx.setPage(begin);
mtxx.setLimit(end);
listResult= mtxxMapper.queryWlxxBySjh(mtxx);
total=mtxxMapper.queryWlxxBySjhCount(mtxx);
rtMap.put("total",total);
rtMap.put("rows",listResult);
return rtMap;
}
}
package org.springblade.founder.shzy.util;
import com.alibaba.fastjson.JSON;
import org.apache.http.HttpStatus;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.springblade.core.secure.utils.SecureUtil;
import org.springblade.founder.shzy.entity.SysYhczrz;
import org.springblade.modules.system.entity.XzxtUser;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.net.InetAddress;
import java.util.*;
@Component
public class YhczRzUtil {
private static String url;
private static String authorization;
private static final HashMap<String, String> headers = new HashMap<>();
@Value("${yhczrz.url}")
private void setUrl(String url) {
YhczRzUtil.url = url;
}
@Value("${yhczrz.authorization}")
private void setAuthorization(String authorization) {
YhczRzUtil.authorization = authorization;
if (!headers.containsKey("founder.authorization")) {
headers.put("founder.authorization", YhczRzUtil.authorization);
}
}
public static void doCzrz(SysYhczrz sysYhczrz,Map<String, Object> map) {
try {
XzxtUser xzxtUser = SecureUtil.getUserXzxt();
if (xzxtUser != null) {
String dw = xzxtUser.getUnitcode().substring(0, 2);
if ("43".equals(dw)) {
} else {
return;
}
} else {
return;
}
Set<String> set = map.keySet();
Iterator<String> it = set.iterator();
while (it.hasNext()) {
String key = (String) it.next();
Object values = map.get(key);
if (values instanceof String) {
values = ((String) values).trim();
if (values.equals("")) {
values = null;
}
}
map.put(key, values);
}
sysYhczrz.setCzxxParam(JSON.toJSONString(map));
sysYhczrz.setYhIp(getIp());
sysYhczrz.setYhdwGajgjgdm(xzxtUser.getUnitcode());
sysYhczrz.setYhdwGajgmc(xzxtUser.getUnitname());
sysYhczrz.setYhGmsfhm(xzxtUser.getIdentitycard());
sysYhczrz.setYhXm(xzxtUser.getRealname());
sysYhczrz.setFwsj(new Date());
sysYhczrz.setXxdjdwGajgjgdm(xzxtUser.getUnitcode());
sysYhczrz.setXxdjdwGajgmc(xzxtUser.getUnitname());
sysYhczrz.setXxdjryXm(xzxtUser.getRealname());
sysYhczrz.setXxdjryGmsfhm(xzxtUser.getIdentitycard());
sysYhczrz.setXxdjryLxdh(xzxtUser.getPhone());
sysYhczrz.setXxczdwGajgjgdm(xzxtUser.getUnitcode());
sysYhczrz.setXxczdwGajgmc(xzxtUser.getUnitname());
sysYhczrz.setXxczryXm(xzxtUser.getRealname());
sysYhczrz.setXxczryGmsfhm(xzxtUser.getIdentitycard());
String param = JSON.toJSONString(sysYhczrz);
String resultToken = doPostJson(url, headers, param);
} catch (Exception e) {
e.printStackTrace();
}
}
public static String doPostJson(String url, Map<String, String> headers, String json) throws Exception {
// post请求返回结果
CloseableHttpClient httpClient = HttpClients.createDefault();
String jsonResult = null;
HttpPost httpPost = new HttpPost(url);
// 设置请求和传输超时时间
httpPost.setConfig(RequestConfig.custom().setSocketTimeout(4000).setConnectTimeout(4000).build());
if (headers != null) {
for (String key : headers.keySet()) {
httpPost.setHeader(key, headers.get(key));
}
}
try {
//设置参数解决中文乱码
if (null != json) {
StringEntity entity = new StringEntity(json, "utf-8");
entity.setContentEncoding("UTF-8");
entity.setContentType("application/json");
httpPost.setEntity(entity);
}
//发送请求
CloseableHttpResponse result = httpClient.execute(httpPost);
if (result.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
// 读取服务器返回的json数据(然后解析)
jsonResult = EntityUtils.toString(result.getEntity(), "utf-8");
} else {
throw new Exception();
}
} catch (Exception e) {
e.printStackTrace();
throw new Exception();
} finally {
httpPost.releaseConnection();
}
return jsonResult;
}
public static String getIp() throws Exception {
HttpServletRequest request = ((ServletRequestAttributes)
RequestContextHolder.getRequestAttributes()).getRequest();
String ip = request.getHeader("X-Forwarded-For");
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("WL-Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("HTTP_CLIENT_IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("HTTP_X_FORWARDED_FOR");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("X-Real-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getRemoteAddr();
}
//有些网络通过多层代理,那么获取到的ip就会有多个,一般都是通过逗号(,)分割开来,并且第一个ip为客户端的真实IP
if (ip != null && ip.length() != 0) {
ip = ip.split(",")[0];
}
if ("127.0.0.1".equals(ip) || ip == "127.0.0.1" || "0:0:0:0:0:0:0:1".equals(ip)
|| ip == "0:0:0:0:0:0:0:1") {
ip = InetAddress.getLocalHost().getHostAddress();
}
return ip;
}
}
package org.springblade.founder.utils;
import org.springblade.founder.shzy.entity.CountNameVo;
import io.swagger.models.auth.In;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
......@@ -11,23 +12,14 @@ import java.util.stream.Collectors;
public class HMacUtil {
public static void main(String[] args) {
try {
String secret = HMACSHA256("app_id=XZ15000000&app_key=pSFRNTQQXDJKSjzL&xz_token=2d69c3e2da6e8ecc8e977603&timestamp=1591152151950", "zdejRKFNCUSSAIjbvijEdRFxjnzKAI");
System.out.println(secret);
List<CountNameVo> list = new ArrayList<>();
list.add(new CountNameVo("","",70L,"张三","" ));
list.add(new CountNameVo("","",70L,"张三","" ));
list.add(new CountNameVo("","",70L,"张三","" ));
list.add(new CountNameVo("","",70L,"张三","" ));
List<CountNameVo> studentList = new ArrayList<>();
list.parallelStream().collect(Collectors.groupingBy(o -> (o.getName() ), Collectors.toList())).forEach((id, transfer) -> {
transfer.stream().reduce((a, b) -> new CountNameVo("","",a.getCount() + b.getCount(),a.getName(),"" )).ifPresent(studentList::add);
});
for (CountNameVo student : studentList) {
System.out.println(student.toString());
String j="4";
String jj="10";
if(Integer.parseInt(j)>5){
System.out.println("21");
}
String secret = HMACSHA256("app_id=XZ15000000&app_key=pSFRNTQQXDJKSjzL&xz_token=2d69c3e2da6e8ecc8e977603&timestamp=1591152151950", "zdejRKFNCUSSAIjbvijEdRFxjnzKAI");
System.out.println(secret);
......
......@@ -21,14 +21,16 @@ public class SysNewUser extends BaseModel {
private String oldPassword;
private String newPassword;
private String newPassword1;
private String cyjs;
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
private String id;
private String cyxxzjbh;
@ApiModelProperty(value = "单位代码")
private String unitcode;
@ApiModelProperty(value = "用户姓名")
private String username;
@ApiModelProperty(value = "密码")
......
......@@ -17,16 +17,16 @@ spring:
# database: 0
# ssl: false
business:
host: 47.92.223.200
port: 7779
password: p!ssw0rd1
database: 2
host: 192.168.1.123
port: 6379
password:
database: 0
ssl: false
userredis:
host: 192.168.79.128
host: 192.168.1.123
port: 6379
password:
database: 2
database: 0
ssl: false
##redis 集群环境配置
#cluster:
......
......@@ -2,7 +2,7 @@
spring:
redis:
##redis 单机环境配置
host: 127.0.0.1
host: 192.168.1.123
port: 6379
password:
database: 0
......
......@@ -21,6 +21,7 @@ spring:
multipart:
max-file-size: 256MB
max-request-size: 1024MB
# location: /data/hnxz/tempFile
mvc:
throw-exception-if-no-handler-found: true
resources:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment