|
|
@ -175,6 +175,50 @@ |
|
|
|
from epdc_population_information where DEL_FLAG = 0 and RESIDENTS_IDENTITY_NO is not null and RESIDENTS_IDENTITY_NO != '')a on 1=1 |
|
|
|
where t.DEL_FLAG ='0'; |
|
|
|
</select> |
|
|
|
<select id="getPopulationInfoOverviewForScreen" resultType="com.elink.esua.epdc.dto.PopulationInfoOverviewDTO"> |
|
|
|
select |
|
|
|
count(t.HOUSE_USE = '0' or null) as sinceTheLiving, |
|
|
|
count(t.HOUSE_USE = '1' or null) as rent, |
|
|
|
count(t.HOUSE_USE = '2' or null) as business, |
|
|
|
count(t.ID) as houseNum, |
|
|
|
employment,unemployment,populationNum,motorVehicleNum,partyMemberNum |
|
|
|
from epdc_housing_information t |
|
|
|
left join( |
|
|
|
select count(EMPLOYMENT_STATUS = '0' or null) as employment, |
|
|
|
count(EMPLOYMENT_STATUS = '1' or null) as unemployment, |
|
|
|
(select count(a.ID) |
|
|
|
+ |
|
|
|
(select a.residentNum |
|
|
|
from ( |
|
|
|
SELECT hi.PARENT_DEPT_IDS, |
|
|
|
SUM(t2.num1) as residentNum |
|
|
|
FROM `epdc_housing_information` hi |
|
|
|
LEFT JOIN( |
|
|
|
SELECT hr1.`HOUSE_ID`, SUM(t.num) as num1 |
|
|
|
FROM `epdc_house_resident` hr1 |
|
|
|
LEFT JOIN( |
|
|
|
SELECT hr.`HOUSE_HEAD_ID`, COUNT(hr.`ID`) AS num |
|
|
|
FROM `epdc_house_resident` hr |
|
|
|
WHERE hr.`DEL_FLAG` = '0' |
|
|
|
AND `IS_HOUSE_HEAD` = '0' |
|
|
|
GROUP BY hr.`HOUSE_HEAD_ID` |
|
|
|
ORDER BY COUNT(hr.`ID`) DESC) t on t.HOUSE_HEAD_ID = hr1.`RESIDENT_ID` |
|
|
|
WHERE hr1.`DEL_FLAG` = '0' |
|
|
|
AND hr1.`IS_HOUSE_HEAD` = '1' |
|
|
|
GROUP BY hr1.`HOUSE_ID`) t2 on t2.HOUSE_ID = hi.`ID` |
|
|
|
AND hi.`DEL_FLAG` = '0' |
|
|
|
GROUP BY hi.`PARENT_DEPT_NAMES`) a |
|
|
|
where find_in_set(#{communityId}, a.PARENT_DEPT_IDS))) as populationNum, |
|
|
|
sum(MOTOR_VEHICLE_NUM) as motorVehicleNum, |
|
|
|
count(POLITICS_STATUS = '1' or null) as partyMemberNum |
|
|
|
from epdc_population_information a |
|
|
|
left join epdc_house_resident b on a.ID = b.RESIDENT_ID and b.DEL_FLAG = '0' |
|
|
|
left join epdc_housing_information c on c.ID = b.HOUSE_ID |
|
|
|
where a.DEL_FLAG = 0 |
|
|
|
and b.IS_HOUSE_HEAD = 1 |
|
|
|
and find_in_set(#{communityId}, c.PARENT_DEPT_IDS))a on 1=1 |
|
|
|
where t.DEL_FLAG ='0' and find_in_set(#{communityId}, t.PARENT_DEPT_IDS); |
|
|
|
</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,data.identity as identityName from ( |
|
|
|