| | |
| | | + "AND cmp.unit_no = #{comMngPopulationVO.unitNo} " + " </if> " |
| | | + "<if test='comMngPopulationVO.houseNo != null and comMngPopulationVO.houseNo != ""'>" |
| | | + "AND cmp.house_no = #{comMngPopulationVO.houseNo} " + " </if> " |
| | | + "<if test='comMngPopulationVO.isDeath != null'>" |
| | | + "AND cmp.death = #{comMngPopulationVO.isDeath} " + " </if> " |
| | | + "<if test='comMngPopulationVO.sex != null and comMngPopulationVO.sex != ""'>" |
| | | + "AND cmp.sex = #{comMngPopulationVO.sex} " + " </if> " |
| | | + "<if test='comMngPopulationVO.ageStartTime != null and comMngPopulationVO.ageStartTime != "" and comMngPopulationVO.ageEndTime == null'>" |
| | |
| | | + ",(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(DISTINCT `name`) from com_mng_village where community_id = #{communityId}) as villageTotal " |
| | | + ",(select count(id) from com_mng_building where act_id = #{communityId}) as buildNum " |
| | | + ",(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 " |
| | | + ",(select count(id) from com_mng_population_community_tags where community_id = #{communityId} and label LIKE CONCAT('%','精神障碍患者','%')) as majorTotal " |