Browse Source

"dataclient/subagencyindexrank",孔村镇单独处理

dev_shibei_match
yinzuomei 4 years ago
parent
commit
8c7e7d90c6
  1. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java
  2. 3
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataYearlyDao.java
  3. 14
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java
  4. 69
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml
  5. 67
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml

2
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java

@ -127,4 +127,6 @@ public interface ScreenIndexDataMonthlyDao{
@Param("yearId") String yearId,
@Param("areaCode") String areaCode,
@Param("topNum") int topNum);
List<AnNingSubAgencyIndexRankResultDTO> selectKczSubAgencyOrGridIndexMonthlyRank(SubAgencyIndexRankYMFormDTO formDTO);
}

3
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataYearlyDao.java

@ -51,4 +51,7 @@ public interface ScreenIndexDataYearlyDao{
* @Date 09:38 2020-09-08
**/
List<AnNingSubAgencyIndexRankResultDTO> selectAnNingSubAgencyIndexYearlyRank(SubAgencyIndexRankYMFormDTO formDTO);
List<AnNingSubAgencyIndexRankResultDTO> selectKczSubAgencyIndexYearlyRank(SubAgencyIndexRankYMFormDTO formDTO);
}

14
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java

@ -260,13 +260,23 @@ public class IndexServiceImpl implements IndexService {
List<AnNingSubAgencyIndexRankResultDTO> subAgencyIndexRankResultDTOS = new ArrayList<>();
if (ScreenConstant.YEAR_ID.equals(formDTO.getType())) {
// 年 指数排行
subAgencyIndexRankResultDTOS = screenIndexDataYearlyDao.selectAnNingSubAgencyIndexYearlyRank(formDTO);
if("1234085031077498881".equals(formDTO.getAgencyId())){
// 孔村单独处理,查询下下级
subAgencyIndexRankResultDTOS = screenIndexDataYearlyDao.selectKczSubAgencyIndexYearlyRank(formDTO);
}else{
subAgencyIndexRankResultDTOS = screenIndexDataYearlyDao.selectAnNingSubAgencyIndexYearlyRank(formDTO);
}
} else if (ScreenConstant.MONTH_ID.equals(formDTO.getType())) {
// 月(上一个月) 指数排行
if (StringUtils.isBlank(formDTO.getMonthId())) {
formDTO.setMonthId(DateUtils.getBeforeNMonth(1));
}
subAgencyIndexRankResultDTOS = screenIndexDataMonthlyDao.selectSubAgencyOrGridIndexMonthlyRank(formDTO);
if("1234085031077498881".equals(formDTO.getAgencyId())){
// 孔村单独处理,查询下下级
subAgencyIndexRankResultDTOS = screenIndexDataMonthlyDao.selectKczSubAgencyOrGridIndexMonthlyRank(formDTO);
}else{
subAgencyIndexRankResultDTOS = screenIndexDataMonthlyDao.selectSubAgencyOrGridIndexMonthlyRank(formDTO);
}
subAgencyIndexRankResultDTOS.forEach(rank -> {
rank.setPartyDevAbility(getRound(rank.getPartyDevAbility()));
rank.setGovernAbility(getRound(rank.getGovernAbility()));

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

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

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

@ -65,4 +65,71 @@
ORDER BY index_total ${sort}
LIMIT #{topNum}
</select>
<select id="selectKczSubAgencyIndexYearlyRank" parameterType="com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankYMFormDTO"
resultType="com.epmet.evaluationindex.screen.dto.result.AnNingSubAgencyIndexRankResultDTO">
SELECT
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 score
WHERE
score.del_flag = '0'
AND score.year_id = YEAR(CURDATE())
<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 index_total ${sort}
LIMIT #{topNum}
</select>
</mapper>

Loading…
Cancel
Save