|
|
|
@ -177,31 +177,7 @@ |
|
|
|
</select> |
|
|
|
<select id="selectListPeople" |
|
|
|
resultType="com.elink.esua.epdc.dto.epdc.result.EpdcScreenSelectPeopleResultDTO"> |
|
|
|
select data.name,data.gridName,data.identityFlag,data.houseId,data.populationId,data.identity,data.CREATED_TIME from ( |
|
|
|
select |
|
|
|
t.PROPERTY_OWNER as name, |
|
|
|
substring_index(t.ALL_DEPT_NAMES,'-',-1) as gridName, |
|
|
|
0 as identityFlag, |
|
|
|
'产权人' as identity, |
|
|
|
t.ID as houseId, |
|
|
|
'' as populationId, |
|
|
|
t.CREATED_TIME |
|
|
|
from |
|
|
|
epdc_housing_information t |
|
|
|
where t.DEL_FLAG ='0' |
|
|
|
<if test="name != null and name != ''"> |
|
|
|
and t.PROPERTY_OWNER like concat('%', #{name}, '%') |
|
|
|
</if> |
|
|
|
<if test="phone != null and phone != ''"> |
|
|
|
and t.PROPERTY_OWNER_MOBILE like concat('%', #{phone}, '%') |
|
|
|
</if> |
|
|
|
<if test="communityId != null and communityId != ''"> |
|
|
|
and find_in_set(#{communityId},t.ALL_DEPT_IDS) |
|
|
|
</if> |
|
|
|
<if test="gridId != null and gridId != ''"> |
|
|
|
and find_in_set(#{gridId},t.ALL_DEPT_IDS) |
|
|
|
</if> |
|
|
|
union all |
|
|
|
select data.name,data.gridName,data.identityFlag,data.houseId,data.populationId,data.identity,data.CREATED_TIME,data.identity as identityName from ( |
|
|
|
select |
|
|
|
t.RESIDENTS_NAME as name, |
|
|
|
group_concat(DISTINCT substring_index(t2.ALL_DEPT_NAMES,'-',-1)) as gridName, |
|
|
|
@ -280,16 +256,16 @@ |
|
|
|
<select id="selectListGridRanking" |
|
|
|
resultType="com.elink.esua.epdc.dto.epdc.result.EpdcScreenGridRankingResultDTO"> |
|
|
|
<if test="rankCategory!=null and rankCategory == 0"> |
|
|
|
select houseHead.houseHeadNum+resident.residentNum as total,houseHead.gridName from( |
|
|
|
select ifnull(houseHead.houseHeadNum,0)+IFNULL(resident.residentNum,0) as total,houseHead.gridName from( |
|
|
|
select count(1) as houseHeadNum,GRID_ID,gridName from( |
|
|
|
select t2.GRID_ID,substring_index(t2.ALL_DEPT_NAMES,'-',-1) as gridName |
|
|
|
from epdc_population_information t |
|
|
|
left join epdc_house_resident t1 on t1.RESIDENT_ID = t.ID |
|
|
|
left join epdc_housing_information t2 on t2.ID = t1.HOUSE_ID |
|
|
|
where t.DEL_FLAG = '0' |
|
|
|
and t1.DEL_FLAG = '0' and t2.DEL_FLAG='0' |
|
|
|
and t1.IS_HOUSE_HEAD ='1' |
|
|
|
group by t2.GRID_ID,t.ID)end |
|
|
|
from epdc_population_information t |
|
|
|
left join epdc_house_resident t1 on t1.RESIDENT_ID = t.ID |
|
|
|
left join epdc_housing_information t2 on t2.ID = t1.HOUSE_ID |
|
|
|
where t.DEL_FLAG = '0' |
|
|
|
and t1.DEL_FLAG = '0' and t2.DEL_FLAG='0' |
|
|
|
and t1.IS_HOUSE_HEAD ='1' |
|
|
|
group by t2.GRID_ID,t.ID)end |
|
|
|
group by end.GRID_ID)houseHead |
|
|
|
left join |
|
|
|
(select count(1) as residentNum,GRID_ID,gridName from( |
|
|
|
|