|
@ -1611,9 +1611,9 @@ |
|
|
<!-- 烟台居民画像:按照学历分组,查询居民数量--> |
|
|
<!-- 烟台居民画像:按照学历分组,查询居民数量--> |
|
|
<select id="queryEducationDistribute" parameterType="map" resultType="com.epmet.dto.result.resi.ResiPortrayalResultDTO"> |
|
|
<select id="queryEducationDistribute" parameterType="map" resultType="com.epmet.dto.result.resi.ResiPortrayalResultDTO"> |
|
|
SELECT |
|
|
SELECT |
|
|
r.CULTURE AS `code`, |
|
|
CULTURE AS `code`, |
|
|
count( r.id ) AS totalResi |
|
|
count( id ) AS totalResi |
|
|
FROM |
|
|
FROM (SELECT ID, IF(CULTURE = '', NULL, CULTURE) AS CULTURE FROM |
|
|
ic_resi_user r |
|
|
ic_resi_user r |
|
|
WHERE |
|
|
WHERE |
|
|
r.DEL_FLAG = '0' |
|
|
r.DEL_FLAG = '0' |
|
@ -1627,8 +1627,9 @@ |
|
|
AND r.`STATUS` = '0' |
|
|
AND r.`STATUS` = '0' |
|
|
-- AND r.CULTURE IS NOT NULL |
|
|
-- AND r.CULTURE IS NOT NULL |
|
|
-- AND r.CULTURE != '' |
|
|
-- AND r.CULTURE != '' |
|
|
|
|
|
) iru |
|
|
GROUP BY |
|
|
GROUP BY |
|
|
r.CULTURE |
|
|
iru.CULTURE |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<!-- 烟台居民画像:年龄分布 --> |
|
|
<!-- 烟台居民画像:年龄分布 --> |
|
@ -1645,20 +1646,21 @@ |
|
|
when temp1.age >= 60 and temp1.age <= 69 then '2' |
|
|
when temp1.age >= 60 and temp1.age <= 69 then '2' |
|
|
when temp1.age >= 70 and temp1.age <= 79 then '3' |
|
|
when temp1.age >= 70 and temp1.age <= 79 then '3' |
|
|
when temp1.age >= 80 then '4' |
|
|
when temp1.age >= 80 then '4' |
|
|
|
|
|
-- when temp1.age is NULL then '5' |
|
|
end |
|
|
end |
|
|
) as `code` |
|
|
) as `code` |
|
|
from ( |
|
|
from ( |
|
|
SELECT |
|
|
SELECT |
|
|
u.ID, |
|
|
u.ID, |
|
|
YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) as age |
|
|
IF((u.BIRTHDAY IS NULL OR u.BIRTHDAY =''),NULL,YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4)) as age |
|
|
FROM |
|
|
FROM |
|
|
ic_resi_user u |
|
|
ic_resi_user u |
|
|
WHERE |
|
|
WHERE |
|
|
u.DEL_FLAG = '0' |
|
|
u.DEL_FLAG = '0' |
|
|
AND u.CUSTOMER_ID = #{customerId} |
|
|
AND u.CUSTOMER_ID = #{customerId} |
|
|
and u.`STATUS`='0' |
|
|
and u.`STATUS`='0' |
|
|
and u.BIRTHDAY is not null |
|
|
-- and u.BIRTHDAY is not null |
|
|
and u.BIRTHDAY !='' |
|
|
-- and u.BIRTHDAY !='' |
|
|
<if test='orgType == "agency" '> |
|
|
<if test='orgType == "agency" '> |
|
|
and u.PIDS LIKE concat(#{orgIdPath},'%') |
|
|
and u.PIDS LIKE concat(#{orgIdPath},'%') |
|
|
</if> |
|
|
</if> |
|
|