|
|
@ -72,38 +72,46 @@ |
|
|
|
<select id="selectSubAgencyOrGridIndexMonthlyRank" parameterType="com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankYMFormDTO" |
|
|
|
resultType="com.epmet.evaluationindex.screen.dto.result.AnNingSubAgencyIndexRankResultDTO"> |
|
|
|
SELECT |
|
|
|
org_name AS `NAME`, |
|
|
|
service_ablity * SERVICE_ABLITY_WEIGHT AS serviceAbility, |
|
|
|
party_dev_ablity * PARTY_DEV_WEIGHT AS partyDevAbility, |
|
|
|
govern_ablity * GOVERN_ABLITY_WEIGHT AS governAbility, |
|
|
|
PARTY_DEV_WEIGHT AS partyWeight, |
|
|
|
GOVERN_ABLITY_WEIGHT AS governWeight, |
|
|
|
SERVICE_ABLITY_WEIGHT AS serviceWeight, |
|
|
|
ORG_ID orgId, |
|
|
|
ORG_TYPE orgType |
|
|
|
score.org_name AS `NAME`, |
|
|
|
score.service_ablity * score.SERVICE_ABLITY_WEIGHT AS serviceAbility, |
|
|
|
score.party_dev_ablity * score.PARTY_DEV_WEIGHT AS partyDevAbility, |
|
|
|
score.govern_ablity * score.GOVERN_ABLITY_WEIGHT AS governAbility, |
|
|
|
score.PARTY_DEV_WEIGHT AS partyWeight, |
|
|
|
score.GOVERN_ABLITY_WEIGHT AS governWeight, |
|
|
|
score.SERVICE_ABLITY_WEIGHT AS serviceWeight, |
|
|
|
score.ORG_ID orgId, |
|
|
|
score.ORG_TYPE orgType |
|
|
|
FROM |
|
|
|
screen_index_data_monthly |
|
|
|
screen_index_data_monthly score |
|
|
|
<if test="orgType != null and orgType != ''"> |
|
|
|
<choose> |
|
|
|
<when test="orgType == 'grid'"> |
|
|
|
INNER JOIN screen_customer_grid org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.GRID_ID = score.ORG_ID AND org.DEL_FLAG = '0' |
|
|
|
</when> |
|
|
|
<when test="orgType == 'agency'"> |
|
|
|
INNER JOIN screen_customer_agency org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.GRID_ID = score.ORG_ID AND org.DEL_FLAG = '0' |
|
|
|
</when> |
|
|
|
<when test="orgType == 'department'"> |
|
|
|
INNER JOIN screen_customer_dept org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.GRID_ID = score.ORG_ID AND org.DEL_FLAG = '0' |
|
|
|
</when> |
|
|
|
</choose> |
|
|
|
</if> |
|
|
|
WHERE |
|
|
|
del_flag = '0' |
|
|
|
AND parent_id = #{agencyId} |
|
|
|
AND month_id = #{monthId,jdbcType=VARCHAR} |
|
|
|
score.del_flag = '0' |
|
|
|
AND score.parent_id = #{agencyId} |
|
|
|
AND score.month_id = #{monthId,jdbcType=VARCHAR} |
|
|
|
<if test="customerId != null and customerId != ''"> |
|
|
|
AND CUSTOMER_ID = #{customerId} |
|
|
|
AND score.CUSTOMER_ID = #{customerId} |
|
|
|
</if> |
|
|
|
<choose> |
|
|
|
<when test="orgType != null and orgType != ''"> |
|
|
|
AND ORG_TYPE = #{orgType,jdbcType=VARCHAR} |
|
|
|
AND score.ORG_TYPE = #{orgType,jdbcType=VARCHAR} |
|
|
|
</when> |
|
|
|
<otherwise> |
|
|
|
AND ORG_TYPE != 'department' |
|
|
|
AND score.ORG_TYPE != 'department' |
|
|
|
</otherwise> |
|
|
|
</choose> |
|
|
|
<if test="sort == 'asc'"> |
|
|
|
ORDER BY index_total ASC |
|
|
|
</if> |
|
|
|
<if test="sort == 'desc'"> |
|
|
|
ORDER BY index_total DESC |
|
|
|
</if> |
|
|
|
ORDER BY score.index_total ${sort} |
|
|
|
LIMIT #{topNum} |
|
|
|
</select> |
|
|
|
|
|
|
|