From b24f9c75c79e4de248505295bfea7055e4975ff4 Mon Sep 17 00:00:00 2001
From: 罗元桥 <2376770955@qq.com>
Date: 星期二, 25 五月 2021 14:23:04 +0800
Subject: [PATCH] Merge branch 'lyq' into 'test'

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java |   38 +++++++++++++++++++++++++++++++++++---
 1 files changed, 35 insertions(+), 3 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 f98dd5d..69a4333 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
@@ -5,7 +5,9 @@
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.panzhihua.common.model.dtos.community.ComMngPopulationDTO;
 import com.panzhihua.common.model.dtos.user.PageInputUserDTO;
+import com.panzhihua.common.model.vos.area.AreaAddressVO;
 import com.panzhihua.common.model.vos.community.ComActMessageVO;
+import com.panzhihua.common.model.vos.community.ComMngPopulationTotalVO;
 import com.panzhihua.common.model.vos.community.ComMngPopulationVO;
 import com.panzhihua.common.model.vos.community.PageComActMessageVO;
 import com.panzhihua.common.model.vos.user.ComHouseMemberVo;
@@ -97,8 +99,10 @@
     @Select("select id,user_id,relationship,`name`,id_card,phone,age,health,job,create_at,update_at,card_photo_front,card_photo_back,family_book from com_mng_family_info where user_id=#{userId} order by create_at desc ")
     List<ComMngFamilyInfoVO> listFamilyByUserId(Long userId);
 
-    @Select("select id,`name`,phone,relation from com_mng_population where road = #{comMngPopulationDO.road} and door_no = #{comMngPopulationDO.doorNo} and floor = #{comMngPopulationDO.floor} and unit_no = #{comMngPopulationDO.unitNo} and house_no = #{comMngPopulationDO.houseNo} and id != #{comMngPopulationDO.id}")
-    List<ComHouseMemberVo> listHouseMermberByUserId(@Param("comMngPopulationDO") ComMngPopulationDO comMngPopulationDO);
+    @Select("select cmphu.popul_id,cmp.name,cmp.relation,cmp.age,cmp.phone,cmp.healthy,cmp.card_no,cmp.work_company from com_mng_population_house_user cmphu " +
+            " left join com_mng_population cmp on cmp.id = cmphu.popul_id " +
+            " where cmphu.house_id = #{houseId} and cmphu.popul_id != #{populId}")
+    List<ComHouseMemberVo> listHouseMermberByUserId(@Param("houseId") Long houseId, @Param("populId") Long populId);
 
     @Select("<script> " +
             "SELECT\n" +
@@ -130,6 +134,7 @@
             "cmp.out_or_local, \n" +
             "cmp.census_register, \n" +
             "cmp.healthy, \n" +
+            "cmp.birthday, \n" +
             "cmp.is_rent \n" +
             "FROM \n" +
             "com_mng_population AS cmp " +
@@ -141,11 +146,23 @@
             "<if test='comMngPopulationVO.actId != null'>" +
             " and cmp.act_id = #{comMngPopulationVO.actId} " +
             " </if> " +
+            "<if test='comMngPopulationVO.villageId != null'>" +
+            " and cmp.village_id = #{comMngPopulationVO.villageId} " +
+            " </if> " +
             "<if test='comMngPopulationVO.road != null and comMngPopulationVO.road != &quot;&quot;'>" +
-            "AND cmp.road LIKE concat(#{comMngPopulationVO.road},'%') " +
+            "AND cmp.road = #{comMngPopulationVO.road} " +
             " </if> " +
             "<if test='comMngPopulationVO.doorNo != null and comMngPopulationVO.doorNo != &quot;&quot;'>" +
             "AND cmp.door_no = #{comMngPopulationVO.doorNo} " +
+            " </if> " +
+            "<if test='comMngPopulationVO.floor != null and comMngPopulationVO.floor != &quot;&quot;'>" +
+            "AND cmp.floor = #{comMngPopulationVO.floor} " +
+            " </if> " +
+            "<if test='comMngPopulationVO.unitNo != null and comMngPopulationVO.unitNo != &quot;&quot;'>" +
+            "AND cmp.unit_no = #{comMngPopulationVO.unitNo} " +
+            " </if> " +
+            "<if test='comMngPopulationVO.houseNo != null and comMngPopulationVO.houseNo != &quot;&quot;'>" +
+            "AND cmp.house_no = #{comMngPopulationVO.houseNo} " +
             " </if> " +
             "<if test='comMngPopulationVO.alley != null and comMngPopulationVO.alley != &quot;&quot;'>" +
             "AND cmv.alley LIKE concat(#{comMngPopulationVO.alley},'%') " +
@@ -175,6 +192,7 @@
             "AND cmp.remark = #{comMngPopulationVO.remark} " +
             " </if> " +
             " </where>" +
+            " order by cmp.create_at desc" +
             "</script>")
     IPage<ComMngPopulationVO> pagePopulation(Page page, @Param("comMngPopulationVO") ComMngPopulationDTO comMngPopulationVO);
 
@@ -202,4 +220,18 @@
 
     @Select("update sys_user set card_photo_front=#{vo.cardPhotoFront},card_photo_back=#{vo.cardPhotoBack},family_book=#{vo.familyBook} where user_id=#{vo.userId}")
     void updateSysUserElectronicFile(@Param("vo") UserElectronicFileVO vo);
+
+    @Select("<script> " +
+            "select (select province_name from com_mng_struct_area_province where province_adcode = #{provinceCode}) as province," +
+            "(select city_name from com_mng_struct_area_city where city_adcode = #{cityCode}) as city," +
+            "(select district_name from com_mng_struct_area_district where district_adcode = #{districtCode}) as district" +
+            "</script>")
+    AreaAddressVO getAreaAddress(@Param("provinceCode") String provinceCode,@Param("cityCode") String cityCode,@Param("districtCode") String districtCode);
+
+    @Select("select count(id) as populationTotal " +
+            ",(select count(id) from com_mng_population where act_id = #{communityId} and out_or_local = 1) as localTotal " +
+            ",(select count(id) from com_mng_population where act_id = #{communityId} and out_or_local = 2) as outTotal " +
+            ",(select count(id) from com_mng_population where act_id = #{communityId} and label is null) as specialTotal " +
+            " from com_mng_population as cmp where act_id = #{communityId}")
+    ComMngPopulationTotalVO getPopulationTotalByAdmin(@Param("communityId") Long communityId);
 }

--
Gitblit v1.7.1