From 6f05a3669979af08422a2f6fd6df93e3e39774d7 Mon Sep 17 00:00:00 2001
From: huanghongfa <huanghongfa123456>
Date: 星期日, 26 九月 2021 19:31:50 +0800
Subject: [PATCH] 修改bug

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java |   21 ++++++---------------
 1 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java
index 22b0360..a43c4f2 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java
@@ -156,9 +156,9 @@
     IPage<InputUserInfoVO> specialInputUser(Page page, @Param("pageInputUserDTO") PageInputUserDTO pageInputUserDTO);
 
     @Select("<script> "
-        + "select id,tag_name,community_id,create_at,sys_flag from com_mng_user_tag where community_id = #{comMngUserTagDTO.communityId}"
+        + "select id,tag_name,community_id,create_at,sys_flag from com_mng_user_tag <where> "
         + "<if test='comMngUserTagDTO.tagName != null and comMngUserTagDTO.tagName != &quot;&quot;'>"
-        + " AND tag_name LIKE concat(#{comMngUserTagDTO.tagName},'%') " + " </if> " + " order by create_at desc "
+        + " AND tag_name LIKE concat(#{comMngUserTagDTO.tagName},'%') " + " </if> " + "</where>" + " order by create_at desc "
         + "</script>")
     IPage<ComMngTagVO> specialInputUserTags(Page page, @Param("comMngUserTagDTO") PageInputUserDTO comMngUserTagDTO);
 
@@ -182,7 +182,7 @@
     @Select("select count(id) as populationTotal "
         + ",(select count(cmpct.id) from com_mng_population_community_tags cmpct left join com_mng_population cmp on cmpct.population_id = cmp.id where cmpct.community_id = #{communityId} and cmp.out_or_local = 1) as localTotal "
         + ",(select count(cmpct.id) from com_mng_population_community_tags cmpct left join com_mng_population cmp on cmpct.population_id = cmp.id where cmpct.community_id = #{communityId} and cmp.out_or_local = 2) as outTotal "
-        + ",(select count(cmpct.id) from com_mng_population_community_tags cmpct left join com_mng_population cmp on cmpct.population_id = cmp.id where cmpct.community_id = #{communityId} and cmpct.label is not null) as specialTotal "
+        + ",(select count(cmpct.id) from com_mng_population_community_tags cmpct left join com_mng_population cmp on cmpct.population_id = cmp.id where cmpct.community_id = #{communityId} and IFNULL(cmpct.label,'') != '') as specialTotal "
         + ",(select count(village_id) from com_mng_village where community_id = #{communityId}) as villageTotal "
         + ",(select count(id) from com_mng_population_community_tags where community_id = #{communityId} and label LIKE CONCAT('%','吸毒人员','%')) as drugTotal "
         + ",(select count(id) from com_mng_population_community_tags where community_id = #{communityId} and label LIKE CONCAT('%','社区矫正','%')) as correctTotal "
@@ -548,15 +548,6 @@
     @Select("select count(id) from com_elders_auth_elderly WHERE community_id = #{communityId}")
     Integer getStatisticsCount(@Param("communityId") Long communityId);
 
-    @Select("<script> "
-        + "select cmp.id,cmp.`name`,cmp.phone,cmp.card_no,cmpct.label,cmp.address,cmp.nation,cmp.political_outlook,cmv.lng,cmv.lat"
-        + ",cmp.sex from com_mng_population as cmp left join com_mng_village as cmv on cmv.village_id = cmp.village_id "
-        + " left join com_mng_population_community_tags as cmpct on cmp.id = cmpct.population_id  "
-        + " where cmpct.community_id = #{populationListDTO.communityId}"
-        + "<if test='populationListDTO.keyWord != null and populationListDTO.keyWord != &quot;&quot;'>"
-        + "AND (cmp.`name` like concat (#{populationListDTO.keyWord},'%') or cmp.card_no_str like concat (#{populationListDTO.keyWord},'%'))  "
-        + " </if> " + "<if test='populationListDTO.label != null and populationListDTO.label != &quot;&quot;'>"
-        + "AND cmpct.label like concat ('%',#{populationListDTO.label},'%') " + " </if> " + " </script>")
     IPage<PopulationListVO> pagePopulationListApp(Page page,
         @Param("populationListDTO") PagePopulationListDTO populationListDTO);
 
@@ -567,7 +558,7 @@
         + " cmp.census_register, " + " cmp.out_or_local, " + " cmp.remark, " + " cmp.marriage " + "FROM "
         + " com_mng_population AS cmp " + " LEFT JOIN com_mng_village AS cmv ON cmv.village_id = cmp.village_id  "
         + " left join com_mng_population_community_tags as cmpct on cmp.id = cmpct.population_id  " + "WHERE "
-        + " id = #{populationId}")
+        + " cmp.id = #{populationId}")
     PopulationDetailVO getPopulationDetailApp(@Param("populationId") Long populationId);
 
     @Select("<script> " + " SELECT " + " cmp.id, " + "  cmp.`name` AS userName, "
@@ -615,7 +606,7 @@
         @Param("populationDTO") PageComMngPopulationDTO populationDTO);
 
     @Select("<script> " + "SELECT " + " count( id ) AS localNum, "
-        + " ( SELECT count( cmpct.id ) FROM com_mng_population as cmp WHERE cmp.out_or_local = 2 "
+        + " ( SELECT count( cmp.id ) FROM com_mng_population as cmp WHERE cmp.out_or_local = 2 "
         +  " ) AS flowNum, "
         + " ( SELECT count( cmpct.id ) FROM com_mng_population as cmp left join com_mng_population_community_tags AS cmpct on cmp.id = cmpct.population_id WHERE cmpct.label IS NOT NULL "
         + " ) AS specialNum  " + "FROM "
@@ -651,7 +642,7 @@
         getGridPopulationAdminLists(@Param("populationExportDTO") ComMngPopulationExportDTO populationExportDTO);
 
     @Select("<script> "
-        + " select cmp.id,cmp.`name`,cmp.card_no,cmtct.label from com_mng_population as cmp left join com_mng_population_community_tags AS cmpct on cmp.id = cmpct.population_id where 1=1 "
+        + " select cmp.id,cmp.`name`,cmp.card_no,cmpct.label from com_mng_population as cmp left join com_mng_population_community_tags AS cmpct on cmp.id = cmpct.population_id where 1=1 "
         + "<if test='villagePopulationDTO.villageId != null'>"
         + " and cmp.village_id = #{villagePopulationDTO.villageId} " + " </if> "
         + "<if test='villagePopulationDTO.keyWord != null'>"

--
Gitblit v1.7.1