huanghongfa
2021-09-26 d5efac4fdd317dee66be48393f96a19e43f48335
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java
@@ -179,7 +179,7 @@
    AreaAddressVO getAreaAddress(@Param("provinceCode") String provinceCode, @Param("cityCode") String cityCode,
        @Param("districtCode") String districtCode);
    @Select("select count(id) as populationTotal "
    @Select("select count(cmpct.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 IFNULL(cmpct.label,'') != '') as specialTotal "
@@ -193,7 +193,7 @@
        + ",(select count(id) from com_mng_population_community_tags where community_id = #{communityId} and label LIKE CONCAT('%','退役军人','%')) as veteransTotal "
        + ",(select count(id) from com_mng_population_community_tags where community_id = #{communityId} and label LIKE CONCAT('%','残疾人','%')) as disabilityTotal "
        + ",(select count(id) from com_mng_population_community_tags where community_id = #{communityId} and label LIKE CONCAT('%','低保户','%')) as lowSecurityTotal "
        + " from com_mng_population_community_tags as cmpct where community_id = #{communityId}")
        + " from com_mng_population_community_tags as cmpct inner join com_mng_population as cmp on cmp.id = cmpct.population_id where community_id = #{communityId}")
    ComMngPopulationTotalVO getPopulationTotalByAdmin(@Param("communityId") Long communityId);
    @Select("select count(id) as populationTotal," +
@@ -592,6 +592,12 @@
        + "</foreach>" + " </script>")
    Integer getPopulationVisitingCount(@Param("ids") List<Long> ids);
    /**
     * 综治后台删除居民,并清理人口与社区绑定关系
     * @param ids   需要删除的人口id集合
     */
    void deletePopulaitonRelation(@Param("ids") List<Long> ids);
    @Select("<script> " + "SELECT " + "   cmp.id, " + "   cmp.`name`, " + "   cmp.card_no as idCard, "
        + "   cmpct.label, " + "   cmp.sex, " + "   IFNULL( cmp.phone, '暂无' ) as phone, " + "   cmp.address, "
        + "   cmp.political_outlook " + "  FROM "