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"
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>

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"
resultType="com.epmet.evaluationindex.screen.dto.result.AnNingSubAgencyIndexRankResultDTO">
SELECT
org_name AS `NAME`,
govern_ablity AS governAbility,
party_dev_ablity AS partyDevAbility,
service_ablity AS serviceAbility,
ORG_ID orgId,
ORG_TYPE orgType
score.org_name AS `NAME`,
score.govern_ablity AS governAbility,
score.party_dev_ablity AS partyDevAbility,
score.service_ablity AS serviceAbility,
score.ORG_ID orgId,
score.ORG_TYPE orgType
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
del_flag = '0'
AND parent_id = #{agencyId}
AND year_id = YEAR(CURDATE())
score.del_flag = '0'
AND score.parent_id = #{agencyId}
AND score.year_id = YEAR(CURDATE())
<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 index_total ${sort}
LIMIT #{topNum}
</select>
</mapper>

Loading…
Cancel
Save