From 6e4f31f205b9de704d9bf247345addc5a23c9594 Mon Sep 17 00:00:00 2001 From: WenShiJun Date: Tue, 4 Jun 2024 10:11:02 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E5=8A=A8=E7=81=AB=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=90=8E=EF=BC=8C=E5=8F=AA=E6=9C=89=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E4=BA=BA=E5=92=8C=E4=B8=8B=E4=B8=80=E6=AD=A5=E7=9A=84?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E4=BA=BA=E5=8F=AF=E4=BB=A5=E7=9C=8B=E5=88=B0?= =?UTF-8?q?=E5=8A=A8=E7=81=AB=E7=94=B3=E8=AF=B7=EF=BC=8C=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E4=B8=AD=E5=85=B6=E4=BB=96=E4=BA=BA=E5=91=98=E9=83=BD=E7=9C=8B?= =?UTF-8?q?=E4=B8=8D=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/zcloud/FHmainApplication.java | 1 + .../highriskwork/AppHotworkCfdController.java | 1 + .../controller/system/LoginController.java | 2 +- .../highriskwork/HotworkCfdMapper.java | 3 ++ .../impl/HotworkCfdServiceImpl.java | 23 ++++++++++-- .../resources/application-local.properties | 29 +++++++++++---- .../resources/application-master.properties | 8 ++-- src/main/resources/application.properties | 4 +- .../highriskwork/HotworkCfdMapper.xml | 37 ++++++++++++++++--- 9 files changed, 84 insertions(+), 24 deletions(-) diff --git a/src/main/java/com/zcloud/FHmainApplication.java b/src/main/java/com/zcloud/FHmainApplication.java index 1251f755..75b6e36d 100644 --- a/src/main/java/com/zcloud/FHmainApplication.java +++ b/src/main/java/com/zcloud/FHmainApplication.java @@ -7,6 +7,7 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.cache.annotation.EnableCaching; +import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Conditional; import org.springframework.scheduling.annotation.EnableScheduling; diff --git a/src/main/java/com/zcloud/controller/app/highriskwork/AppHotworkCfdController.java b/src/main/java/com/zcloud/controller/app/highriskwork/AppHotworkCfdController.java index e7250d05..d02cbabd 100644 --- a/src/main/java/com/zcloud/controller/app/highriskwork/AppHotworkCfdController.java +++ b/src/main/java/com/zcloud/controller/app/highriskwork/AppHotworkCfdController.java @@ -1659,6 +1659,7 @@ public class AppHotworkCfdController extends BaseController { map.put("measuresList", hotworkCfdService.listAllMeasures(condition)); pd = hotworkCfdService.findById(pd); //根据ID读取 + // created by liu jun 添加(交底人、项目主管部门负责人、安全措施确认人) hotworkCfdService.addInfo(pd); diff --git a/src/main/java/com/zcloud/controller/system/LoginController.java b/src/main/java/com/zcloud/controller/system/LoginController.java index 5c93c4f0..0b3c188e 100644 --- a/src/main/java/com/zcloud/controller/system/LoginController.java +++ b/src/main/java/com/zcloud/controller/system/LoginController.java @@ -187,7 +187,7 @@ public class LoginController extends BaseController { PageData pathData = corpPathService.getCorpPathByCorpId(pd); map.put("baseImgPath",pathData.getString("PIC_PATH")); map.put("USER_IDENTITY",pathData.getString("USER_IDENTITY")); - map.put("BACKENDADDR", pathData.getString("BACK_END_PATH")); + map.put("BACKENDADDR", "http://192.168.0.49:8091/"); } else { PageData pathData = corpPathService.getCorpPathByPersonInfo(pd); map.put("baseImgPath",pathData.getString("PIC_PATH")); diff --git a/src/main/java/com/zcloud/mapper/datasource/highriskwork/HotworkCfdMapper.java b/src/main/java/com/zcloud/mapper/datasource/highriskwork/HotworkCfdMapper.java index 0536d207..2d1fdc87 100644 --- a/src/main/java/com/zcloud/mapper/datasource/highriskwork/HotworkCfdMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/highriskwork/HotworkCfdMapper.java @@ -85,5 +85,8 @@ public interface HotworkCfdMapper { PageData countCheck(PageData pd); PageData getCode(PageData pd); + + List datalistPageHistory(Page page); + } diff --git a/src/main/java/com/zcloud/service/highriskwork/impl/HotworkCfdServiceImpl.java b/src/main/java/com/zcloud/service/highriskwork/impl/HotworkCfdServiceImpl.java index c95cdb52..d18e7c80 100644 --- a/src/main/java/com/zcloud/service/highriskwork/impl/HotworkCfdServiceImpl.java +++ b/src/main/java/com/zcloud/service/highriskwork/impl/HotworkCfdServiceImpl.java @@ -309,12 +309,29 @@ public class HotworkCfdServiceImpl implements HotworkCfdService { * @param page * @throws Exception */ - public List list(Page page)throws Exception{ + public List list(Page page) throws Exception { List list = hotworkCfdMapper.datalistPage(page); - // created by liu jun 2024/02/03 description: 拼接动火交底人、项目主管部门、安全项检查人 - for(PageData dto: list){ + String applyStatus = page.getPd().getString("APPLY_STATUS"); + + for (PageData dto : list) { + + page.getPd().put("HOTWORK_ID", dto.getString("HOTWORK_ID")); + + if ("1".equals(applyStatus) || "1.5".equals(applyStatus) || "2".equals(applyStatus)) { + List historyList = hotworkCfdMapper.datalistPageHistory(page); + if (historyList != null && !historyList.isEmpty()) { + for (PageData historyPd : historyList) { + if (historyPd.getString("HOTWORK_ID").equals(dto.getString("HOTWORK_ID"))) { + dto.put("historyPd", historyPd); + break; + } + } + } + } + this.addInfo(dto); } + return list; } public List jhlist(Page page)throws Exception{ diff --git a/src/main/resources/application-local.properties b/src/main/resources/application-local.properties index 023e9b32..e5619e2d 100644 --- a/src/main/resources/application-local.properties +++ b/src/main/resources/application-local.properties @@ -2,12 +2,12 @@ datasource.no1.driver-class-name: com.mysql.cj.jdbc.Driver datasource.no1.url=jdbc:mysql://39.101.130.96:33068/qa-gwj-prevention?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=utf-8 -datasource.no1.username=root -datasource.no1.password=Mysql@zcloud88888 +datasource.no1.username=dev +datasource.no1.password=Zykj@dev123456 datasource.no2.driver-class-name: com.mysql.cj.jdbc.Driver datasource.no2.url=jdbc:mysql://39.101.130.96:33068/qa-gwj-regulatory?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=utf-8 -datasource.no2.username=root -datasource.no2.password=Mysql@zcloud88888 +datasource.no2.username=dev +datasource.no2.password=Zykj@dev123456 #druid??? @@ -62,19 +62,30 @@ spring.main.banner-mode=off #qa-regulatory-gwj.api.url=http://192.168.0.79:8008 preventionxgf.api.url=https://qgxgf.qhdsafety.com/qa-prevention-xgf/ qa-regulatory-gwj.api.url=https://qgjg.qhdsafety.com/qa-regulatory-gwj/ + +baseimgpath =http://192.168.192.201:8991/file/ + +heBeiQinAnFile=https://file.zcloudchina.com/YTHFile + +dw.url=http://192.168.192.201:8888/qa-dingWei-gwj/ #????? -smb.host=192.168.192.201 +#smb.host=192.168.192.201 +#smb.port=22 +#smb.user=root +#smb.password=SJSKAQHBGLXT@20220311 +#smb.basePath=/mnt/qask/file/ +smb.host=39.101.130.96 smb.port=22 smb.user=root -smb.password=SJSKAQHBGLXT@20220311 -smb.basePath=/mnt/qask/file/ +smb.password=Zcloud@zcloud88888 +smb.basePath=/mnt/wwag/file/ #Mq\u914D\u7F6E rocketmq.consumer.group2=edu-admin-edit rocketmq.consumer.group1=edu-admin-add #rocketmq.name-server=10.0.140.141:9876 #rocketmq.name-server=192.168.0.70:9876 -rocketmq.name-server=192.168.151.57:9876 +rocketmq.name-server=39.100.115.58:8899 rocketmq.producer.group=libmiddle rocketmq.producer.send-message-timeout=3000 rocketmq.producer.compress-message-body-threshold=4096 @@ -88,6 +99,8 @@ mq.topic.info=info mq.topic.eightWork=eightWork mq.group.info=scheduled_tasks mq.group.eightWork=scheduled_tasks_eightWork +mq.gwj.data.topic=czks_docking +mq.gwj.file.topic=czks_dockingPicture corp.default.pic-path=https://qgqy.qhdsafety.com/ diff --git a/src/main/resources/application-master.properties b/src/main/resources/application-master.properties index fb62718f..5bbf7b1f 100644 --- a/src/main/resources/application-master.properties +++ b/src/main/resources/application-master.properties @@ -1,12 +1,12 @@ # ?????? datasource.no1.driver-class-name: com.mysql.cj.jdbc.Driver -datasource.no1.url=jdbc:mysql://192.168.192.202:33068/qa-gwj-prevention?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=utf-8 +datasource.no1.url=jdbc:mysql://39.101.130.96:33068/qa-gwj-regulatory?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=utf-8 datasource.no1.username=root -datasource.no1.password=gwjsjkzcloud888888 +datasource.no1.password=Mysql@zcloud88888 datasource.no2.driver-class-name: com.mysql.cj.jdbc.Driver -datasource.no2.url=jdbc:mysql://192.168.192.202:33068/qa-gwj-regulatory?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=utf-8 +datasource.no2.url=jdbc:mysql://39.101.130.96:33068/qa-gwj-prevention?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=utf-8 datasource.no2.username=root -datasource.no2.password=gwjsjkzcloud888888 +datasource.no2.password=Mysql@zcloud88888 #druid连接池 spring.datasource.type: com.alibaba.druid.pool.DruidDataSource diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index dd259ac5..ea7feb10 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -2,11 +2,11 @@ spring.application.name=qa-prevention-gwj server.port=8091 #?? -#spring.profiles.active=local +spring.profiles.active=local #����31ʱʹ�� #spring.profiles.active=dev #?? -spring.profiles.active=master +#spring.profiles.active=master diff --git a/src/main/resources/mybatis/datasource/highriskwork/HotworkCfdMapper.xml b/src/main/resources/mybatis/datasource/highriskwork/HotworkCfdMapper.xml index bb442595..5e2058c5 100644 --- a/src/main/resources/mybatis/datasource/highriskwork/HotworkCfdMapper.xml +++ b/src/main/resources/mybatis/datasource/highriskwork/HotworkCfdMapper.xml @@ -490,7 +490,6 @@ f.APPROVE_USER_SIGNER_PATH, f.APPROVE_USER_SIGNER_TIME, f.APPLY_STATUS, - (SELECT a.ANALYZE_TIME from bus_hotworkgas_cfd a where a.ISDELETE = '0' AND a.HOTWORK_ID = #{HOTWORK_ID} ORDER BY @@ -578,7 +577,12 @@ aacu.NAME as ACCEPT_CONFESS_USER_NAME, anad.NAME as ANALYZE_DEPARTMENT_NAME, - anau.NAME as ANALYZE_USER_NAME + anau.NAME as ANALYZE_USER_NAME, + + bhe.USER_NAME as EXAMINE_USER_NAME, + bhe.APPROVAL_OPINIONS as EXAMINE_APPROVAL_OPINIONS, + bhe.CREATE_TIME as EXAMINE_APPROVAL_CREATE_TIME + from f left join OA_DEPARTMENT ad on ad.DEPARTMENT_ID = f.APPLY_DEPARTMENT_ID @@ -614,8 +618,10 @@ left join OA_DEPARTMENT anad on anad.DEPARTMENT_ID = f.ANALYZE_DEPARTMENT_ID left join SYS_USER anau on anau.USER_ID = f.ANALYZE_USER_ID + left join bus_hotwork_cfd_examine bhe on bhe.HOTWORK_ID = f.HOTWORK_ID and bhe.TYPE = 1 + where - f.HOTWORK_ID = #{HOTWORK_ID} + f.HOTWORK_ID = #{HOTWORK_ID} @@ -780,9 +786,9 @@ and bhac.ACCEPT_USER_ID = f.ACCEPT_USER_ID and bhac.CORPINFO_ID = f.CORPINFO_ID and bhac.ISDELETE = '0' and bhac.ACCEPT_USER_ID is not null and trim(bhac.ACCEPT_USER_ID) != '' where f.ISDELETE = '0' - - and f.APPLY_STATUS = #{pd.APPLY_STATUS} - + + + and f.APPLY_STATUS in ('1','2','4','5','6','0.9','2.5','1.5') @@ -1725,4 +1731,23 @@ and f.CREATTIME LIKE CONCAT(#{CREATDATE},'%') + + From 42dc26afd5b7eb8f4be8a2cfa7751d707e66ce7e Mon Sep 17 00:00:00 2001 From: WenShiJun Date: Tue, 4 Jun 2024 10:58:14 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E5=8A=A8=E7=81=AB=E5=90=84=E4=B8=AA?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E6=9F=A5=E8=AF=A2=E6=97=B6=E6=8C=89=E7=85=A7?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=97=B6=E9=97=B4=E9=99=8D=E5=BA=8F=E6=8E=92?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/highriskwork/impl/HotworkCfdServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/zcloud/service/highriskwork/impl/HotworkCfdServiceImpl.java b/src/main/java/com/zcloud/service/highriskwork/impl/HotworkCfdServiceImpl.java index d18e7c80..235d6541 100644 --- a/src/main/java/com/zcloud/service/highriskwork/impl/HotworkCfdServiceImpl.java +++ b/src/main/java/com/zcloud/service/highriskwork/impl/HotworkCfdServiceImpl.java @@ -332,7 +332,9 @@ public class HotworkCfdServiceImpl implements HotworkCfdService { this.addInfo(dto); } - return list; + return list.stream() + .sorted((o1, o2) -> o2.getString("CREATTIME").compareTo(o1.getString("CREATTIME"))) + .collect(Collectors.toList()); } public List jhlist(Page page)throws Exception{ return hotworkCfdMapper.jhdatalistPage(page); From 95f225bb9f1e0b1743d2759fd65eb121f0d0687a Mon Sep 17 00:00:00 2001 From: WenShiJun Date: Wed, 5 Jun 2024 09:46:57 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E4=B8=80=E5=85=AC=E5=8F=B8app=E7=AB=AF?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6=E6=98=BE=E7=A4=BA=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E4=B8=BB=E7=AE=A1=E5=AE=A1=E6=89=B9=E5=86=85=E5=AE=B9?= =?UTF-8?q?=EF=BC=8C=E6=B7=BB=E5=8A=A0=E6=9F=A5=E8=AF=A2APPROVAL=5FSIGNATU?= =?UTF-8?q?RE=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mybatis/datasource/highriskwork/HotworkCfdMapper.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/resources/mybatis/datasource/highriskwork/HotworkCfdMapper.xml b/src/main/resources/mybatis/datasource/highriskwork/HotworkCfdMapper.xml index 5e2058c5..d10d0b51 100644 --- a/src/main/resources/mybatis/datasource/highriskwork/HotworkCfdMapper.xml +++ b/src/main/resources/mybatis/datasource/highriskwork/HotworkCfdMapper.xml @@ -581,6 +581,7 @@ bhe.USER_NAME as EXAMINE_USER_NAME, bhe.APPROVAL_OPINIONS as EXAMINE_APPROVAL_OPINIONS, + bhe.APPROVAL_SIGNATURE as EXAMINE_APPROVAL_SIGNATURE, bhe.CREATE_TIME as EXAMINE_APPROVAL_CREATE_TIME from From dc537a8a1542e3e8ca938a7b9fd63a84dd5a23a9 Mon Sep 17 00:00:00 2001 From: WenShiJun Date: Wed, 5 Jun 2024 15:03:47 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E9=AB=98=E5=8D=B1=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E6=8F=90=E4=BA=A4=E5=90=8E=EF=BC=8C=E4=B8=8B?= =?UTF-8?q?=E4=B8=80=E6=AD=A5=E7=9A=84=E6=93=8D=E4=BD=9C=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E8=B4=A6=E5=8F=B7=E4=B8=AD=E5=9C=A8=E4=B8=BB=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E5=92=8C=E9=AB=98=E5=8D=B1=E4=BD=9C=E4=B8=9A=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E4=B8=AD=E9=83=BD=E6=B2=A1=E6=9C=89=E7=9B=B8=E5=BA=94=E7=9A=84?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/HotworkCfdServiceImpl.java | 17 +++++++++++++++ .../datasource/gf/BlindBoardMapper.xml | 21 +++++++++++++------ .../datasource/gf/ConfinedSpaceMapper.xml | 19 ++++++++++++++--- .../datasource/gf/ElectricityMapper.xml | 21 +++++++++++++------ .../mybatis/datasource/gf/HighWorkMapper.xml | 21 ++++++++++++++----- .../mybatis/datasource/gf/HoistingMapper.xml | 20 ++++++++++++++---- 6 files changed, 95 insertions(+), 24 deletions(-) diff --git a/src/main/java/com/zcloud/service/highriskwork/impl/HotworkCfdServiceImpl.java b/src/main/java/com/zcloud/service/highriskwork/impl/HotworkCfdServiceImpl.java index 235d6541..5a5b81cf 100644 --- a/src/main/java/com/zcloud/service/highriskwork/impl/HotworkCfdServiceImpl.java +++ b/src/main/java/com/zcloud/service/highriskwork/impl/HotworkCfdServiceImpl.java @@ -450,6 +450,23 @@ public class HotworkCfdServiceImpl implements HotworkCfdService { condition.put("TYPE", "2"); // 安全项检查人需处理数 info.put("safetyNum", busHotworkCfdExamineMapper.findByCondition(condition).size()); + int sumCount = 0; + sumCount += Integer.parseInt(info.getString("COUNTBACK", "0")); + sumCount += Integer.parseInt(info.getString("COUNTLEADER", "0")); + sumCount += Integer.parseInt(info.getString("COUNTMONITOR", "0")); + sumCount += Integer.parseInt(info.getString("COUNTACCEPT", "0")); + sumCount += Integer.parseInt(info.getString("COUNTAPPROVE", "0")); + sumCount += Integer.parseInt(info.getString("COUNTANALYZE", "0")); + sumCount += Integer.parseInt(info.getString("safetyNum", "0")); + sumCount += Integer.parseInt(info.getString("belongingNum", "0")); + sumCount += Integer.parseInt(info.getString("COUNTGUARDIAN", "0")); + sumCount += Integer.parseInt(info.getString("confessNum", "0")); + sumCount += Integer.parseInt(info.getString("COUNTACCEPTCONFESS", "0")); + sumCount += Integer.parseInt(info.getString("COUNTCONFIRM", "0")); + sumCount += Integer.parseInt(info.getString("COUNTCONFESS", "0")); + sumCount += Integer.parseInt(info.getString("COUNTAUDIT", "0")); + + info.put("SUMCOUNT", sumCount); // 气体分析人需处理数 return info; } diff --git a/src/main/resources/mybatis/datasource/gf/BlindBoardMapper.xml b/src/main/resources/mybatis/datasource/gf/BlindBoardMapper.xml index da5034b2..de873929 100644 --- a/src/main/resources/mybatis/datasource/gf/BlindBoardMapper.xml +++ b/src/main/resources/mybatis/datasource/gf/BlindBoardMapper.xml @@ -1350,20 +1350,29 @@ - diff --git a/src/main/resources/mybatis/datasource/gf/ElectricityMapper.xml b/src/main/resources/mybatis/datasource/gf/ElectricityMapper.xml index ab53bbf7..4795cc08 100644 --- a/src/main/resources/mybatis/datasource/gf/ElectricityMapper.xml +++ b/src/main/resources/mybatis/datasource/gf/ElectricityMapper.xml @@ -1517,16 +1517,25 @@ COUNT(CASE WHEN f.APPLY_STATUS = '3' AND f.APPROVE_USER_ID = #{USER_ID} THEN f.ELECTRICITY_ID END) COUNTAPPROVE, COUNT(CASE WHEN f.APPLY_STATUS = '4' AND f.ACCEPT_USER_ID = #{USER_ID} THEN f.ELECTRICITY_ID END) COUNTACCEPT, COUNT(CASE WHEN f.APPLY_STATUS = '1' AND f.ANALYZE_USER_ID = #{USER_ID} THEN f.ELECTRICITY_ID END) COUNTANALYZE, - COUNT(CASE WHEN f.APPLY_STATUS < '5' AND f.APPLY_STATUS > 0 AND f.GUARDIAN_USER_ID = #{USER_ID} and f.GUARDIAN_USER_SIGNER_TIME is null THEN f.ELECTRICITY_ID END) COUNTGUARDIAN, - COUNT(CASE WHEN f.APPLY_STATUS < '5' AND f.APPLY_STATUS > 0 AND f.CONFESS_USER_ID = #{USER_ID} and f.CONFESS_USER_SIGNER_TIME is null THEN f.ELECTRICITY_ID END) COUNTCONFESS, - COUNT(CASE WHEN f.APPLY_STATUS < '5' AND f.APPLY_STATUS > 0 AND f.ACCEPT_CONFESS_USER_ID = #{USER_ID} and - not exists(select 1 from GF_ELECTRICITY_ACCEPTUSER m where m.ELECTRICITY_ID = f.ELECTRICITY_ID and m.CORPINFO_ID = f.CORPINFO_ID and f.ACCEPT_CONFESS_USER_ID = m.ACCEPT_CONFESS_USER_ID) - THEN f.ELECTRICITY_ID END) COUNTACCEPTCONFESS + COUNT(CASE WHEN f.APPLY_STATUS < '5' AND f.APPLY_STATUS > 0 AND f.GUARDIAN_USER_ID = #{USER_ID} and f.GUARDIAN_USER_SIGNER_TIME is null THEN f.ELECTRICITY_ID END) COUNTGUARDIAN, + COUNT(CASE WHEN f.APPLY_STATUS < '5' AND f.APPLY_STATUS > 0 AND f.CONFESS_USER_ID = #{USER_ID} and f.CONFESS_USER_SIGNER_TIME is null THEN f.ELECTRICITY_ID END) COUNTCONFESS, + COUNT(CASE WHEN f.APPLY_STATUS < '5' AND f.APPLY_STATUS > 0 AND f.ACCEPT_CONFESS_USER_ID = #{USER_ID} and not exists(select 1 from GF_ELECTRICITY_ACCEPTUSER m where m.ELECTRICITY_ID = f.ELECTRICITY_ID and m.CORPINFO_ID = f.CORPINFO_ID and f.ACCEPT_CONFESS_USER_ID = m.ACCEPT_CONFESS_USER_ID) THEN f.ELECTRICITY_ID END) COUNTACCEPTCONFESS, + + ( + COUNT(CASE WHEN (f.APPLY_STATUS+0) < 1 AND f.CREATOR = #{USER_ID} THEN f.ELECTRICITY_ID END) + + COUNT(CASE WHEN f.APPLY_STATUS = '1' AND f.CONFIRM_USER_ID = #{USER_ID} THEN f.ELECTRICITY_ID END) + + COUNT(CASE WHEN f.APPLY_STATUS = '2' AND f.AUDIT_USER_ID = #{USER_ID} THEN f.ELECTRICITY_ID END) + + COUNT(CASE WHEN f.APPLY_STATUS = '3' AND f.APPROVE_USER_ID = #{USER_ID} THEN f.ELECTRICITY_ID END) + + COUNT(CASE WHEN f.APPLY_STATUS = '4' AND f.ACCEPT_USER_ID = #{USER_ID} THEN f.ELECTRICITY_ID END) + + COUNT(CASE WHEN f.APPLY_STATUS = '1' AND f.ANALYZE_USER_ID = #{USER_ID} THEN f.ELECTRICITY_ID END) + + COUNT(CASE WHEN f.APPLY_STATUS < '5' AND f.APPLY_STATUS > 0 AND f.GUARDIAN_USER_ID = #{USER_ID} and f.GUARDIAN_USER_SIGNER_TIME is null THEN f.ELECTRICITY_ID END) + + COUNT(CASE WHEN f.APPLY_STATUS < '5' AND f.APPLY_STATUS > 0 AND f.CONFESS_USER_ID = #{USER_ID} and f.CONFESS_USER_SIGNER_TIME is null THEN f.ELECTRICITY_ID END) + + COUNT(CASE WHEN f.APPLY_STATUS < '5' AND f.APPLY_STATUS > 0 AND f.ACCEPT_CONFESS_USER_ID = #{USER_ID} and not exists(select 1 from GF_ELECTRICITY_ACCEPTUSER m where m.ELECTRICITY_ID = f.ELECTRICITY_ID and m.CORPINFO_ID = f.CORPINFO_ID and f.ACCEPT_CONFESS_USER_ID = m.ACCEPT_CONFESS_USER_ID) THEN f.ELECTRICITY_ID END) + ) AS SUMCOUNT FROM f WHERE f.ISDELETE = '0' AND f.CORPINFO_ID = #{CORPINFO_ID} - SELECT - COUNT(CASE WHEN (f.APPLY_STATUS+0) < 1 AND f.CREATOR = #{USER_ID} THEN f.HIGHWORK_ID END) COUNTBACK, + COUNT(CASE WHEN (f.APPLY_STATUS + 0) < 1 AND f.CREATOR = #{USER_ID} THEN f.HIGHWORK_ID END) COUNTBACK, COUNT(CASE WHEN f.APPLY_STATUS = '1' AND f.CONSTRUCTION_USER_ID = #{USER_ID} THEN f.HIGHWORK_ID END) COUNTCONSTRUCTION, COUNT(CASE WHEN f.APPLY_STATUS = '2' AND f.LEADER_USER_ID = #{USER_ID} THEN f.HIGHWORK_ID END) COUNTLEADER, COUNT(CASE WHEN f.APPLY_STATUS = '3' AND f.AUDIT_USER_ID = #{USER_ID} THEN f.HIGHWORK_ID END) COUNTAUDIT, COUNT(CASE WHEN f.APPLY_STATUS = '4' AND f.APPROVE_USER_ID = #{USER_ID} THEN f.HIGHWORK_ID END) COUNTAPPROVE, COUNT(CASE WHEN f.APPLY_STATUS = '5' AND f.ACCEPT_USER_ID = #{USER_ID} THEN f.HIGHWORK_ID END) COUNTACCEPT, - COUNT(CASE WHEN f.APPLY_STATUS < '6' AND f.APPLY_STATUS > 0 AND f.GUARDIAN_USER_ID = #{USER_ID} and f.GUARDIAN_USER_SIGNER_TIME is null THEN f.HIGHWORK_ID END) COUNTGUARDIAN, - COUNT(CASE WHEN f.APPLY_STATUS < '6' AND f.APPLY_STATUS > 0 AND f.CONFESS_USER_ID = #{USER_ID} and f.CONFESS_USER_SIGNER_TIME is null THEN f.HIGHWORK_ID END) COUNTCONFESS, - COUNT(CASE WHEN f.APPLY_STATUS < '6' AND f.APPLY_STATUS > 0 AND f.ACCEPT_CONFESS_USER_ID = #{USER_ID} and not exists(select 1 from GF_HIGHWORK_ACCEPTUSER m where m.HIGHWORK_ID = f.HIGHWORK_ID and m.CORPINFO_ID = f.CORPINFO_ID and f.ACCEPT_CONFESS_USER_ID = m.ACCEPT_CONFESS_USER_ID) THEN f.HIGHWORK_ID END) COUNTACCEPTCONFESS + COUNT(CASE WHEN f.APPLY_STATUS < '6' AND f.APPLY_STATUS > 0 AND f.GUARDIAN_USER_ID = #{USER_ID} AND f.GUARDIAN_USER_SIGNER_TIME IS NULL THEN f.HIGHWORK_ID END) COUNTGUARDIAN, + COUNT(CASE WHEN f.APPLY_STATUS < '6' AND f.APPLY_STATUS > 0 AND f.CONFESS_USER_ID = #{USER_ID} AND f.CONFESS_USER_SIGNER_TIME IS NULL THEN f.HIGHWORK_ID END) COUNTCONFESS, + COUNT(CASE WHEN f.APPLY_STATUS < '6' AND f.APPLY_STATUS > 0 AND f.ACCEPT_CONFESS_USER_ID = #{USER_ID} AND NOT EXISTS (SELECT 1 FROM GF_HIGHWORK_ACCEPTUSER m WHERE m.HIGHWORK_ID = f.HIGHWORK_ID AND m.CORPINFO_ID = f.CORPINFO_ID AND f.ACCEPT_CONFESS_USER_ID = m.ACCEPT_CONFESS_USER_ID) THEN f.HIGHWORK_ID END) COUNTACCEPTCONFESS, + -- 求和所有计数项 + ( + COUNT(CASE WHEN (f.APPLY_STATUS + 0) < 1 AND f.CREATOR = #{USER_ID} THEN f.HIGHWORK_ID END) + + COUNT(CASE WHEN f.APPLY_STATUS = '1' AND f.CONSTRUCTION_USER_ID = #{USER_ID} THEN f.HIGHWORK_ID END) + + COUNT(CASE WHEN f.APPLY_STATUS = '2' AND f.LEADER_USER_ID = #{USER_ID} THEN f.HIGHWORK_ID END) + + COUNT(CASE WHEN f.APPLY_STATUS = '3' AND f.AUDIT_USER_ID = #{USER_ID} THEN f.HIGHWORK_ID END) + + COUNT(CASE WHEN f.APPLY_STATUS = '4' AND f.APPROVE_USER_ID = #{USER_ID} THEN f.HIGHWORK_ID END) + + COUNT(CASE WHEN f.APPLY_STATUS = '5' AND f.ACCEPT_USER_ID = #{USER_ID} THEN f.HIGHWORK_ID END) + + COUNT(CASE WHEN f.APPLY_STATUS < '6' AND f.APPLY_STATUS > 0 AND f.GUARDIAN_USER_ID = #{USER_ID} AND f.GUARDIAN_USER_SIGNER_TIME IS NULL THEN f.HIGHWORK_ID END) + + COUNT(CASE WHEN f.APPLY_STATUS < '6' AND f.APPLY_STATUS > 0 AND f.CONFESS_USER_ID = #{USER_ID} AND f.CONFESS_USER_SIGNER_TIME IS NULL THEN f.HIGHWORK_ID END) + + COUNT(CASE WHEN f.APPLY_STATUS < '6' AND f.APPLY_STATUS > 0 AND f.ACCEPT_CONFESS_USER_ID = #{USER_ID} AND NOT EXISTS (SELECT 1 FROM GF_HIGHWORK_ACCEPTUSER m WHERE m.HIGHWORK_ID = f.HIGHWORK_ID AND m.CORPINFO_ID = f.CORPINFO_ID AND f.ACCEPT_CONFESS_USER_ID = m.ACCEPT_CONFESS_USER_ID) THEN f.HIGHWORK_ID END) + ) AS SUMCOUNT FROM f WHERE f.ISDELETE = '0' AND f.CORPINFO_ID = #{CORPINFO_ID} - -