Browse Source

找人接口添加社区ID

feature/screenDataPush
songyunpeng 4 years ago
parent
commit
a78ded2912
  1. 55
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/PopulationInformationDao.xml

55
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/PopulationInformationDao.xml

@ -400,6 +400,9 @@
where t.DEL_FLAG = '0'
and ehr.DEL_FLAG = '0' and ehr.IS_HOUSE_HEAD = '1'
and epi.DEL_FLAG = '0'
<if test="communityId != null and communityId != ''">
and find_in_set(${communityId},t.ALL_DEPT_IDS)
</if>
<if test="houseHeadName!=null and houseHeadName!=''">
and epi.RESIDENTS_NAME like concat('%', #{houseHeadName}, '%')
</if>
@ -415,9 +418,12 @@
where t.DEL_FLAG = '0'
and ehr.DEL_FLAG = '0' and ehr.IS_HOUSE_HEAD = '1'
and epi.DEL_FLAG = '0'
<if test="houseHeadName!=null and houseHeadName!=''">
and epi.RESIDENTS_NAME like concat('%', #{houseHeadName}, '%')
</if>
<if test="communityId != null and communityId != ''">
and find_in_set(${communityId},t.ALL_DEPT_IDS)
</if>
<if test="houseHeadName!=null and houseHeadName!=''">
and epi.RESIDENTS_NAME like concat('%', #{houseHeadName}, '%')
</if>
</select>
<select id="selectPeopleByHouse"
resultType="com.elink.esua.epdc.dto.epdc.result.EpdcScreenPopulationInfoByHouseResultDTO">
@ -434,6 +440,9 @@
where t.DEL_FLAG = '0'
and ehr.DEL_FLAG = '0' and ehr.IS_HOUSE_HEAD = '1'
and ehi.DEL_FLAG = '0'
<if test="communityId != null and communityId != ''">
and find_in_set(${communityId},ehi.ALL_DEPT_IDS)
</if>
<if test="houseAddress!=null and houseAddress!=''">
and HOUSE_ADDRESS like concat('%', #{houseAddress}, '%')
</if>
@ -449,6 +458,9 @@
where t.DEL_FLAG = '0'
and ehr.DEL_FLAG = '0' and ehr.IS_HOUSE_HEAD = '1'
and ehi.DEL_FLAG = '0'
<if test="communityId != null and communityId != ''">
and find_in_set(${communityId},ehi.ALL_DEPT_IDS)
</if>
<if test="houseAddress!=null and houseAddress!=''">
and HOUSE_ADDRESS like concat('%', #{houseAddress}, '%')
</if>
@ -472,6 +484,9 @@
and ehr.IS_HOUSE_HEAD = '0'
and hh.DEL_FLAG = '0'
and hhehr.DEL_FLAG ='0' and ehi.DEL_FLAG = '0'
<if test="communityId != null and communityId != ''">
and find_in_set(${communityId},ehi.ALL_DEPT_IDS)
</if>
<if test="currentAddress!=null and currentAddress!=''">
and t.CURRENT_ADDRESS like concat('%', #{currentAddress}, '%')
</if>
@ -482,18 +497,34 @@
LIMIT #{pageIndex},#{pageSize}
</select>
<select id="selectCountPeopleByCurrentAddress" resultType="java.lang.Integer">
select
count(1)
from epdc_population_information t
left join epdc_house_resident ehr on t.ID = ehr.RESIDENT_ID
where t.DEL_FLAG = '0'
and ehr.DEL_FLAG = '0' and ehr.IS_HOUSE_HEAD = '0'
<if test="currentAddress!=null and currentAddress!=''">
and CURRENT_ADDRESS like concat('%', #{currentAddress}, '%')
</if>
select count(1) from (
select t.ID as populationId,
2 as identityFlag,
t.RESIDENTS_NAME as residentName,
t.CURRENT_ADDRESS as currentAddress,
hh.RESIDENTS_NAME as houseHeadName,
hh.RESIDENTS_PHONE as houseHeadPhone,
GROUP_CONCAT(distinct ehi.HOUSE_ADDRESS) as houseHeadAddress
from epdc_population_information t
left join epdc_house_resident ehr on t.ID = ehr.RESIDENT_ID
left join epdc_population_information hh on hh.ID = ehr.HOUSE_HEAD_ID
left join epdc_house_resident hhehr on hh.ID = hhehr.RESIDENT_ID
left join epdc_housing_information ehi on hhehr.HOUSE_ID = ehi.ID
where t.DEL_FLAG = '0'
and ehr.DEL_FLAG = '0'
and ehr.IS_HOUSE_HEAD = '0'
and hh.DEL_FLAG = '0'
and hhehr.DEL_FLAG ='0' and ehi.DEL_FLAG = '0'
<if test="communityId != null and communityId != ''">
and find_in_set(${communityId},ehi.ALL_DEPT_IDS)
</if>
<if test="currentAddress!=null and currentAddress!=''">
and t.CURRENT_ADDRESS like concat('%', #{currentAddress}, '%')
</if>
<if test="residentName!=null and residentName!=''">
and t.RESIDENTS_NAME like concat('%', #{residentName}, '%')
</if>
group by t.ID)a
</select>
<select id="selectPeopleByCurrentAddressExportList"
resultType="com.elink.esua.epdc.dto.epdc.result.EpdcScreenResidentInfoByCurrentAddressResultDTO">

Loading…
Cancel
Save