Procházet zdrojové kódy

大数据-党员统计

pengjing před 4 měsíci
rodič
revize
eb07a9978b

+ 1 - 1
src/main/resources/application.yml

@@ -19,7 +19,7 @@ spring:
       filters: stat
       driver-class-name: com.mysql.cj.jdbc.Driver
       #基本属性
-      url: jdbc:mysql://office.bowintek.com:3306/ghscpartybuild?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true
+      url: jdbc:mysql://office.bowintek.com:3306/ghscpartybuild_0912?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true
       username: root
       password: bowin@123
       #配置初始化大小/最小/最大

+ 14 - 18
src/main/resources/mapping/BigDataCQuery.xml

@@ -523,24 +523,20 @@
 
     <!--统计党员总数 在岗职工数 职工人数-->
     <select id="selectPartyUserTotalList" resultType="java.util.HashMap">
-        select t.DZZDM,t.TOTAL,t.ZGCOUNT,fb.ZGRS,t.LTXCOUNT
-        from (
-        select DZZDM,sum(total) TOTAL,sum(zgcount) ZGCOUNT,sum(ltxcount) LTXCOUNT
-        from (
-        select substr(z.DZZDM, 1, length(#{dzzdm})) as DZZDM,
-        count(1) as total,
-        (sum(case when (us.GZGW not in('0500','0501','0502','0504') or us.GZGW is null) then 1 else 0 end)) zgcount,
-         (sum(case when us.GZGW in('0500','0501','0502','0504') then 1 else 0 end)) as ltxcount
-        from ZZ_ZZQKXX z
-        left join ZZ_ZZQKXXFB fb on z.DZZDM = fb.DZZDM
-        inner join VM_RYJBXX us on z.DZZDM = us.SZDZBDM
-        left join RS_RYJBXXFB usfb on us.RYBM = usfb.RYBM
-        where z.DZZDM like concat('',#{dzzdm},'%')
-        group by z.DZZDM
-        ) t1
-        group by DZZDM
-        ) t
-        left join ZZ_ZZQKXXFB fb on t.DZZDM = fb.DZZDM
+        select t.DZZDM, t.TOTAL, t.ZGCOUNT, fb.ZGRS, t.LTXCOUNT
+        from (select DZZDM, sum(total) TOTAL, sum(zgcount) ZGCOUNT, sum(ltxcount) LTXCOUNT
+              from (select substr(z.DZZDM, 1, length(#{dzzdm}))                                              as DZZDM,
+                           count(1)                                                                          as total,
+                           count(1) - sum(case when fb.ZZLB = '400' and fb.JCZZFL = '400' then 1 else 0 end) as zgcount,
+                           sum(case when fb.ZZLB = '400' and fb.JCZZFL = '400' then 1 else 0 end)            as ltxcount
+                    from ZZ_ZZQKXX z
+                             left join ZZ_ZZQKXXFB fb on z.DZZDM = fb.DZZDM
+                             inner join VM_RYJBXX us on z.DZZDM = us.SZDZBDM
+                             left join RS_RYJBXXFB usfb on us.RYBM = usfb.RYBM
+                    where z.DZZDM like concat('', #{dzzdm}, '%')
+                    group by z.DZZDM) t1
+              group by DZZDM) t
+                 left join ZZ_ZZQKXXFB fb on t.DZZDM = fb.DZZDM
     </select>
 
     <!--统计创岗建区-->