浏览代码

fix: 达梦函数修改

zhangying 1 月之前
父节点
当前提交
79d81d2980

+ 22 - 0
src/main/java/com/ghsc/partybuild/config/JacksonConfig.java

@@ -0,0 +1,22 @@
+package com.ghsc.partybuild.config;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+public class JacksonConfig {
+
+    @Bean
+    public ObjectMapper objectMapper() {
+        // 忽略全局引用
+        ObjectMapper mapper = new ObjectMapper();
+        mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
+        mapper.configure(SerializationFeature.CLOSE_CLOSEABLE, false);
+        mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
+        mapper.configure(SerializationFeature.FAIL_ON_SELF_REFERENCES, false);
+        return mapper;
+    }
+}
+

+ 46 - 34
src/main/java/com/ghsc/partybuild/service/impl/BigDataServiceImpl.java

@@ -1,6 +1,7 @@
 package com.ghsc.partybuild.service.impl;
 package com.ghsc.partybuild.service.impl;
 
 
 import com.ghsc.partybuild.util.DateUtils;
 import com.ghsc.partybuild.util.DateUtils;
+import com.ghsc.partybuild.util.StringUtils;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.github.pagehelper.PageInfo;
 import com.ghsc.partybuild.AppConfig;
 import com.ghsc.partybuild.AppConfig;
