|
|
|
@ -188,9 +188,11 @@ |
|
|
|
<select id="getUserStatistics" resultType="com.elink.esua.epdc.dto.user.result.UserAnalysisCountDTO" |
|
|
|
parameterType="com.elink.esua.epdc.dto.user.form.UserCountDTO"> |
|
|
|
SELECT |
|
|
|
t.userCount, |
|
|
|
t.userCount as allUserCount, |
|
|
|
t.partyMemberCount, |
|
|
|
t.residentCount - t.partyMemberCount allUserCount |
|
|
|
t.residentCount userCount, |
|
|
|
round(t.partyMemberCount/t.userCount,2) as partyMemberPercent, |
|
|
|
round(t.residentCount/t.userCount,2) as residentPercent |
|
|
|
FROM |
|
|
|
( |
|
|
|
SELECT |
|
|
|
@ -202,18 +204,16 @@ |
|
|
|
LEFT JOIN esua_epdc_admin.sys_dept ad ON u.DEPT_ID = ad.ID |
|
|
|
AND ad.type_key = 'grid_party' |
|
|
|
LEFT JOIN esua_epdc_admin.sys_dept ad1 ON ad.pid = ad1.id |
|
|
|
LEFT JOIN esua_epdc_admin.sys_dept ad2 ON ad1.pid = ad2.id |
|
|
|
WHERE |
|
|
|
u.DEL_FLAG = '0' |
|
|
|
AND ad.id IS NOT NULL |
|
|
|
<if test="deptIdList != null and deptIdList.size() > 0"> |
|
|
|
and ad2.ID in |
|
|
|
and ad.ID in |
|
|
|
<foreach item="deptIdItem" collection="deptIdList" open="(" separator="," close=")"> |
|
|
|
#{deptIdItem} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
<if test='formDto.deptId != null and formDto.deptId != ""'> |
|
|
|
AND ad2.id = #{formDto.deptId} |
|
|
|
AND ( ad1.id = #{formDto.deptId} or ad.id = #{formDto.deptId}) |
|
|
|
</if> |
|
|
|
|
|
|
|
)t |
|
|
|
@ -239,7 +239,7 @@ |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test='formDto.deptId != null and formDto.deptId != ""'> |
|
|
|
AND ad2.id = #{formDto.deptId} |
|
|
|
AND (ad.id = #{formDto.deptId} or ad1.id = #{formDto.deptId} or ad2.id = #{formDto.deptId}) |
|
|
|
</if> |
|
|
|
ORDER BY |
|
|
|
ad.create_date ASC |
|
|
|
|