Forráskód Böngészése

大数据-学历统计

pengjing 4 hónapja
szülő
commit
be103a8e82
1 módosított fájl, 29 hozzáadás és 43 törlés
  1. 29 43
      src/main/resources/mapping/BigDataCQuery.xml

+ 29 - 43
src/main/resources/mapping/BigDataCQuery.xml

@@ -303,52 +303,38 @@
 
     <!--学历统计-->
     <select id="selectUserEducationList" resultType="java.util.Map">
-        select t1.EDUCATIONTYPE
-        ,(case t1.EDUCATIONTYPE
-        when 1 then '研究生'
-        when 2 then '大学本科'
-        when 3 then '大学专科'
-        when 4 then '中专'
-        when 5 then '高中、中技'
-        when 6 then '其他'
-        else '' end) EDUCATIONNAME
-        ,ifnull(t2.num,0) NUM
-        from (select dic.DICKEY as EDUCATIONTYPE from cf_dictionary dic where dic.DICTYPEKEY='monthType' and dic.DICKEY <![CDATA[ <= ]]> 6) t1
-        left join (select EDUCATIONTYPE,count(*) num from (
-        select distinct us.RYBM,us.SZDZBDM,
-        (case when xl.HZMC in('研究生教育','博士研究生','硕士研究生','中央党校在职研究生','省(区、市)委党校在职研究生','研究生其他','研究生班') then 1
-        when xl.HZMC in('本科教育','大学本科') then 2
-        when xl.HZMC in('专科教育','大学专科') then 3
-        when xl.HZMC in('中等职业教育','中专') then 4
-        when xl.HZMC in('技校','高中及以下','高中') then 5
-        else 6 end) EDUCATIONTYPE
-        from VM_RYJBXX us
-        inner join ZZ_ZZQKXX zz on us.SZDZBDM = zz.DZZDM
-        left join zd_whcddm1 xl on us.XL=xl.BM -- 学历
-        where 1=1
-        <if test="dzzdm != null and dzzdm != ''">
-            and us.SZDZBDM like concat('',#{dzzdm},'%')
-        </if>
-        <if test="dwgzzlb !=null">
-            <if test="dwgzzlb == 1">
-                and us.ZWMC like '%党委书记%'
-            </if>
-            <if test="dwgzzlb == 2">
-                and us.ZWMC like '%党委副书记%'
+        select xl.BM as EDUCATIONTYPE
+        ,xl.HZMC as EDUCATIONNAME
+        ,ifnull(us.NUM,0) as NUM
+        from zd_whcddm1 xl
+        left join (
+            select us.XL,sum(case when us.rybm is not null then 1 else 0 end) as NUM
+            from VM_RYJBXX us
+            inner join ZZ_ZZQKXX zz on us.SZDZBDM = zz.DZZDM
+            where 1=1
+            <if test="dzzdm != null and dzzdm != ''">
+                and us.SZDZBDM like concat('',#{dzzdm},'%')
             </if>
-            <if test="dwgzzlb == 3">
-                and (us.ZWMC like '%支部书记%' or us.ZWMC like '%总支书记%')
+            <if test="dwgzzlb !=null">
+                <if test="dwgzzlb == 1">
+                    and us.ZWMC like '%党委书记%'
+                </if>
+                <if test="dwgzzlb == 2">
+                    and us.ZWMC like '%党委副书记%'
+                </if>
+                <if test="dwgzzlb == 3">
+                    and (us.ZWMC like '%支部书记%' or us.ZWMC like '%总支书记%')
+                </if>
+                <if test="dwgzzlb == 4">
+                    and (us.ZWMC like '%支部副书记%' or us.ZWMC like '%总支副书记%')
+                </if>
             </if>
-            <if test="dwgzzlb == 4">
-                and (us.ZWMC like '%支部副书记%' or us.ZWMC like '%总支副书记%')
+            <if test="isOnduty!=null and isOnduty==1">
+                and (us.GZGW not in('0500','0501','0502','0504') or us.GZGW is null)-- 在岗人员
             </if>
-        </if>
-        <if test="isOnduty!=null and isOnduty==1">
-            and (us.GZGW not in('0500','0501','0502','0504') or us.GZGW is null)-- 在岗人员
-        </if>
-        ) tt1 group by EDUCATIONTYPE
-        ) t2 on t1.EDUCATIONTYPE=t2.EDUCATIONTYPE
-        order by t1.EDUCATIONTYPE
+            group by us.XL
+        ) us on us.XL=xl.BM
+        order by xl.XH
     </select>
 
     <!--统计三会一课-->