@@ -45,6 +46,9 @@ public class BigDataServiceImpl implements BigDataService {
     @Autowired
     @Autowired
     private DateUtils dateUtils;
     private DateUtils dateUtils;
 
 
+    @Autowired
+    private StringUtils stringUtils;
+
     /**
     /**
      * @return java.util.List<com.ghsc.partybuild.model.DsjDydt>
      * @return java.util.List<com.ghsc.partybuild.model.DsjDydt>
      * @Description //TODO 查询大数据-党员动态
      * @Description //TODO 查询大数据-党员动态
@@ -472,18 +476,22 @@ public class BigDataServiceImpl implements BigDataService {
         Integer startYear = nowYear - 4;
         Integer startYear = nowYear - 4;
 
 
         for (Integer year = startYear; year <= nowYear; year++) {
         for (Integer year = startYear; year <= nowYear; year++) {
-            HashMap<String, Object> data = new HashMap<>();
-            data.put("year", year);
+            if (list != null) {
+                HashMap<String, Object> data = new HashMap<>();
+                data.put("year", year);
+
+                Integer finalYear = year;
+                HashMap<String, Object> dbData = list.stream().filter(e -> e.containsKey(e.get("year")) && e.get("year").toString().equals(finalYear.toString()))
+                        .findFirst()
+                        .orElse(null);
+                if (dbData != null) {
+                    data.put("count", dbData.get("count"));
+                } else {
+                    data.put("count", 0);
+                }
 
 
-            Integer finalYear = year;
-            HashMap<String, Object> dbData = list.stream().filter(e -> e.get("year").toString().equals(finalYear.toString())).findFirst().orElse(null);
-            if (dbData != null) {
-                data.put("count", dbData.get("count"));
-            } else {
-                data.put("count", 0);
+                result.add(data);
             }
             }
-
-            result.add(data);
         }
         }
 
 
         return result;
         return result;
@@ -499,20 +507,22 @@ public class BigDataServiceImpl implements BigDataService {
         Integer startYear = nowYear - 4;
         Integer startYear = nowYear - 4;
 
 
         for (Integer year = startYear; year <= nowYear; year++) {
         for (Integer year = startYear; year <= nowYear; year++) {
-            HashMap<String, Object> data = new HashMap<>();
-            data.put("year", year);
+            if (!list.isEmpty()) {
+                HashMap<String, Object> data = new HashMap<>();
+                data.put("year", year);
 
 
-            Integer finalYear = year;
-            HashMap<String, Object> dbData = list.stream().filter(e -> e.get("year").toString().equals(finalYear.toString())).findFirst().orElse(null);
-            if (dbData != null) {
-                data.put("count_partyUser", dbData.get("count_partyUser"));
-                data.put("count_workUser", dbData.get("count_workUser"));
-            } else {
-                data.put("count_partyUser", 0);
-                data.put("count_workUser", 0);
-            }
+                Integer finalYear = year;
+                HashMap<String, Object> dbData = list.stream().filter(e -> e.containsKey("year") && e.get("year").toString().equals(finalYear.toString())).findFirst().orElse(null);
+                if (dbData != null) {
+                    data.put("count_partyUser", dbData.get("count_partyUser"));
+                    data.put("count_workUser", dbData.get("count_workUser"));
+                } else {
+                    data.put("count_partyUser", 0);
+                    data.put("count_workUser", 0);
+                }
 
 
-            result.add(data);
+                result.add(data);
+            }
         }
         }
 
 
         return result;
         return result;
@@ -528,21 +538,23 @@ public class BigDataServiceImpl implements BigDataService {
         Integer startYear = nowYear - 4;
         Integer startYear = nowYear - 4;
 
 
         for (Integer year = startYear; year <= nowYear; year++) {
         for (Integer year = startYear; year <= nowYear; year++) {
-            HashMap<String, Object> data = new HashMap<>();
-            data.put("year", year);
-
-            Integer finalYear = year;
-            if (list != null && !list.isEmpty()){
-                HashMap<String, Object> dbData = list.stream().filter(e -> e.get("year").toString().equals(finalYear.toString())).findFirst().orElse(null);
-                if (dbData != null) {
-                    data.put("count", dbData.get("count"));
-                } else {
+            if (!list.isEmpty()) {
+                HashMap<String, Object> data = new HashMap<>();
+                data.put("year", year);
+
+                Integer finalYear = year;
+                if (list != null && !list.isEmpty()){
+                    HashMap<String, Object> dbData = list.stream().filter(e -> e.containsKey("year") && e.get("year").toString().equals(finalYear.toString())).findFirst().orElse(null);
+                    if (dbData != null) {
+                        data.put("count", dbData.get("count"));
+                    } else {
+                        data.put("count", 0);
+                    }
+                } else{
                     data.put("count", 0);
                     data.put("count", 0);
                 }
                 }
-            } else{
-                data.put("count", 0);
+                result.add(data);
             }
             }
-            result.add(data);
         }
         }
 
 
         return result;
         return result;

+ 1 - 1
src/main/java/com/ghsc/partybuild/service/impl/FileMgrServiceImpl.java

@@ -63,7 +63,7 @@ public class FileMgrServiceImpl implements FileMgrService {
             criteria.andFiletypeidIn(typeIds);
             criteria.andFiletypeidIn(typeIds);
         }
         }
 
 
-        exp.setOrderByClause("cast((filecode) as SIGNED INTEGER ) asc");
+        exp.setOrderByClause("cast((filecode) as INT ) asc");
 
 
         PageHelper.startPage(pageIndex, pageSize);
         PageHelper.startPage(pageIndex, pageSize);
         List<DsjFilemrg> flist = dsjFilemrgMapper.selectByExample(exp);
         List<DsjFilemrg> flist = dsjFilemrgMapper.selectByExample(exp);

+ 1 - 1
src/main/java/com/ghsc/partybuild/service/impl/SHYKServiceImpl.java

@@ -112,7 +112,7 @@ public class SHYKServiceImpl implements SHYKService {
         List<CfDictionary> dicMeetingApproveStatus = dictionaryService.getDictionaryListByDicTypeKey("meetingApproveStatus");
         List<CfDictionary> dicMeetingApproveStatus = dictionaryService.getDictionaryListByDicTypeKey("meetingApproveStatus");
         List<CfDictionary> dicDecisionstatus = dictionaryService.getDictionaryListByDicTypeKey("decisionstatus");
         List<CfDictionary> dicDecisionstatus = dictionaryService.getDictionaryListByDicTypeKey("decisionstatus");
 
 
-        PageHelper.startPage(page, rows);
+        PageHelper.startPage(page, rows, false);
         List<HashMap<String, Object>> list = shykcQuery.selectMeetingList(partyCode, meetingName, meetingAddress, beginTime, endTime, shykStatus, shykType, userId, myMeeting, day, page, rows, ssdzzdm);
         List<HashMap<String, Object>> list = shykcQuery.selectMeetingList(partyCode, meetingName, meetingAddress, beginTime, endTime, shykStatus, shykType, userId, myMeeting, day, page, rows, ssdzzdm);
 
 
         for (HashMap<String, Object> item : list) {
         for (HashMap<String, Object> item : list) {

+ 39 - 34
src/main/resources/mapping/BigDataCQuery.xml

@@ -39,10 +39,10 @@
                   where 1=1  and dw.PROVINCE = #{province}
                   where 1=1  and dw.PROVINCE = #{province}
                   ) ut on uz.DZZDM = ut.DZZDM
                   ) ut on uz.DZZDM = ut.DZZDM
              </if>
              </if>
-             where 1=1 and uz.DZZDM like concat('',#{gddwdm},'%')
+             where 1=1 and uz.DZZDM like CONCAT('',#{gddwdm},'%')
              group by us.SZDZBDM
              group by us.SZDZBDM
         ) us on zz.DZZDM=us.SZDZBDM
         ) us on zz.DZZDM=us.SZDZBDM
-        where 1=1 and zz.DZZDM like concat('',#{gddwdm},'%')
+        where 1=1 and zz.DZZDM like CONCAT('',#{gddwdm},'%')
     </select>
     </select>
 
 
     <!--统计党委数量-->
     <!--统计党委数量-->
@@ -64,7 +64,7 @@
        left join DJZZRS_FZJGGL zzfz on SUBSTR(zz.DZZDM, 1, 12) = zzfz.DZZBM and zzfz.JGFZID is not null
        left join DJZZRS_FZJGGL zzfz on SUBSTR(zz.DZZDM, 1, 12) = zzfz.DZZBM and zzfz.JGFZID is not null
        left join DJZZRS_JGFZ fz on zzfz.JGFZID = fz.JGFZID
        left join DJZZRS_JGFZ fz on zzfz.JGFZID = fz.JGFZID
        left join DJZZRS_JGFZ fzp on fz.FJGFZID = fzp.JGFZID and fzp.FZMC = '运输站段'
        left join DJZZRS_JGFZ fzp on fz.FJGFZID = fzp.JGFZID and fzp.FZMC = '运输站段'
-        where 1=1 and zz.DZZDM like concat('',#{gddwdm},'%')
+        where 1=1 and zz.DZZDM like CONCAT('',#{gddwdm},'%')
     </select>
     </select>
 
 
     <!--统计党员数量-->
     <!--统计党员数量-->
@@ -85,7 +85,7 @@
         Coalesce(t2.NUM,t3.NUM,t4.NUM,t5.NUM,0) NUM
         Coalesce(t2.NUM,t3.NUM,t4.NUM,t5.NUM,0) NUM
         from (select dic.DICKEY as USERTYPE from cf_dictionary dic where dic.DICTYPEKEY='monthType' and dic.DICKEY <![CDATA[ <= ]]> 10 ) t1
         from (select dic.DICKEY as USERTYPE from cf_dictionary dic where dic.DICTYPEKEY='monthType' and dic.DICKEY <![CDATA[ <= ]]> 10 ) t1
         /*党员总数*/
         /*党员总数*/
-        left join (select 1 USERTYPE, count(*) num from ZZ_RYJBXX  where 1=1 and SZDZBDM like concat('',#{gddwdm},'%')) t2 on t1.USERTYPE=t2.USERTYPE -- 党员总数
+        left join (select 1 USERTYPE, count(*) num from ZZ_RYJBXX  where 1=1 and SZDZBDM like CONCAT('', NVL(#{gddwdm}, ''), '%')) t2 on t1.USERTYPE=t2.USERTYPE -- 党员总数
         /*离退休 其他*/
         /*离退休 其他*/
         left join (
         left join (
         select USERTYPE,count(*) NUM from (
         select USERTYPE,count(*) NUM from (
@@ -93,7 +93,7 @@
         (case when gzgw.HZMC in('离退休人员','离休干部') then 4
         (case when gzgw.HZMC in('离退休人员','离休干部') then 4
         else 5 end) USERTYPE from ZZ_RYJBXX us
         else 5 end) USERTYPE from ZZ_RYJBXX us
         left join  zzzd_gzgw  gzgw on us.GZGW=gzgw.BM
         left join  zzzd_gzgw  gzgw on us.GZGW=gzgw.BM
-        where 1=1 and us.SZDZBDM like concat('',#{gddwdm},'%')
+        where 1=1 and us.SZDZBDM like CONCAT('', NVL(#{gddwdm}, ''), '%')
         ) tt1 group by USERTYPE
         ) tt1 group by USERTYPE
         ) t3 on t1.USERTYPE=t3.USERTYPE
         ) t3 on t1.USERTYPE=t3.USERTYPE
         /*正式党员 预备党员 入党申请人数 入党积极分子 发展对象*/
         /*正式党员 预备党员 入党申请人数 入党积极分子 发展对象*/
@@ -109,7 +109,7 @@
         end) USERTYPE
         end) USERTYPE
         from ZZ_RYJBXX us
         from ZZ_RYJBXX us
         left join zzzd_ryzt ryzt on us.RYZT=ryzt.BM
         left join zzzd_ryzt ryzt on us.RYZT=ryzt.BM
-        where 1=1 and us.SZDZBDM like concat('',#{gddwdm},'%')
+        where 1=1 and us.SZDZBDM like CONCAT('', NVL(#{gddwdm}, ''), '%')
         ) tt2 group by USERTYPE
         ) tt2 group by USERTYPE
         ) t4 on t1.USERTYPE=t4.USERTYPE
         ) t4 on t1.USERTYPE=t4.USERTYPE
         /*在职党员*/
         /*在职党员*/
@@ -118,7 +118,7 @@
         select distinct us.RYBM from ZZ_RYJBXX us
         select distinct us.RYBM from ZZ_RYJBXX us
         left join gg_zgjbxx info on us.RYBM = info.RYBM
         left join gg_zgjbxx info on us.RYBM = info.RYBM
         left join zd_rylb rylb on info.RYLB = rylb.BM
         left join zd_rylb rylb on info.RYLB = rylb.BM
-        where 1=1 and us.SZDZBDM like concat('',#{gddwdm},'%') and rylb.BM like concat('1%') and length(rylb.BM)=3 ) tt3 ) t5 on t1.USERTYPE=t5.USERTYPE
+        where 1=1 and us.SZDZBDM like CONCAT('', NVL(#{gddwdm}, ''), '%') and rylb.BM like '1%' and length(rylb.BM)=3 ) tt3 ) t5 on t1.USERTYPE=t5.USERTYPE
 
 
         order by t1.USERTYPE
         order by t1.USERTYPE
     </select>
     </select>
@@ -143,9 +143,9 @@
             inner join VM_RYJBXX u on c.RYBM=u.RYBM
             inner join VM_RYJBXX u on c.RYBM=u.RYBM
             ) leader on us.RYBM = leader.RYBM
             ) leader on us.RYBM = leader.RYBM
         </if>
         </if>
-        where 1=1 and us.szdzbdm like concat('',#{gddwdm},'%')
+        where 1=1 and us.szdzbdm like CONCAT('',#{gddwdm},'%')
         <if test="dzzdm != null and dzzdm != ''">
         <if test="dzzdm != null and dzzdm != ''">
-            and us.SZDZBDM like concat('',#{dzzdm},'%')
+            and us.SZDZBDM like CONCAT('',#{dzzdm},'%')
         </if>
         </if>
         <if test="dwgzzlb !=null">
         <if test="dwgzzlb !=null">
             <if test="dwgzzlb == 1">
             <if test="dwgzzlb == 1">
@@ -191,7 +191,7 @@
         from (
         from (
         select distinct us.RYJBXXBS,us.RYBM
         select distinct us.RYJBXXBS,us.RYBM
                       -- ,fb.NL AS AGE
                       -- ,fb.NL AS AGE
-        ,calculate_age(STR_TO_DATE(us.csrq, '%Y%m%d')) as AGE
+        ,calculate_age(TO_DATE(us.csrq, 'YYYYMMDD')) as AGE
         from VM_RYJBXX us
         from VM_RYJBXX us
         inner join ZZ_ZZQKXX zz on us.SZDZBDM = zz.DZZDM
         inner join ZZ_ZZQKXX zz on us.SZDZBDM = zz.DZZDM
         inner join RS_RYJBXXFB fb on us.RYBM = fb.RYBM
         inner join RS_RYJBXXFB fb on us.RYBM = fb.RYBM
@@ -202,9 +202,9 @@
             inner join VM_RYJBXX u on c.RYBM=u.RYBM
             inner join VM_RYJBXX u on c.RYBM=u.RYBM
             ) leader on us.RYBM = leader.RYBM
             ) leader on us.RYBM = leader.RYBM
         </if>
         </if>
-        where 1=1 and us.SZDZBDM like concat('',#{gddwdm},'%')
+        where 1=1 and us.SZDZBDM like CONCAT('',#{gddwdm},'%')
         <if test="dzzdm != null and dzzdm != ''">
         <if test="dzzdm != null and dzzdm != ''">
-            and us.SZDZBDM like concat('',#{dzzdm},'%')
+            and us.SZDZBDM like CONCAT('',#{dzzdm},'%')
         </if>
         </if>
         <if test="dwgzzlb !=null">
         <if test="dwgzzlb !=null">
             <if test="dwgzzlb == 1">
             <if test="dwgzzlb == 1">
@@ -249,7 +249,7 @@
         else 5
         else 5
         end) ageType
         end) ageType
         from (
         from (
-        select distinct us.RYJBXXBS,us.RYBM,calculate_age(STR_TO_DATE(dj.JRZGZZRQ, '%Y%m%d')) AS age
+        select distinct us.RYJBXXBS,us.RYBM,calculate_age(TO_DATE(dj.JRZGZZRQ, 'YYYYMMDD')) AS age
         from VM_RYJBXX us
         from VM_RYJBXX us
         inner join ZZ_DJXX dj on us.RYBM=dj.RYBM
         inner join ZZ_DJXX dj on us.RYBM=dj.RYBM
         inner join ZZ_ZZQKXX zz on us.SZDZBDM = zz.DZZDM
         inner join ZZ_ZZQKXX zz on us.SZDZBDM = zz.DZZDM
@@ -260,9 +260,9 @@
                 inner join VM_RYJBXX u on c.RYBM=u.RYBM
                 inner join VM_RYJBXX u on c.RYBM=u.RYBM
             ) leader on us.RYBM = leader.RYBM
             ) leader on us.RYBM = leader.RYBM
         </if>
         </if>
-        where 1=1 and us.SZDZBDM like concat('',#{gddwdm},'%')
+        where 1=1 and us.SZDZBDM like CONCAT('',#{gddwdm},'%')
         <if test="dzzdm != null and dzzdm != ''">
         <if test="dzzdm != null and dzzdm != ''">
-            and us.SZDZBDM like concat('',#{dzzdm},'%')
+            and us.SZDZBDM like CONCAT('',#{dzzdm},'%')
         </if>
         </if>
         <if test="dwgzzlb !=null">
         <if test="dwgzzlb !=null">
             <if test="dwgzzlb == 1">
             <if test="dwgzzlb == 1">
@@ -289,7 +289,7 @@
 
 
     <!--统计政工职务党员数量-->
     <!--统计政工职务党员数量-->
     <select id="selectZgzwCount" resultType="java.util.HashMap">
     <select id="selectZgzwCount" resultType="java.util.HashMap">
-        select zw.bm as code,zw.hzmc as name
+        select zw.bm as code,zw.hzmc as name,zw.xh
         ,sum(case when uszw.rybm is not null then 1 else 0 end) as count from Zzzd_Zwmc zw
         ,sum(case when uszw.rybm is not null then 1 else 0 end) as count from Zzzd_Zwmc zw
         left join (
         left join (
         select b.rybm,b.ZWMC from zz_bzcyxx b
         select b.rybm,b.ZWMC from zz_bzcyxx b
@@ -298,10 +298,10 @@
         inner join vm_ryjbxx us on b.rybm = us.RYBM
         inner join vm_ryjbxx us on b.rybm = us.RYBM
         where (b.PZMZRQ is null or b.PZMZRQ='')
         where (b.PZMZRQ is null or b.PZMZRQ='')
         <if test="dzzdm != null and dzzdm != ''">
         <if test="dzzdm != null and dzzdm != ''">
-            and us.SZDZBDM like concat('',#{dzzdm},'%')
+            and us.SZDZBDM like CONCAT('',#{dzzdm},'%')
         </if>
         </if>
         ) uszw on zw.bm = uszw.ZWMC
         ) uszw on zw.bm = uszw.ZWMC
-        group by zw.bm,zw.hzmc
+        group by zw.bm,zw.hzmc,zw.xh
         order by zw.xh
         order by zw.xh
     </select>
     </select>
 
 
@@ -315,7 +315,7 @@
         inner join zzzd_ryzt d on us.RYZT=d.BM
         inner join zzzd_ryzt d on us.RYZT=d.BM
         where 1=1 -- t.RYZT in (2,3)
         where 1=1 -- t.RYZT in (2,3)
         <if test="partyGroup !=null and partyGroup!=''">
         <if test="partyGroup !=null and partyGroup!=''">
-            and t.SZDZBDM like concat('',#{partyGroup},'%')
+            and t.SZDZBDM like CONCAT('',#{partyGroup},'%')
         </if>
         </if>
         <if test="isOnduty!=null and isOnduty==1">
         <if test="isOnduty!=null and isOnduty==1">
             and (us.GZGW not in('0500','0501','0502','0504') or us.GZGW is null)-- 在岗人员
             and (us.GZGW not in('0500','0501','0502','0504') or us.GZGW is null)-- 在岗人员
@@ -344,7 +344,7 @@
             </if>
             </if>
             where 1=1
             where 1=1
             <if test="dzzdm != null and dzzdm != ''">
             <if test="dzzdm != null and dzzdm != ''">
-                and us.SZDZBDM like concat('',#{dzzdm},'%')
+                and us.SZDZBDM like CONCAT('',#{dzzdm},'%')
             </if>
             </if>
             <if test="dwgzzlb !=null">
             <if test="dwgzzlb !=null">
                 <if test="dwgzzlb == 1">
                 <if test="dwgzzlb == 1">
@@ -378,7 +378,7 @@
                                        where m.OPERATESTATE <![CDATA[ <> ]]> 'D'
                                        where m.OPERATESTATE <![CDATA[ <> ]]> 'D'
                                          and mt.shykType in (1,2,3,4)
                                          and mt.shykType in (1,2,3,4)
         <if test="dzzdm != null and dzzdm != ''">
         <if test="dzzdm != null and dzzdm != ''">
-            and m.PARTYCODE like concat('',#{dzzdm},'%')
+            and m.PARTYCODE like CONCAT('',#{dzzdm},'%')
         </if>
         </if>
         group by mt.SHYKTYPE
         group by mt.SHYKTYPE
         ) m on dic.DICKEY=m.SHYKTYPE
         ) m on dic.DICKEY=m.SHYKTYPE
@@ -407,7 +407,7 @@
         else 5 end ) DZZTYPE, DZZMC, DZZDM from zz_zzqkxx p
         else 5 end ) DZZTYPE, DZZMC, DZZDM from zz_zzqkxx p
         where 1=1
         where 1=1
         <if test="dzzdm != null and dzzdm != ''">
         <if test="dzzdm != null and dzzdm != ''">
-            and p.DZZDM like concat('',#{dzzdm},'%')
+            and p.DZZDM like CONCAT('',#{dzzdm},'%')
         </if>
         </if>
         ) tt1 group by DZZTYPE
         ) tt1 group by DZZTYPE
         ) t2 on t1.DZZTYPE=t2.DZZTYPE
         ) t2 on t1.DZZTYPE=t2.DZZTYPE
@@ -425,7 +425,7 @@
         USERCOUNT,ifnull(t3.meetingCount,0) as MEETINGCOUNT,
         USERCOUNT,ifnull(t3.meetingCount,0) as MEETINGCOUNT,
         ifnull(t4.XXCount,0) as CENTERCOUNT
         ifnull(t4.XXCount,0) as CENTERCOUNT
         from (select distinct p.DZZDM,p.DZZMC,count(c.DZZDM) as CHILDCOUNT
         from (select distinct p.DZZDM,p.DZZMC,count(c.DZZDM) as CHILDCOUNT
-        from (select dzzdm,dzzmc, zzlb from zz_zzqkxx where length(DZZDM)=12 and DZZDM like concat('',#{gddwdm},'%') p
+        from (select dzzdm,dzzmc, zzlb from zz_zzqkxx where length(DZZDM)=12 and DZZDM like CONCAT('',#{gddwdm},'%') p
         left join ZZ_ZZQKXX c on p.DZZDM=SUBSTR(c.DZZDM,1,12) --and length(c.DZZDM)>12
         left join ZZ_ZZQKXX c on p.DZZDM=SUBSTR(c.DZZDM,1,12) --and length(c.DZZDM)>12
         inner join ZZ_DZZFBQK zzfb on p.DZZDM=zzfb.DZZDM
         inner join ZZ_DZZFBQK zzfb on p.DZZDM=zzfb.DZZDM
         group by p.DZZDM,p.DZZMC
         group by p.DZZDM,p.DZZMC
@@ -440,7 +440,7 @@
             and m.BEGINTIME <![CDATA[ >= ]]> date_format(#{beginTime},'%Y-%m-%d')
             and m.BEGINTIME <![CDATA[ >= ]]> date_format(#{beginTime},'%Y-%m-%d')
         </if>
         </if>
         <if test="endTime != null and endTime != '' ">
         <if test="endTime != null and endTime != '' ">
-            and m.ENDTIME <![CDATA[ < ]]> date_add(date_format(#{endTime},'%Y%m%d'),interval 1 day)
+            and m.ENDTIME <![CDATA[ < ]]> date_add(date_format(#{endTime},'YYYYMMDD'),interval 1 day)
         </if>
         </if>
         group by SUBSTR(PARTYCODE,1,12)
         group by SUBSTR(PARTYCODE,1,12)
         ) t3 on t1.DZZDM=t3.DZZDM -- 三会一课数量
         ) t3 on t1.DZZDM=t3.DZZDM -- 三会一课数量
@@ -498,9 +498,9 @@
         from ZZ_ZZQKXX z
         from ZZ_ZZQKXX z
         left join ZZ_ZZQKXXFB fb on z.DZZDM=fb.DZZDM
         left join ZZ_ZZQKXXFB fb on z.DZZDM=fb.DZZDM
         left join ZZZD_ZZLBDMNEW zzlb on fb.ZZLB=zzlb.BM
         left join ZZZD_ZZLBDMNEW zzlb on fb.ZZLB=zzlb.BM
-        where 1=1 and z.DZZDM like concat('',#{gddwdm},'%')
+        where 1=1 and z.DZZDM like CONCAT('',#{gddwdm},'%')
         <if test="dzzdm != null and dzzdm != ''">
         <if test="dzzdm != null and dzzdm != ''">
-            and z.DZZDM like concat('%',#{dzzdm},'%')
+            and z.DZZDM like CONCAT('%',#{dzzdm},'%')
         </if>
         </if>
         <if test="ssdzzdm != null and ssdzzdm != ''">
         <if test="ssdzzdm != null and ssdzzdm != ''">
             and z.DZZDM =#{ssdzzdm}
             and z.DZZDM =#{ssdzzdm}
@@ -550,7 +550,7 @@
                              left join ZZ_ZZQKXXFB fb on z.DZZDM = fb.DZZDM
                              left join ZZ_ZZQKXXFB fb on z.DZZDM = fb.DZZDM
                              inner join VM_RYJBXX us on z.DZZDM = us.SZDZBDM
                              inner join VM_RYJBXX us on z.DZZDM = us.SZDZBDM
                              left join RS_RYJBXXFB usfb on us.RYBM = usfb.RYBM
                              left join RS_RYJBXXFB usfb on us.RYBM = usfb.RYBM
-                    where z.DZZDM like concat('', #{dzzdm}, '%')
+                    where z.DZZDM like CONCAT('', #{dzzdm}, '%')
                     group by z.DZZDM) t1
                     group by z.DZZDM) t1
               group by DZZDM) t
               group by DZZDM) t
                  left join ZZ_ZZQKXXFB fb on t.DZZDM = fb.DZZDM
                  left join ZZ_ZZQKXXFB fb on t.DZZDM = fb.DZZDM
@@ -565,7 +565,7 @@
         from CGJQ_POSTAREA_SCORE s
         from CGJQ_POSTAREA_SCORE s
         where 1=1 and s.OPERATESTATE <![CDATA[ <> ]]> 'D'
         where 1=1 and s.OPERATESTATE <![CDATA[ <> ]]> 'D'
         <if test="dzzdm!=null and dzzdm !=''">
         <if test="dzzdm!=null and dzzdm !=''">
-            and s.PARTYCODE like concat('',#{dzzdm},'%')
+            and s.PARTYCODE like CONCAT('',#{dzzdm},'%')
         </if>
         </if>
         <if test="ssdzzdm!=null and ssdzzdm !=''">
         <if test="ssdzzdm!=null and ssdzzdm !=''">
             and s.PARTYCODE = #{ssdzzdm}
             and s.PARTYCODE = #{ssdzzdm}
@@ -586,7 +586,7 @@
         where s.GQTYPE=1 and s.OPERATESTATE <![CDATA[ <> ]]> 'D'
         where s.GQTYPE=1 and s.OPERATESTATE <![CDATA[ <> ]]> 'D'
         and s.YEAR =#{year}
         and s.YEAR =#{year}
         <if test="dzzdm!=null and dzzdm !=''">
         <if test="dzzdm!=null and dzzdm !=''">
-            and s.PARTYCODE like concat('',#{dzzdm},'%')
+            and s.PARTYCODE like CONCAT('',#{dzzdm},'%')
         </if>
         </if>
         <if test="ssdzzdm!=null and ssdzzdm !=''">
         <if test="ssdzzdm!=null and ssdzzdm !=''">
             and s.PARTYCODE = #{ssdzzdm}
             and s.PARTYCODE = #{ssdzzdm}
@@ -633,7 +633,7 @@
         inner join PE_FLOW f on uf.FLOWID = f.FLOWID
         inner join PE_FLOW f on uf.FLOWID = f.FLOWID
         where 1=1 and us.RYZT in('1','2','5','6')
         where 1=1 and us.RYZT in('1','2','5','6')
         <if test="dzzdm != null and dzzdm != ''">
         <if test="dzzdm != null and dzzdm != ''">
-            and us.SZDZBDM like concat('',#{dzzdm},'%')
+            and us.SZDZBDM like CONCAT('',#{dzzdm},'%')
         </if>
         </if>
         group by uf.JOINUSERID
         group by uf.JOINUSERID
         ) uf on u.JOINUSERID = uf.JOINUSERID
         ) uf on u.JOINUSERID = uf.JOINUSERID
@@ -669,7 +669,7 @@
         ) stud on bz.RYBM=stud.LEADER_USER_ID
         ) stud on bz.RYBM=stud.LEADER_USER_ID
         where 1=1
         where 1=1
         <if test="dzzdm != null and dzzdm != ''">
         <if test="dzzdm != null and dzzdm != ''">
-            and fb.DZZDM like concat('',#{dzzdm},'%')
+            and fb.DZZDM like CONCAT('',#{dzzdm},'%')
         </if>
         </if>
         <if test="ssdzzdm!=null and ssdzzdm !=''">
         <if test="ssdzzdm!=null and ssdzzdm !=''">
             and fb.DZZDM = #{ssdzzdm}
             and fb.DZZDM = #{ssdzzdm}
@@ -784,7 +784,7 @@
 
 
     <select id="selectDnghbfTotalList" resultType="java.util.HashMap">
     <select id="selectDnghbfTotalList" resultType="java.util.HashMap">
         SELECT YEAR
         SELECT YEAR
-            ( CAREDATE ) AS `year`,
+            ( CAREDATE ) AS "year",
             count( mx.ID ) AS count
             count( mx.ID ) AS count
         FROM
         FROM
             dj_dnghbfmx mx
             dj_dnghbfmx mx
@@ -800,7 +800,7 @@
     </select>
     </select>
 
 
     <select id="selectZtdrTotalList" resultType="java.util.HashMap">
     <select id="selectZtdrTotalList" resultType="java.util.HashMap">
-        select month(ACTIVITYTIME) as `month`,count(1) as count from dj_ztdrxx
+        select month(ACTIVITYTIME) as "month",count(1) as count from dj_ztdrxx
         where year(ACTIVITYTIME) = #{year}
         where year(ACTIVITYTIME) = #{year}
         <if test="dzzdm!=null and dzzdm !=''">
         <if test="dzzdm!=null and dzzdm !=''">
             and dzzdm = #{dzzdm}
             and dzzdm = #{dzzdm}
@@ -822,7 +822,12 @@
         WHERE
         WHERE
             leaderTeamType = 1 -- 副处以上中层干部
             leaderTeamType = 1 -- 副处以上中层干部
         GROUP BY
         GROUP BY
-            AGENAME
+            CASE
+                WHEN TIMESTAMPDIFF(YEAR, birthDate, CURDATE()) BETWEEN 21 AND 30 THEN '21-30岁'
+                WHEN TIMESTAMPDIFF(YEAR, birthDate, CURDATE()) BETWEEN 31 AND 40 THEN '31-40岁'
+                WHEN TIMESTAMPDIFF(YEAR, birthDate, CURDATE()) BETWEEN 41 AND 50 THEN '41-50岁'
+                ELSE '51岁以上'
+                END
     </select>
     </select>
 
 
 </mapper>
 </mapper>

+ 11 - 11
src/main/resources/mapping/PartyTotalCQuery.xml

@@ -526,8 +526,8 @@
 
 
     <select id="selectPartyduesTotalListV2" resultType="com.ghsc.partybuild.vo.PartyduesTotalVo">
     <select id="selectPartyduesTotalListV2" resultType="com.ghsc.partybuild.vo.PartyduesTotalVo">
         select
         select
-               #{year}                            as `year`
-             , #{month}                           as `month`
+               #{year}                            as "year"
+             , #{month}                           as "month"
              , p.DZZDM                            as partyCode
              , p.DZZDM                            as partyCode
              , p.DZZMC                            as partyName
              , p.DZZMC                            as partyName
              , sum(ifnull(t.userCount, 0))        as userCount
              , sum(ifnull(t.userCount, 0))        as userCount
@@ -609,8 +609,8 @@
     <!--已缴党费成员(一行一个党员)-->
     <!--已缴党费成员(一行一个党员)-->
     <select id="selectAlreadyPayUserList" resultType="com.ghsc.partybuild.vo.PartyduesAlreadyPayDetailVo">
     <select id="selectAlreadyPayUserList" resultType="com.ghsc.partybuild.vo.PartyduesAlreadyPayDetailVo">
         select
         select
-               #{year}                            as `year`
-             , #{month}                           as `month`
+               #{year}                            as "year"
+             , #{month}                           as "month"
              , p.DZZDM                            as partyCode
              , p.DZZDM                            as partyCode
              , p.DZZMC                            as partyName
              , p.DZZMC                            as partyName
              , um.userCode
              , um.userCode
@@ -630,8 +630,8 @@
 
 
     <!--未缴党费成员-->
     <!--未缴党费成员-->
     <select id="selectDidnotPayUserList" resultType="com.ghsc.partybuild.vo.PartyduesDidnotPayDetailVo">
     <select id="selectDidnotPayUserList" resultType="com.ghsc.partybuild.vo.PartyduesDidnotPayDetailVo">
-        select #{year}                            as `year`
-             , #{month}                           as `month`
+        select #{year}                            as "year"
+             , #{month}                           as "month"
              , p.DZZDM                            as partyCode
              , p.DZZDM                            as partyCode
              , p.DZZMC                            as partyName
              , p.DZZMC                            as partyName
              , um.userCode
              , um.userCode
@@ -705,15 +705,15 @@
     <select id="selectPartyduesMonthTotalListV2" resultType="com.ghsc.partybuild.vo.PartyduesTotalDetailVo">
     <select id="selectPartyduesMonthTotalListV2" resultType="com.ghsc.partybuild.vo.PartyduesTotalDetailVo">
         select p.dzzmc as partyName
         select p.dzzmc as partyName
              , p.dzzdm as partyCode
              , p.dzzdm as partyCode
-             , #{year} as `year`
-             , p.`month` as `month`
+             , #{year} as "year"
+             , p."month" as "month"
              , sum(ifnull(t.amount, 0)) amount
              , sum(ifnull(t.amount, 0)) amount
-        from (select p.dzzdm, p.dzzmc, dic.DICKEY as `month`, cast(concat(#{year}, lpad(dic.DICKEY, 2, '0')) as signed) as yearMonth
+        from (select p.dzzdm, p.dzzmc, dic.DICKEY as "month", cast(concat(#{year}, lpad(dic.DICKEY, 2, '0')) as INTEGER) as yearMonth
               from zz_zzqkxx p,
               from zz_zzqkxx p,
                    cf_dictionary dic
                    cf_dictionary dic
               where dic.DICTYPEKEY = 'monthType') p
               where dic.DICTYPEKEY = 'monthType') p
                  left join (select upm.partyCode, pdd.yearMonth, sum(ifnull(pdd.MONEY, 0)) as amount
                  left join (select upm.partyCode, pdd.yearMonth, sum(ifnull(pdd.MONEY, 0)) as amount
-                            from (select cast(concat(pd.YEAR, lpad(pdd.month, 2, '0')) as signed) as yearMonth
+                            from (select cast(concat(pd.YEAR, lpad(pdd.month, 2, '0')) as INTEGER) as yearMonth
                                        , pdd.MONEY
                                        , pdd.MONEY
                                        , pd.USERCODE
                                        , pd.USERCODE
                                   from us_partydues pd
                                   from us_partydues pd
@@ -728,7 +728,7 @@
         <if test="partyCode != null  and partyCode != ''">
         <if test="partyCode != null  and partyCode != ''">
             and p.dzzdm like concat('%',#{partyCode},'%')
             and p.dzzdm like concat('%',#{partyCode},'%')
         </if>
         </if>
-        group by p.dzzdm, p.dzzmc, p.yearMonth, p.`month`
+        group by p.dzzdm, p.dzzmc, p.yearMonth, p."month"
         order by length(p.DZZDM), p.DZZDM, p.yearMonth
         order by length(p.DZZDM), p.DZZDM, p.yearMonth
     </select>
     </select>
 
 

+ 1 - 1
src/main/resources/mapping/PartyTwoCQuery.xml

@@ -379,7 +379,7 @@
         )  "isreceive"
         )  "isreceive"
         from DJ_task tk
         from DJ_task tk
         left join
         left join
-        (select taskid, group_concat(USERNAME ORDER BY USERNAME,',') as USERNAME from DJ_taskUsers group by taskid) ry
+        (select taskid, wm_concat(USERNAME) as USERNAME from DJ_taskUsers group by taskid) ry
         on tk.id=ry.taskid
         on tk.id=ry.taskid
         where 1=1
         where 1=1
         <if test="username!=null and username !=''">
         <if test="username!=null and username !=''">

+ 3 - 3
src/main/resources/mapping/PartyUserAdmitCQuery.xml

@@ -3,9 +3,9 @@
 <mapper namespace="com.ghsc.partybuild.mapper.PartyUserAdmitCQuery">
 <mapper namespace="com.ghsc.partybuild.mapper.PartyUserAdmitCQuery">
     <select id="selectPartyUserAdmitList" resultType="com.ghsc.partybuild.vo.PartyUserAdmitVo">
     <select id="selectPartyUserAdmitList" resultType="com.ghsc.partybuild.vo.PartyUserAdmitVo">
         select us.RYJBXXBS as "userId",us.RYBM as "userCode",us.XM as "userName",us.SZDZBDM as "partyCode",p.DZZMC as "partyName",us.XB as "sexId",xb.HZMC as "sex",us.RYZT as "userStatus",ryzt.HZMC as "userStatusName",
         select us.RYJBXXBS as "userId",us.RYBM as "userCode",us.XM as "userName",us.SZDZBDM as "partyCode",p.DZZMC as "partyName",us.XB as "sexId",xb.HZMC as "sex",us.RYZT as "userStatus",ryzt.HZMC as "userStatusName",
-        str_to_date(us.CSRQ,'%Y%m%d') as "birthDate",us.JG as "nativePlace",us.MZ as "nationalId",mz.HZMC as "national",usfb.APPLYDATE as "applyDate",usfb.ACTIVEDATE as "activeDate",usfb.PASSDATE as "passDate",
-        str_to_date(dj.jrzgzzrq,'%Y%m%d') as "inPartyDate",
-        str_to_date(dj.ZZRQ,'%Y%m%d') as "becomeFullDate",
+        TO_DATE(us.CSRQ,'YYYYMMDD') as "birthDate",us.JG as "nativePlace",us.MZ as "nationalId",mz.HZMC as "national",usfb.APPLYDATE as "applyDate",usfb.ACTIVEDATE as "activeDate",usfb.PASSDATE as "passDate",
+        TO_DATE(dj.jrzgzzrq,'YYYYMMDD') as "inPartyDate",
+        TO_DATE(dj.ZZRQ,'YYYYMMDD') as "becomeFullDate",
         usfb.isArchive as "isArchive",
         usfb.isArchive as "isArchive",
         case when usfb.isArchive=1 then '是' else '否' end as  "isArchiveName",
         case when usfb.isArchive=1 then '是' else '否' end as  "isArchiveName",
         us.xl as educationalId,us.SFZH as idCard,usfb.gradeName,usfb.className,usfb.enrollmentDate,usfb.graduateDate,xl.HZMC as educational,
         us.xl as educationalId,us.SFZH as idCard,usfb.gradeName,usfb.className,usfb.enrollmentDate,usfb.graduateDate,xl.HZMC as educational,

+ 4 - 4
src/main/resources/mapping/PartyUserCQuery.xml

@@ -156,7 +156,7 @@
         <if test="leaderTeamUserType != null">
         <if test="leaderTeamUserType != null">
             and userinfo.USERNAME in (select no from lw_leaderteam where leaderTeamType=#{leaderTeamUserType})
             and userinfo.USERNAME in (select no from lw_leaderteam where leaderTeamType=#{leaderTeamUserType})
         </if>
         </if>
-        order by CONVERT(us.XM USING gbk),us.RYJBXXBS
+        ORDER BY NLSSORT(us.XM, 'NLS_SORT=SCHINESE_PINYIN_M'), us.RYJBXXBS
     </select>
     </select>
 
 
     <!--查询全部的党员信息(所有政治面貌类型的人员)-->
     <!--查询全部的党员信息(所有政治面貌类型的人员)-->
@@ -346,7 +346,7 @@
         left join zd_zyjszwdm jszw on us.XJSZWMC=jszw.BM -- 技术专业职务
         left join zd_zyjszwdm jszw on us.XJSZWMC=jszw.BM -- 技术专业职务
         left join ZZ_DJXX dj on us.RYBM=dj.RYBM
         left join ZZ_DJXX dj on us.RYBM=dj.RYBM
         left join vw_partyduty uszw on us.RYBM=uszw.RYBM -- 党内职务名称
         left join vw_partyduty uszw on us.RYBM=uszw.RYBM -- 党内职务名称
-        left join (select us.USERID,us.USERNAME,GROUP_CONCAT(cr.ROLENAME SEPARATOR '、') as roleName from cf_users us
+        left join (select us.USERID,us.USERNAME,LISTAGG(cr.ROLENAME, '、') as roleName from cf_users us
         left join cf_userroles cu on us.USERID = cu.USERID
         left join cf_userroles cu on us.USERID = cu.USERID
         left join cf_roles cr on cu.ROLEID = cr.ROLEID
         left join cf_roles cr on cu.ROLEID = cr.ROLEID
         group by us.USERID,us.USERNAME) userinfo on us.RYBM = userinfo.USERID
         group by us.USERID,us.USERNAME) userinfo on us.RYBM = userinfo.USERID
@@ -387,7 +387,7 @@
         <if test="userNo != null and userNo != ''">
         <if test="userNo != null and userNo != ''">
             and userinfo.USERNAME like concat('%',#{userNo},'%')
             and userinfo.USERNAME like concat('%',#{userNo},'%')
         </if>
         </if>
-        order by CONVERT(us.XM USING gbk),us.RYJBXXBS
+        order by NLSSORT(us.XM, 'NLS_SORT=SCHINESE_PINYIN_M'),us.RYJBXXBS
     </select>
     </select>
     <!--所有党员基本信息-->
     <!--所有党员基本信息-->
     <select id="selectAllUserByNameAndMobileList" resultType="java.util.HashMap">
     <select id="selectAllUserByNameAndMobileList" resultType="java.util.HashMap">
@@ -826,7 +826,7 @@
                 and jlcf.USERID is null
                 and jlcf.USERID is null
             </if>
             </if>
         </if>
         </if>
-        order by CONVERT(us.XM USING gbk),us.RYJBXXBS
+        order by NLSSORT(us.XM, 'NLS_SORT=SCHINESE_PINYIN_M'),us.RYJBXXBS
     </select>
     </select>
 
 
     <select id="selectUserContactpoint" resultType="java.util.HashMap">
     <select id="selectUserContactpoint" resultType="java.util.HashMap">

+ 2 - 2
src/main/resources/mapping/PtCheckdataCQuery.xml

@@ -8,8 +8,8 @@
         ,checkParty.partcodes
         ,checkParty.partcodes
         from pt_checkNameList pcnl inner  join ZZ_ZZQKXX zz on pcnl.dzzdm = zz.DZZDM
         from pt_checkNameList pcnl inner  join ZZ_ZZQKXX zz on pcnl.dzzdm = zz.DZZDM
         left join(
         left join(
-        select pcp.nameId, GROUP_CONCAT(partyName order by partyName SEPARATOR ', ') as partynames
-        ,GROUP_CONCAT(partyCode order by partyCode SEPARATOR ', ') as partcodes
+        select pcp.nameId, LISTAGG(partyName, ', ') as partynames
+        ,LISTAGG(partyCode, ', ') as partcodes
         from pt_checkParty pcp
         from pt_checkParty pcp
         group by pcp.nameId
         group by pcp.nameId
         ) as checkParty on pcnl.nameId=checkParty.nameId
         ) as checkParty on pcnl.nameId=checkParty.nameId

+ 2 - 2
src/main/resources/mapping/PtReportDataCQuery.xml

@@ -8,7 +8,7 @@
         ,zz.dzzmc,file.filenames from pt_reportdata prd
         ,zz.dzzmc,file.filenames from pt_reportdata prd
         inner join ZZ_ZZQKXX zz on prd.dzzdm = zz.DZZDM
         inner join ZZ_ZZQKXX zz on prd.dzzdm = zz.DZZDM
         left join(
         left join(
-        select fl.FILEREFID, GROUP_CONCAT(FILENAME order by FILENAME SEPARATOR ', ') as filenames
+        select fl.FILEREFID, LISTAGG(FILENAME, ', ') as filenames
         from cf_file fl
         from cf_file fl
         group by fl.FILEREFID
         group by fl.FILEREFID
         ) file on prd.reportId =file.FILEREFID
         ) file on prd.reportId =file.FILEREFID
@@ -41,7 +41,7 @@
 
 
     <select id="selectReportScoreList" resultType="java.util.HashMap">
     <select id="selectReportScoreList" resultType="java.util.HashMap">
         select prd.reportid, prd.dzzdm, prd.year, prd.reportuserid, prd.reportusername
         select prd.reportid, prd.dzzdm, prd.year, prd.reportuserid, prd.reportusername
-        ,ifnull(prs.scoreid,UUID()) scoreid, prs.writtenscore, prs.scenescore, prs.dailyscore, ifnull(prs.total,0) total, prs.remark, prs.reportresult, prs.createtime, prs.createuserid, prs.createusername, prs.updatetime, prs.updateuserid, prs.updateusername
+        ,ifnull(prs.scoreid,NEWID()) scoreid, prs.writtenscore, prs.scenescore, prs.dailyscore, ifnull(prs.total,0) total, prs.remark, prs.reportresult, prs.createtime, prs.createuserid, prs.createusername, prs.updatetime, prs.updateuserid, prs.updateusername
         ,zz.dzzmc,dic.DICVALUE as reportresultname from pt_reportdata prd
         ,zz.dzzmc,dic.DICVALUE as reportresultname from pt_reportdata prd
         inner join ZZ_ZZQKXX zz on prd.dzzdm = zz.DZZDM
         inner join ZZ_ZZQKXX zz on prd.dzzdm = zz.DZZDM
         left join pt_reportScore prs on prd.reportId = prs.reportId
         left join pt_reportScore prs on prd.reportId = prs.reportId

+ 7 - 8
src/main/resources/mapping/PublicityCQuery.xml

@@ -387,10 +387,10 @@
         YEAR,pd.MONEY,pd.BASENUMBER,pd.PARTYDUESID,
         YEAR,pd.MONEY,pd.BASENUMBER,pd.PARTYDUESID,
         u.SZDZBDM,usfb.ISSTUDENT,case when usfb.isStudent=1 then '是' else '否' end as  ISSTUDENTNAME
         u.SZDZBDM,usfb.ISSTUDENT,case when usfb.isStudent=1 then '是' else '否' end as  ISSTUDENTNAME
             ,usm.yearMonth
             ,usm.yearMonth
-        from (select usercode, partycode, group_concat(yearMonth) yearMonth
+        from (select usercode, partycode, LISTAGG(yearMonth, ',') as yearMonth
             from us_party_month
             from us_party_month
-            where yearMonth >= cast(concat(#{year}, lpad(1, 2, '0')) as signed)
-            and yearMonth <![CDATA[ <= ]]> cast(concat(#{year}, lpad(12, 2, '0')) as signed)
+            where yearMonth <![CDATA[ >= ]]> cast(concat(#{year}, lpad(1, 2, '0')) as INTEGER)
+            and yearMonth <![CDATA[ <= ]]> cast(concat(#{year}, lpad(12, 2, '0')) as INTEGER)
             group by usercode, partycode
             group by usercode, partycode
         ) usm
         ) usm
         inner join VM_RYJBXX_All u on usm.usercode = u.RYBM
         inner join VM_RYJBXX_All u on usm.usercode = u.RYBM
@@ -400,10 +400,10 @@
         left join US_PartyDues pd on u.RYBM=pd.USERCODE and pd.YEAR=#{year}
         left join US_PartyDues pd on u.RYBM=pd.USERCODE and pd.YEAR=#{year}
         where 1=1
         where 1=1
         and u.RYZT in ('2', '3')
         and u.RYZT in ('2', '3')
-        and  #{year} <![CDATA[ >= ]]> cast(substr(ifnull(usfb.partyDuesStartMonth,zd.JRZGZZRQ), 1, 4) as signed)
+        and  #{year} <![CDATA[ >= ]]> CAST(SUBSTR(IFNULL(usfb.partyDuesStartMonth, zd.JRZGZZRQ), 1, 4) AS INTEGER)
         and (usfb.ISARCHIVE is null
         and (usfb.ISARCHIVE is null
                 or usfb.ISARCHIVE = 0
                 or usfb.ISARCHIVE = 0
-                or (usfb.ISARCHIVE = 1 and #{year} <![CDATA[ <= ]]> cast(substr(DATE_FORMAT(usfb.archiveDate, '%Y%m%d'), 1, 4) as signed)))
+                or (usfb.ISARCHIVE = 1 and #{year} <![CDATA[ <= ]]> cast(substr(TO_CHAR(usfb.archiveDate, 'YYYYMMDD'), 1, 4) as INTEGER)))
         <if test="partyCode!=null and partyCode !=''">
         <if test="partyCode!=null and partyCode !=''">
             and usm.partycode like concat('%',#{partyCode},'%')
             and usm.partycode like concat('%',#{partyCode},'%')
         </if>
         </if>
@@ -419,8 +419,7 @@
         <if test="isStudent != null and isStudent==0">
         <if test="isStudent != null and isStudent==0">
             and (usfb.isStudent = #{isStudent} or usfb.isStudent is null)
             and (usfb.isStudent = #{isStudent} or usfb.isStudent is null)
         </if>
         </if>
-        order by CONVERT(u.XM USING gbk),usm.yearMonth,u.RYJBXXBS
-
+        order by NLSSORT(u.XM, 'NLS_SORT=SCHINESE_PINYIN_M'),usm.yearMonth,u.RYJBXXBS
     </select>
     </select>
 
 
     <select id="selectPartyDuesTotal" resultType="java.util.HashMap">
     <select id="selectPartyDuesTotal" resultType="java.util.HashMap">
@@ -649,7 +648,7 @@
         <if test="month!=null">
         <if test="month!=null">
             and d.MONTH = #{month}
             and d.MONTH = #{month}
         </if>
         </if>
-        order by us.YEAR desc,d.MONTH desc,CONVERT(u.XM USING gbk)
+        order by us.YEAR desc,d.MONTH desc,NLSSORT(u.XM, 'NLS_SORT=SCHINESE_PINYIN_M')
     </select>
     </select>
 
 
     <!--党员基本信息-->
     <!--党员基本信息-->

+ 1 - 1
src/main/resources/mapping/PxTrainingClassCQuery.xml

@@ -27,7 +27,7 @@
         ptc.address, ptc.department, ptc.contact_name, ptc.phone, ptc.content,
         ptc.address, ptc.department, ptc.contact_name, ptc.phone, ptc.content,
         ptc.create_time, ptc.create_userid, ptc.update_time, ptc.update_userid,
         ptc.create_time, ptc.create_userid, ptc.update_time, ptc.update_userid,
         IFNULL(ptcu.user_count, 0) as user_count, IFNULL(ptcc.course_count, 0) as course_count,
         IFNULL(ptcu.user_count, 0) as user_count, IFNULL(ptcc.course_count, 0) as course_count,
-        DATEDIFF(ptc.end_date,ptc.begin_date) as date_diff_day,
+        DATEDIFF(DAY, ptc.end_date,ptc.begin_date) as date_diff_day,
         cu.USERNAME as create_user_name, zz.dzzmc
         cu.USERNAME as create_user_name, zz.dzzmc
         from px_training_class ptc
         from px_training_class ptc
         left join zz_zzqkxx zz on ptc.dzzdm = zz.dzzdm
         left join zz_zzqkxx zz on ptc.dzzdm = zz.dzzdm

+ 1 - 1
src/main/resources/mapping/PxTrainingRecordCQuery.xml

@@ -30,7 +30,7 @@
     </resultMap>
     </resultMap>
     <select id="selectPxTrainingRecordList" resultMap="BaseResultMap">
     <select id="selectPxTrainingRecordList" resultMap="BaseResultMap">
         select ptr.id, ptr.rybm, ptr.name, ptr.pxdxlx, ptr.gender, ptr.sfzh, ptr.gzbm, ptr.zw, ptr.pxxmmc,
         select ptr.id, ptr.rybm, ptr.name, ptr.pxdxlx, ptr.gender, ptr.sfzh, ptr.gzbm, ptr.zw, ptr.pxxmmc,
-                ptr.pxxs, ptr.xxkssj, ptr.xxjssj, DATEDIFF(ptr.xxjssj, ptr.xxkssj) as cxts, ptr.xss, ptr.khqk, ptr.ssjgmc, ptr.xxdd, ptr.xxnr,
+                ptr.pxxs, ptr.xxkssj, ptr.xxjssj, DATEDIFF(DAY, ptr.xxjssj, ptr.xxkssj) as cxts, ptr.xss, ptr.khqk, ptr.ssjgmc, ptr.xxdd, ptr.xxnr,
                 ptr.remark, ptr.create_time, ptr.create_userid, ptr.update_time, ptr.update_userid,
                 ptr.remark, ptr.create_time, ptr.create_userid, ptr.update_time, ptr.update_userid,
                 zz.dzzmc, zz.dzzdm
                 zz.dzzmc, zz.dzzdm
         from px_training_record ptr
         from px_training_record ptr

+ 9 - 9
src/main/resources/mapping/SHYKCQuery.xml

@@ -29,20 +29,20 @@
         SUBSTR(m.PARTYCODE,1,12) as DWDZZDM,
         SUBSTR(m.PARTYCODE,1,12) as DWDZZDM,
         dw.DZZMC as DWMC
         dw.DZZMC as DWMC
         , m.isFirstTopic
         , m.isFirstTopic
-        , m.topicContent
+        -- , m.topicContent -- topicContent长文本会导致PageHelper死循环
         , st.shykTypes
         , st.shykTypes
         , st.shykTypeNames
         , st.shykTypeNames
         FROM SHYK_MEETING m
         FROM SHYK_MEETING m
         inner join ZZ_ZZQKXX z on m.partycode=z.dzzdm
         inner join ZZ_ZZQKXX z on m.partycode=z.dzzdm
         inner join ZZ_ZZQKXX dw on SUBSTR(m.partycode,1,12)=dw.DZZDM
         inner join ZZ_ZZQKXX dw on SUBSTR(m.partycode,1,12)=dw.DZZDM
         inner join (
         inner join (
-        select t.meetingId
-        , GROUP_CONCAT(shykType order by shykType SEPARATOR ', ') as shykTypes
-        , GROUP_CONCAT(dic.DICVALUE order by shykType SEPARATOR ', ') as shykTypeNames
-        from SHYK_Meeting_Type t
-        inner join cf_dictionary dic on t.shykType = dic.DICKEY and dic.DICTYPEKEY = 'shykType'
-        where 1=1
-        group by meetingId
+            SELECT t.meetingId
+            , LISTAGG(DISTINCT t.shykType, ',') WITHIN GROUP (ORDER BY t.shykType) AS shykTypes
+            , LISTAGG(DISTINCT dic.DICVALUE, ',') WITHIN GROUP (ORDER BY dic.DICVALUE) AS shykTypeNames
+            FROM SHYK_Meeting_Type t
+            INNER JOIN cf_dictionary dic ON t.shykType = dic.DICKEY AND dic.DICTYPEKEY = 'shykType'
+            WHERE 1 = 1
+            GROUP BY t.meetingId
         ) st on m.meetingId = st.meetingId
         ) st on m.meetingId = st.meetingId
         <if test="shykType != null and shykType.size()>0">
         <if test="shykType != null and shykType.size()>0">
             inner join (
             inner join (
@@ -156,7 +156,7 @@
                  inner join zz_zzqkxx p on us.SZDZBDM = p.dzzdm
                  inner join zz_zzqkxx p on us.SZDZBDM = p.dzzdm
                  inner join cf_dictionary dic on dic.DICKEY = mdr.democracyreviewresulttype and dic.DICTYPEKEY='DemocracyReviewResultType'
                  inner join cf_dictionary dic on dic.DICKEY = mdr.democracyreviewresulttype and dic.DICTYPEKEY='DemocracyReviewResultType'
         where mdr.meetingId = #{meetingId}
         where mdr.meetingId = #{meetingId}
-        order by p.dzzdm,CONVERT(us.XM USING gbk)
+        order by p.dzzdm,NLSSORT(us.XM, 'NLS_SORT=SCHINESE_PINYIN_M')
     </select>
     </select>
 
 
     <select id="selectMeetingTypeList" resultType="com.ghsc.partybuild.vo.shyk.MeetingTypeVo">
     <select id="selectMeetingTypeList" resultType="com.ghsc.partybuild.vo.shyk.MeetingTypeVo">

+ 21 - 11
src/main/resources/mapping/TestExamPaperCQuery.xml

@@ -6,7 +6,7 @@
         pp.passingscore "passingscore",pp.createusername "createusername",pp.createtime "createtime",
         pp.passingscore "passingscore",pp.createusername "createusername",pp.createtime "createtime",
         btype.paperTypeNames "paperTypeNames" from test_paper pp
         btype.paperTypeNames "paperTypeNames" from test_paper pp
         inner join (
         inner join (
-        select bt.test_paper_id, GROUP_CONCAT(dc.DICVALUE) paperTypeNames from test_paper_basetype bt
+        select bt.test_paper_id, LISTAGG(dc.DICVALUE, ',') paperTypeNames from test_paper_basetype bt
         inner join CF_DICTIONARY dc on bt.paperType=dc.DICKEY and dc.DICTYPEKEY='PaperBasetype'
         inner join CF_DICTIONARY dc on bt.paperType=dc.DICKEY and dc.DICTYPEKEY='PaperBasetype'
         group by bt.test_paper_id
         group by bt.test_paper_id
         ) btype on pp.TEST_PAPER_ID=btype.test_paper_id
         ) btype on pp.TEST_PAPER_ID=btype.test_paper_id
@@ -79,8 +79,10 @@
         left join TEST_BASE_QUESTION_TYPE tp on ques.BASE_QUESTION_TYPE_ID=tp.BASE_QUESTION_TYPE_ID
         left join TEST_BASE_QUESTION_TYPE tp on ques.BASE_QUESTION_TYPE_ID=tp.BASE_QUESTION_TYPE_ID
         left join CF_DICTIONARY dc on dc.DICTYPEKEY ='QuestionDifficulty' and ques.difficulty=dc.DICKEY
         left join CF_DICTIONARY dc on dc.DICTYPEKEY ='QuestionDifficulty' and ques.difficulty=dc.DICKEY
         left join (
         left join (
-        select TEST_QUESTION_ID, GROUP_CONCAT(
-        concat('{"ANSWER_NAME":"' , ans.ANSWER_NAME , '","ORDER":' , ans.orderBy , ',"ISRIGHT":' , ifnull(ans.ISRIGHT,0) , '}')) as
+        select TEST_QUESTION_ID, wm_concat(
+        '{"ANSWER_NAME":"' || ans.ANSWER_NAME || '","ORDER":' || ans.orderBy || ',"ISRIGHT":' || nvl(ans.ISRIGHT, 0) || '}'
+        )
+        as
         answers
         answers
         from test_question_provid_answer ans
         from test_question_provid_answer ans
         group by ans.TEST_QUESTION_ID
         group by ans.TEST_QUESTION_ID
@@ -97,8 +99,10 @@
         inner join TEST_BASE_QUESTION_TYPE tp on ts.BASE_QUESTION_TYPE_ID=tp.BASE_QUESTION_TYPE_ID
         inner join TEST_BASE_QUESTION_TYPE tp on ts.BASE_QUESTION_TYPE_ID=tp.BASE_QUESTION_TYPE_ID
         left join CF_DICTIONARY dc on dc.DICTYPEKEY ='QuestionDifficulty' and ts.difficulty=dc.DICKEY
         left join CF_DICTIONARY dc on dc.DICTYPEKEY ='QuestionDifficulty' and ts.difficulty=dc.DICKEY
         inner join (
         inner join (
-        select TEST_QUESTION_ID, GROUP_CONCAT(
-        concat('{"ANSWER_NAME":"' , ans.ANSWER_NAME , '","ORDER":' , ans.orderBy , ',"ISRIGHT":' , ifnull(ans.ISRIGHT,0) , '}')) as
+        select TEST_QUESTION_ID, wm_concat(
+        '{"ANSWER_NAME":"' || ans.ANSWER_NAME || '","ORDER":' || ans.orderBy || ',"ISRIGHT":' || nvl(ans.ISRIGHT, 0) || '}'
+        )
+        as
         answers
         answers
         from test_question_provid_answer ans
         from test_question_provid_answer ans
         group by ans.TEST_QUESTION_ID
         group by ans.TEST_QUESTION_ID
@@ -132,8 +136,10 @@
           inner join TEST_BASE_QUESTION_TYPE tp on ts.BASE_QUESTION_TYPE_ID=tp.BASE_QUESTION_TYPE_ID
           inner join TEST_BASE_QUESTION_TYPE tp on ts.BASE_QUESTION_TYPE_ID=tp.BASE_QUESTION_TYPE_ID
           left join CF_DICTIONARY dc on dc.DICTYPEKEY ='QuestionDifficulty' and ts.difficulty=dc.DICKEY
           left join CF_DICTIONARY dc on dc.DICTYPEKEY ='QuestionDifficulty' and ts.difficulty=dc.DICKEY
           inner join (
           inner join (
-              select TEST_QUESTION_ID, GROUP_CONCAT(
-                      concat('{"ANSWER_NAME":"' , ans.ANSWER_NAME , '","ORDER":' , ans.orderBy , ',"ISRIGHT":' , ifnull(ans.ISRIGHT,0) , '}')) as answers
+              select TEST_QUESTION_ID, wm_concat(
+                          '{"ANSWER_NAME":"' || ans.ANSWER_NAME || '","ORDER":' || ans.orderBy || ',"ISRIGHT":' || nvl(ans.ISRIGHT, 0) || '}'
+                  )
+                  as answers
               from test_question_provid_answer ans
               from test_question_provid_answer ans
               group by ans.TEST_QUESTION_ID
               group by ans.TEST_QUESTION_ID
            ) qans on ts.TEST_QUESTION_ID=qans.TEST_QUESTION_ID
            ) qans on ts.TEST_QUESTION_ID=qans.TEST_QUESTION_ID
@@ -195,14 +201,18 @@
                 inner join TEST_QUESTION ts on pqset.test_question_Id=ts.test_question_Id
                 inner join TEST_QUESTION ts on pqset.test_question_Id=ts.test_question_Id
                 inner join TEST_BASE_QUESTION_TYPE tp on ts.BASE_QUESTION_TYPE_ID=tp.BASE_QUESTION_TYPE_ID
                 inner join TEST_BASE_QUESTION_TYPE tp on ts.BASE_QUESTION_TYPE_ID=tp.BASE_QUESTION_TYPE_ID
                 inner join (
                 inner join (
-          select TEST_QUESTION_ID, GROUP_CONCAT(
-                  concat('{"PROVID_ANSWER_ID":"',ans.provid_answer_id,'","ANSWER_NAME":"' , ans.ANSWER_NAME , '","ORDER":' , ans.orderBy , ',"ISRIGHT":' , ifnull(ans.ISRIGHT,0) , '}')) as answers
+          select TEST_QUESTION_ID, wm_concat(
+                      '{"PROVID_ANSWER_ID":"' || ans.provid_answer_id || '","ANSWER_NAME":"' || ans.ANSWER_NAME || '","ORDER":' || ans.orderBy || ',"ISRIGHT":' || nvl(ans.ISRIGHT, 0) || '}'
+              )
+              as answers
           from test_question_provid_answer ans
           from test_question_provid_answer ans
           group by ans.TEST_QUESTION_ID
           group by ans.TEST_QUESTION_ID
         ) qans on ts.TEST_QUESTION_ID=qans.TEST_QUESTION_ID
         ) qans on ts.TEST_QUESTION_ID=qans.TEST_QUESTION_ID
         left join (
         left join (
-                                               select TEST_QUESTION_ID, GROUP_CONCAT(
-                                                       concat('{"useranswers":"' , ua.answers , '","ordber_by":' , ua.ordber_by ,  '}')) as useranswers
+                                               select TEST_QUESTION_ID, wm_concat(
+                                                           '{"useranswers":"' || ua.answers || '","ordber_by":' || ua.ordber_by || '}'
+                                                   )
+                                                   as useranswers
                                               from test_entrytest_testinstance ut
                                               from test_entrytest_testinstance ut
                                                  inner join test_entrytest man on ut.entrytestId=man.entrytestId
                                                  inner join test_entrytest man on ut.entrytestId=man.entrytestId
                                                  inner join test_entrytest_answer ua on ut.testinstanceId =ua.testinstanceId
                                                  inner join test_entrytest_answer ua on ut.testinstanceId =ua.testinstanceId

+ 2 - 2
src/main/resources/mapping/ZzAssesTemplateCQuery.xml

@@ -32,9 +32,9 @@
         order by zat.create_time desc
         order by zat.create_time desc
     </select>
     </select>
     <select id="selectYearList" resultMap="BaseResultMap">
     <select id="selectYearList" resultMap="BaseResultMap">
-        select id, `YEAR`
+        select id, "YEAR"
         from zz_asses_template
         from zz_asses_template
-        order by `YEAR`
+        order by "YEAR"
     </select>
     </select>