|
|
@ -29,7 +29,7 @@ |
|
|
|
</resultMap> |
|
|
|
<select id="selectPopulationDistribution" |
|
|
|
resultType="com.elink.esua.epdc.dto.result.SpecialPopulationDistributionResultDTO"> |
|
|
|
select count(ID), |
|
|
|
select count(ID) as total, |
|
|
|
count(if(TIMESTAMPDIFF(YEAR ,SU_BIRTHDAY,curdate())<=20,1,null)) as ageLevel1, |
|
|
|
count(if(TIMESTAMPDIFF(YEAR ,SU_BIRTHDAY,curdate())>=20 and TIMESTAMPDIFF(YEAR ,SU_BIRTHDAY,curdate())<30,1,null)) as ageLevel2, |
|
|
|
count(if(TIMESTAMPDIFF(YEAR ,SU_BIRTHDAY,curdate())>=30 and TIMESTAMPDIFF(YEAR ,SU_BIRTHDAY,curdate())<40,1,null)) as ageLevel3, |
|
|
@ -42,10 +42,10 @@ |
|
|
|
select ID as suId, |
|
|
|
SU_VILLAGE, |
|
|
|
SU_NAME, |
|
|
|
SU_BIRTHDAY, |
|
|
|
TIMESTAMPDIFF(YEAR ,SU_BIRTHDAY,curdate()) as suAge, |
|
|
|
SU_DISABILITY_NUMBER, |
|
|
|
SU_DISABILITY_TYPE, |
|
|
|
SU_IS_LOW, |
|
|
|
if(SU_IS_LOW = '1','是','否') as SU_IS_LOW, |
|
|
|
SU_GUARANTEED_POPULATION, |
|
|
|
SU_RELATIONSHIP, |
|
|
|
SU_LOW_MONEY, |
|
|
@ -54,33 +54,37 @@ |
|
|
|
SU_ELDERLY_SUBSIDY, |
|
|
|
SU_CHILD_SUBSIDY, |
|
|
|
SU_FIVE_GUARANTEES_SUBSIDY, |
|
|
|
SU_IS_POOR |
|
|
|
if(SU_IS_POOR = '1','是','否') as SU_IS_POOR |
|
|
|
from epdc_special_user |
|
|
|
where DEL_FLAG = '0' |
|
|
|
<if test="suName!=null and suName!=''"> |
|
|
|
and SU_NAME like concat('%', #{suName}, '%') |
|
|
|
</if> |
|
|
|
<if test="suDisabilityType!=null and suDisabilityType!=''"> |
|
|
|
and SU_DISABILITY_TYPE = #{suName} |
|
|
|
and SU_DISABILITY_TYPE = #{suDisabilityType} |
|
|
|
</if> |
|
|
|
<if test="suVillage!=null and suVillage!=''"> |
|
|
|
and SU_VILLAGE = #{suVillage} |
|
|
|
</if> |
|
|
|
and SU_IS_LOW = #{suIsLow} |
|
|
|
and SU_IS_POOR #{suIsPoor} |
|
|
|
<if test="suLivingSubsidy!=null and suLivingSubsidy == '1'"> |
|
|
|
<if test="suIsLow == 1"> |
|
|
|
and SU_IS_LOW = '1' |
|
|
|
</if> |
|
|
|
<if test="suIsPoor == 1"> |
|
|
|
and SU_IS_POOR = '1' |
|
|
|
</if> |
|
|
|
<if test="suLivingSubsidy == 1"> |
|
|
|
and SU_LIVING_SUBSIDY > 0 |
|
|
|
</if> |
|
|
|
<if test="suCareSubsidy!=null and suCareSubsidy == '1'"> |
|
|
|
<if test="suCareSubsidy == 1"> |
|
|
|
and SU_CARE_SUBSIDY > 0 |
|
|
|
</if> |
|
|
|
<if test="suElderlySubsidy!=null and suElderlySubsidy == '1'"> |
|
|
|
<if test="suElderlySubsidy == 1"> |
|
|
|
and SU_ELDERLY_SUBSIDY > 0 |
|
|
|
</if> |
|
|
|
<if test="suChildSubsidy!=null and suChildSubsidy == '1'"> |
|
|
|
<if test="suChildSubsidy == 1"> |
|
|
|
and SU_CHILD_SUBSIDY > 0 |
|
|
|
</if> |
|
|
|
<if test="suFiveGuaranteesSubsidy!=null and suFiveGuaranteesSubsidy == '1'"> |
|
|
|
<if test="suFiveGuaranteesSubsidy == 1"> |
|
|
|
and SU_FIVE_GUARANTEES_SUBSIDY > 0 |
|
|
|
</if> |
|
|
|
order by CREATED_TIME desc |
|
|
@ -99,21 +103,25 @@ |
|
|
|
<if test="suVillage!=null and suVillage!=''"> |
|
|
|
and SU_VILLAGE = #{suVillage} |
|
|
|
</if> |
|
|
|
and SU_IS_LOW = #{suIsLow} |
|
|
|
and SU_IS_POOR #{suIsPoor} |
|
|
|
<if test="suLivingSubsidy!=null and suLivingSubsidy == '1'"> |
|
|
|
<if test="suIsLow == 1"> |
|
|
|
and SU_IS_LOW = '1' |
|
|
|
</if> |
|
|
|
<if test="suIsPoor == 1"> |
|
|
|
and SU_IS_POOR = '1' |
|
|
|
</if> |
|
|
|
<if test="suLivingSubsidy == 1"> |
|
|
|
and SU_LIVING_SUBSIDY > 0 |
|
|
|
</if> |
|
|
|
<if test="suCareSubsidy!=null and suCareSubsidy == '1'"> |
|
|
|
<if test="suCareSubsidy == 1"> |
|
|
|
and SU_CARE_SUBSIDY > 0 |
|
|
|
</if> |
|
|
|
<if test="suElderlySubsidy!=null and suElderlySubsidy == '1'"> |
|
|
|
<if test="suElderlySubsidy == 1"> |
|
|
|
and SU_ELDERLY_SUBSIDY > 0 |
|
|
|
</if> |
|
|
|
<if test="suChildSubsidy!=null and suChildSubsidy == '1'"> |
|
|
|
<if test="suChildSubsidy == 1"> |
|
|
|
and SU_CHILD_SUBSIDY > 0 |
|
|
|
</if> |
|
|
|
<if test="suFiveGuaranteesSubsidy!=null and suFiveGuaranteesSubsidy == '1'"> |
|
|
|
<if test="suFiveGuaranteesSubsidy == 1"> |
|
|
|
and SU_FIVE_GUARANTEES_SUBSIDY > 0 |
|
|
|
</if> |
|
|
|
order by CREATED_TIME desc |
|
|
|