Browse Source

查询下级等级指标分数关联组织

dev_shibei_match
jianjun 4 years ago
parent
commit
8668d94b76
  1. 52
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml
  2. 46
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml

52
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml

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

46
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml

@ -23,35 +23,43 @@
<select id="selectAnNingSubAgencyIndexYearlyRank" parameterType="com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankYMFormDTO" <select id="selectAnNingSubAgencyIndexYearlyRank" parameterType="com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankYMFormDTO"
resultType="com.epmet.evaluationindex.screen.dto.result.AnNingSubAgencyIndexRankResultDTO"> resultType="com.epmet.evaluationindex.screen.dto.result.AnNingSubAgencyIndexRankResultDTO">
SELECT SELECT
org_name AS `NAME`, score.org_name AS `NAME`,
govern_ablity AS governAbility, score.govern_ablity AS governAbility,
party_dev_ablity AS partyDevAbility, score.party_dev_ablity AS partyDevAbility,
service_ablity AS serviceAbility, score.service_ablity AS serviceAbility,
ORG_ID orgId, score.ORG_ID orgId,
ORG_TYPE orgType score.ORG_TYPE orgType
FROM FROM
screen_index_data_yearly screen_index_data_yearly 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 WHERE
del_flag = '0' score.del_flag = '0'
AND parent_id = #{agencyId} AND score.parent_id = #{agencyId}
AND year_id = YEAR(CURDATE()) AND score.year_id = YEAR(CURDATE())
<if test="customerId != null and customerId != ''"> <if test="customerId != null and customerId != ''">
AND CUSTOMER_ID = #{customerId} AND score.CUSTOMER_ID = #{customerId}
</if> </if>
<choose> <choose>
<when test="orgType != null and orgType != ''"> <when test="orgType != null and orgType != ''">
AND ORG_TYPE = #{orgType,jdbcType=VARCHAR} AND score.ORG_TYPE = #{orgType,jdbcType=VARCHAR}
</when> </when>
<otherwise> <otherwise>
AND ORG_TYPE != 'department' AND score.ORG_TYPE != 'department'
</otherwise> </otherwise>
</choose> </choose>
<if test="sort == 'asc'"> ORDER BY index_total ${sort}
ORDER BY index_total ASC
</if>
<if test="sort == 'desc'">
ORDER BY index_total DESC
</if>
LIMIT #{topNum} LIMIT #{topNum}
</select> </select>
</mapper> </mapper>

Loading…
Cancel
Save