|
|
@ -385,4 +385,73 @@ |
|
|
|
ORDER BY (sy.govern_ablity+sy.party_dev_ablity+sy.service_ablity) DESC |
|
|
|
LIMIT #{topNum} |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="selectKczSubAgencyOrGridIndexMonthlyRank" parameterType="com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankYMFormDTO" |
|
|
|
resultType="com.epmet.evaluationindex.screen.dto.result.AnNingSubAgencyIndexRankResultDTO"> |
|
|
|
SELECT |
|
|
|
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 score |
|
|
|
WHERE score.del_flag = '0' |
|
|
|
AND score.month_id = #{monthId,jdbcType=VARCHAR} |
|
|
|
<if test="customerId != null and customerId != ''"> |
|
|
|
AND score.CUSTOMER_ID = #{customerId} |
|
|
|
</if> |
|
|
|
<if test="orgType != null and orgType != ''"> |
|
|
|
<choose> |
|
|
|
<when test="orgType == 'grid'"> |
|
|
|
and score.ORG_ID in( |
|
|
|
SELECT |
|
|
|
scg.GRID_ID |
|
|
|
FROM |
|
|
|
screen_customer_grid scg |
|
|
|
WHERE |
|
|
|
scg.DEL_FLAG = '0' |
|
|
|
AND scg.PARENT_AGENCY_ID = #{agencyId} |
|
|
|
) |
|
|
|
</when> |
|
|
|
<when test="orgType == 'agency'"> |
|
|
|
and score.ORG_ID in( |
|
|
|
SELECT |
|
|
|
sca.AGENCY_ID |
|
|
|
FROM |
|
|
|
screen_customer_agency sca |
|
|
|
WHERE |
|
|
|
sca.DEL_FLAG = '0' |
|
|
|
AND sca.PIDS LIKE concat(#{agencyId},'%') |
|
|
|
AND sca.`LEVEL` = 'community' |
|
|
|
) |
|
|
|
</when> |
|
|
|
<when test="orgType == 'department'"> |
|
|
|
and score.ORG_ID in( |
|
|
|
SELECT |
|
|
|
scd.DEPT_ID |
|
|
|
FROM |
|
|
|
screen_customer_dept scd |
|
|
|
WHERE |
|
|
|
scd.DEL_FLAG = '0' |
|
|
|
AND scd.PARENT_AGENCY_ID = #{agencyId} |
|
|
|
) |
|
|
|
</when> |
|
|
|
</choose> |
|
|
|
</if> |
|
|
|
<choose> |
|
|
|
<when test="orgType != null and orgType != ''"> |
|
|
|
AND score.ORG_TYPE = #{orgType,jdbcType=VARCHAR} |
|
|
|
</when> |
|
|
|
<otherwise> |
|
|
|
AND score.ORG_TYPE != 'department' |
|
|
|
</otherwise> |
|
|
|
</choose> |
|
|
|
ORDER BY score.index_total ${sort} |
|
|
|
LIMIT #{topNum} |
|
|
|
</select> |
|
|
|
</mapper> |
|
|
|