From 10df7e29b51d6a2efacc83d870856f57d97a9b66 Mon Sep 17 00:00:00 2001
From: yanghui <2536613402@qq.com>
Date: 星期一, 24 十月 2022 13:48:24 +0800
Subject: [PATCH] #feat 修改别名

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 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 3c86c96..bb44fcd 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
@@ -99,7 +99,7 @@
         + "cmp.special_situation, " + "cmp.phone, " + "cmp.remark, " + "cmp.native_place, " + "cmp.nation,  "
         + "cmpct.label,  " + "cmp.marriage,  " + "cmp.culture_level,  " + "cmp.profession,  " + "cmp.out_or_local,  "
         + "cmp.census_register,  " + "cmp.healthy,  " + "cmp.birthday,  " + "cmp.update_at,  " + "cmp.address,  "
-        + "cmp.is_rent  " + "FROM  " + "com_mng_population AS cmp "
+        + "cmp.is_rent,cmp.death  " + "FROM  " + "com_mng_population AS cmp "
         + " LEFT JOIN com_mng_population_community_tags AS cmpct ON cmp.id = cmpct.population_id  " + "<where>"
         + "<if test='comMngPopulationVO.name != null and comMngPopulationVO.name != &quot;&quot;'>"
         + "AND cmp.`name` LIKE concat(#{comMngPopulationVO.name},'%') " + " </if> "
@@ -134,6 +134,9 @@
         + "<if test='comMngPopulationVO.ageStartTime != null and comMngPopulationVO.ageEndTime != null and comMngPopulationVO.ageStartTime != comMngPopulationVO.ageEndTime'>"
         + "AND cmp.birthday BETWEEN #{comMngPopulationVO.ageEndTimeEnd} and #{comMngPopulationVO.ageStartTime}"
         + " </if> "
+        + "<if test='comMngPopulationVO.searchKey != null and comMngPopulationVO.searchKey != &quot;&quot; '>"
+        + "AND (cmp.name like concat('%',#{comMngPopulationVO.searchKey},'%') or cmp.card_no_str like concat('%',#{comMngPopulationVO.searchKey},'%') or cmp.phone like concat('%',#{comMngPopulationVO.searchKey},'%') "
+        + " </if> "
         + "<if test='comMngPopulationVO.nativePlace != null and comMngPopulationVO.nativePlace != &quot;&quot;'>"
         + "AND cmp.native_place LIKE concat(#{comMngPopulationVO.nativePlace},'%') " + " </if> "
         + "<if test='comMngPopulationVO.nation != null and comMngPopulationVO.nation != &quot;&quot;'>"
@@ -147,6 +150,13 @@
         + "</script>")
     IPage<ComMngPopulationVO> pagePopulation(Page page,
         @Param("comMngPopulationVO") ComMngPopulationDTO comMngPopulationVO);
+
+    /**
+     * 导出老人列表
+     * @param comMngPopulationVO
+     * @return
+     */
+    List<ComMngPopulationVO> exportOld(@Param("comMngPopulationVO") ComMngPopulationDTO comMngPopulationVO);
 
     /**
      * 分页查询特殊群体列表
@@ -424,7 +434,7 @@
     @Select("SELECT " + "(SELECT COUNT(aa.age) FROM "
         + "(SELECT (SELECT  TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population as cmp left join com_mng_population_community_tags as cmpct on cmp.id = cmpct.population_id WHERE cmpct.community_id = ${communityId}) as aa where aa.age<= 18) as age16,"
         + "(SELECT COUNT(aa.age) FROM "
-        + "(SELECT (SELECT  TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population_community_tags as capct left join com_mng_population as cmp on cmp.id = capct.population_id and capct.community_id =  #{communityId}) AS aa WHERE aa.age > 19 and aa.age<= 30) AS age27,"
+        + "(SELECT (SELECT  TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population_community_tags as capct left join com_mng_population as cmp on cmp.id = capct.population_id and capct.community_id =  ${communityId}) AS aa WHERE aa.age > 19 and aa.age<= 30) AS age27,"
         + "(SELECT COUNT(aa.age) FROM "
         + "(SELECT (SELECT  TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population_community_tags as capct left join com_mng_population as cmp on cmp.id = capct.population_id and capct.community_id = ${communityId}) AS aa WHERE aa.age > 31 and aa.age<= 40) AS age35,"
         + "(SELECT COUNT(aa.age) FROM "

--
Gitblit v1.7.1