From 54ad966d0b142c97fc659263b51d1ea5d7b5c7c6 Mon Sep 17 00:00:00 2001
From: huanghongfa <huanghongfa123456>
Date: 星期五, 28 五月 2021 16:17:08 +0800
Subject: [PATCH] 修改bug

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 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 bbb6de0..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
@@ -7,6 +7,7 @@
 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;
@@ -95,7 +96,7 @@
     List<ComMngPopulationVO> listPopulation(ComMngPopulationDTO populationVO);
 
 
-    @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}")
+    @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 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 " +
@@ -144,6 +145,9 @@
             " </if> " +
             "<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 = #{comMngPopulationVO.road} " +
@@ -223,4 +227,11 @@
             "(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