diff --git a/src/main/java/com/chinaweal/aiccs/aiccs/abnormal/controller/EBaseinfoController.java b/src/main/java/com/chinaweal/aiccs/aiccs/abnormal/controller/EBaseinfoController.java index b066115..efe63b8 100644 --- a/src/main/java/com/chinaweal/aiccs/aiccs/abnormal/controller/EBaseinfoController.java +++ b/src/main/java/com/chinaweal/aiccs/aiccs/abnormal/controller/EBaseinfoController.java @@ -627,6 +627,11 @@ public class EBaseinfoController extends BaseController { @RequestMapping("queryCphStatistics") public RestResult queryCphStatistics(@RequestBody Map customParamMap, HttpServletRequest request) { + AICUser aicUser = getLoginUser(request); + if (aicUser != null) { + String regionId = aicUser.getRegionID(); + customParamMap.put("regionId", regionId); + } List rs = eBaseinfoService.queryCphStat(customParamMap); return RestResult.ok(rs); } diff --git a/src/main/java/com/chinaweal/aiccs/aiccs/abnormal/service/impl/EBaseinfoServiceImpl.java b/src/main/java/com/chinaweal/aiccs/aiccs/abnormal/service/impl/EBaseinfoServiceImpl.java index 8876d00..979f9ef 100644 --- a/src/main/java/com/chinaweal/aiccs/aiccs/abnormal/service/impl/EBaseinfoServiceImpl.java +++ b/src/main/java/com/chinaweal/aiccs/aiccs/abnormal/service/impl/EBaseinfoServiceImpl.java @@ -688,6 +688,7 @@ public class EBaseinfoServiceImpl extends BaseServiceImpl rs = baseMapper.queryCphStat(customParamMap); // 一笔业务包含多个主体的要统计主体数量,xiangwu +/* for (ComprehensiveStat each : rs) { each.setAbnlrnum(baseMapper.countabnlrnum(each.getOrgn(), customParamMap)); each.setLeglrnum(baseMapper.countleglrnum(each.getOrgn(), customParamMap)); @@ -695,6 +696,7 @@ public class EBaseinfoServiceImpl extends BaseServiceImpl regulatoryVOS = regulatoryMapper.queryParentRegulatory(); List orgnList = new ArrayList<>(); diff --git a/src/main/resources/mybatis/mapper/aiccs/abnormal/EBaseinfoMapper.xml b/src/main/resources/mybatis/mapper/aiccs/abnormal/EBaseinfoMapper.xml index 5d6cc26..ba8e250 100644 --- a/src/main/resources/mybatis/mapper/aiccs/abnormal/EBaseinfoMapper.xml +++ b/src/main/resources/mybatis/mapper/aiccs/abnormal/EBaseinfoMapper.xml @@ -654,10 +654,14 @@ select orgn, orgunitname, sum(abnlrnum) as abnlrnum, sum(abnycnum) as abnycnum, + sum(abnycnumon) as abnycnumon, + sum(abnycnumoff) as abnycnumoff, sum(abnyynum) as abnyynum, sum(leglrnum) as leglrnum, sum(legyynum) as legyynum, sum(legycnum) as legycnum, + sum(legycnumon) as legycnumon, + sum(legycnumoff) as legycnumoff, sum(ualfknum) as ualfknum, sum(mytrnum) as mytrnum, sum(wtcznum) as wtcznum, @@ -675,10 +679,14 @@ select rs2.orgn, rs2.orgunitname, rs1.abnlrnum, rs1.abnycnum, + rs1.abnycnumon, + rs1.abnycnumoff, rs1.abnyynum, rs1.leglrnum, rs1.legyynum, rs1.legycnum, + rs1.legycnumon, + rs1.legycnumoff, rs1.ualfknum, rs1.mytrnum, rs1.wtcznum, @@ -696,10 +704,14 @@ select SIGNUSERID, count(case when bustype in ('5','13','11') then 1 else null end) as abnlrnum, count(case when bustype in ('7','14','12') then 1 else null end) as abnycnum, + count(case when bustype in ('7','14','12') and origin='1' then 1 else null end) as abnycnumon, + count(case when bustype in ('7','14','12') and (origin is null or origin!='1') then 1 else null end) as abnycnumoff, count(case when bustype='6' then 1 else null end) as abnyynum, count(case when bustype='15' then 1 else null end) as leglrnum, count(case when bustype='16' then 1 else null end) as legyynum, count(case when bustype='17' then 1 else null end) as legycnum, + count(case when bustype='17' and origin='1' then 1 else null end) as legycnumon, + count(case when bustype='17' and (origin is null or origin!='1') then 1 else null end) as legycnumoff, count(case when bustype='30' then 1 else null end) as ualfknum, count(case when bustype='31' then 1 else null end) as mytrnum, count(case when bustype='32' then 1 else null end) as wtcznum, @@ -714,7 +726,7 @@ count(case when bustype='61' then 1 else null end) as locknum, count(case when bustype='62' then 1 else null end) as unlocknum from - (select BIZSEQID,BUSTYPE,max(SIGNUSERID) SIGNUSERID from aiccs.tstasklist where BUSSTATUS !=4 + (select BIZSEQID,BUSTYPE,max(SIGNUSERID) SIGNUSERID,origin from aiccs.tstasklist where BUSSTATUS !=4 and BUSSTATUS = '2' @@ -727,16 +739,39 @@ and date_format(SIGNTIME,'%Y-%m-%d') <= #{customParamMap.endDate} - group by bizseqid,BUSTYPE + group by bizseqid,BUSTYPE,origin ) t2 group by SIGNUSERID ) rs1 left join ( select rs.*, tog.orgunitname from ( - select tu.userid, left(tog.orgNumber,6) as orgn from cxaicorg.t_users tu + select tu.userid, + + + left(tog.orgNumber,4)||'00' + + + left(tog.orgNumber,6) + + + tog.orgNumber + + + as orgn from cxaicorg.t_users tu left join cxaicorg.t_orgunits tog on tu.orgunitid = tog.orgunitid ) rs left join cxaicorg.t_orgunits tog on rs.orgn = tog.orgNumber )rs2 on rs1.SIGNUSERID = rs2.userid where rs2.orgn is not null and rs2.orgunitname is not null + + + and rs2.orgn like '15%' + + + and rs2.orgn like #{customParamMap.regionId.substring(0,4)}||'%' + + + and rs2.orgn like #{customParamMap.regionId.substring(0,6)}||'%' + + ) jg group by orgn, orgunitname order by orgn asc