diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml index 3fce81dc73..68f17dd26c 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml @@ -28,10 +28,10 @@ ROUND(fact.score,1) AS "indexTotalOriginScore", fact.WEIGHT AS "indexTotalSupWeight", ROUND(self.self_score*fact.WEIGHT, 1) AS "agencyScore", - self.self_score AS selfOriginScore, + ROUND(self.self_score,1) AS selfOriginScore, self.SELF_WEIGHT AS agencyWeight, ROUND(self.sub_score*fact.WEIGHT, 1) AS "subAgencyScore", - self.sub_score AS subOriginScore, + ROUND(self.sub_score,1) AS subOriginScore, self.SUB_WEIGHT AS subAgencyWeight FROM fact_index_agency_score fact diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java index 2593996a1b..d0f1ab08df 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java @@ -81,6 +81,8 @@ public interface AgencyScoreDao extends BaseDao { * @date 2020/8/31 1:51 下午 */ List selectAgencyScoreAvg(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("dataType")String dataType); + List selectAgencyScoreAvgNew(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("dataType")String dataType, + @Param("quarterId")String quarterId,@Param("yearId")String yearId); /** * @Description 区下级街道得分平均值 存在下级客户 @@ -92,6 +94,7 @@ public interface AgencyScoreDao extends BaseDao { * @date 2021/1/18 上午9:09 */ List selectAgencyScoreAvgExistsSub(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("areaCode")String areaCode); + List selectAgencyScoreAvgExistsSubNew(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("areaCode")String areaCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId); List selectAgencyScoreAvgByOrgIds(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("orgIds")List orgIds); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java index 104f53bb42..bf5ef19a18 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java @@ -86,7 +86,8 @@ public interface CommunityScoreDao extends BaseDao selectSubCommAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); + List selectSubCommAvgScoreNew(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode, + @Param("quarterId")String quarterId,@Param("yearId")String yearId); /** * @Description 街道下级所有社区得分平均值 存在下级客户 @@ -96,8 +97,8 @@ public interface CommunityScoreDao extends BaseDao selectSubCommAvgScoreExistSub(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("areaCode")String areaCode); - List selectSubCommAvgScoreExistSubNotSelf(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("areaCode")String areaCode); + List selectSubCommAvgScoreExistSubNotSelfNew(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("areaCode")String areaCode, + @Param("quarterId")String quarterId,@Param("yearId")String yearId); /** * 根据入参查询 查询社区id diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java index cc35dbb875..f4070ce8df 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java @@ -67,6 +67,7 @@ public interface DeptScoreDao extends BaseDao { * @date 2020/9/4 10:53 上午 */ List selectGovernDeptScoreAvg(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); + List selectGovernDeptScoreAvgNew(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId); /** * @Description 所有直属部门治理能力平均值 存在下级客户 @@ -78,6 +79,7 @@ public interface DeptScoreDao extends BaseDao { */ List selectGovernDeptScoreAvgExistsSub(@Param("areaCode")String areaCode, @Param("monthId")String monthId, @Param("indexCode")String indexCode); List selectGovernDeptScoreAvgExistsSubNotSelf(@Param("areaCode")String areaCode, @Param("monthId")String monthId, @Param("indexCode")String indexCode); + List selectGovernDeptScoreAvgExistsSubNotSelfNew(@Param("areaCode")String areaCode, @Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId); /** * @return int diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java index 24f48eef4f..e3501f40ff 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java @@ -66,6 +66,8 @@ public interface FactIndexGovrnAblityOrgMonthlyDao extends BaseDao> selectCommunityGovernAbility(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level); + List> selectCommunityGovernAbilityNew(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level, + @Param("quarterId")String quarterId,@Param("yearId")String yearId); /** * @Description 社区治理能力各个参数查询【被吹哨次数、办结项目数、项目响应度、超期项目率、【街道办结项目的处理效率,level为street时存在】、办结项目率、办结项目满意度】存在下级客户时 @@ -76,6 +78,7 @@ public interface FactIndexGovrnAblityOrgMonthlyDao extends BaseDao> selectCommunityGovernAbilityExistsSub(@Param("monthId")String monthId,@Param("areaCode")String areaCode); List> selectCommunityGovernAbilityExistsSubNotSelf(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("level")String level); + List> selectCommunityGovernAbilityExistsSubNotSelfNew(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("level")String level,@Param("quarterId")String quarterId,@Param("yearId")String yearId); /** * @Description 孔村单独查询 * @Param monthId @@ -84,6 +87,7 @@ public interface FactIndexGovrnAblityOrgMonthlyDao extends BaseDao> selectCommunityGovernAbilityIsKongCun(@Param("monthId")String monthId,@Param("areaCode")String areaCode); + List> selectCommunityGovernAbilityIsKongCunNew(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId); /** * 根据组织类型删除数据 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java index dd3774be45..8a879f0ea4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java @@ -77,6 +77,8 @@ public interface FactIndexPartyAblityOrgMonthlyDao extends BaseDao> selectPublishArticleCountMap(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level); + List> selectPublishArticleCountMapNew(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level, + @Param("quarterId")String quarterId,@Param("yearId")String yearId); /** * @Description 查询社区下的发文数 Map 存在下级客户 @@ -86,7 +88,9 @@ public interface FactIndexPartyAblityOrgMonthlyDao extends BaseDao> selectPublishArticleCountMapExistSubStreet(@Param("monthId")String monthId,@Param("areaCode")String areaCode); + List> selectPublishArticleCountMapExistSubStreetNew(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId); List> selectPublishArticleCountMapExistSubNotSelf(@Param("monthId")String monthId,@Param("areaCode")String areaCode); + List> selectPublishArticleCountMapExistSubNotSelfNew(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId); /** * @Description 查询社区下的发文数 Map【根据areaCode】 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java index 28917bf72b..60f0018c20 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java @@ -78,6 +78,8 @@ public interface FactIndexServiceAblityOrgMonthlyDao extends BaseDao> selectActivityCountMap(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level); + List> selectActivityCountMapNew(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level, + @Param("quarterId")String quarterId,@Param("yearId")String yearId); /** * @Description 社区活动组织次数 存在下级客户 @@ -87,7 +89,9 @@ public interface FactIndexServiceAblityOrgMonthlyDao extends BaseDao> selectActivityCountMapExistsSub(@Param("monthId")String monthId,@Param("areaCode")String areaCode); + List> selectActivityCountMapExistsSubNew(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId); List> selectActivityCountMapIsKongCun(@Param("monthId")String monthId,@Param("areaCode")String areaCode); + List> selectActivityCountMapIsKongCunNew(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId); List> selectActivityCountMapExistsSubNotSelf(@Param("monthId")String monthId,@Param("areaCode")String areaCode); /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java index 2a71c3e8d3..c811d5fb56 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java @@ -194,9 +194,11 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { log.error("calculateGridDangJian customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); throw new RenException("客户【网格相关:党建能力】指标权重信息不存在"); } - //查询总记录数(该客户下,该月份,每个网格一条,有多少条) + //查询总记录数:如果网格内没有产生业务数据,fact_index_party_ablity_grid_monthly为空,改为以screen_customer_grid为主表 + //举例:有10个网格,只有2个网格在指标表里面有记录,实际total应该还是为10. 并且那8个指标值赋值为0 int total = factIndexPartyAblityGridMonthlyDao.selectCount(formDTO); if (NumConstant.ZERO == total) { + log.warn(String.format("customerId=%s,monthId=%s,没有找到screen_customer_grid记录", formDTO.getCustomerId(), formDTO.getMonthId())); log.warn(String.format("customerId=%s,monthId=%s,没有上传网格相关-党建能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); return; } @@ -217,7 +219,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { //分页查询采集记录 for (int pageNo = 1; pageNo <= totalPage; pageNo++) { int pageIndex = (pageNo - NumConstant.ONE) * IndexCalConstant.PAGE_SIZE; - //前10条。每个网格的党建能力的数据 + //前10条 + //这块逻辑也要改为以screen_customer_grid表为主表,没有五级指标值的网格,赋值为0 List> recordList = queryListPartyAblityGrid(new PageQueryGridFormDTO(formDTO.getCustomerId(), formDTO.getMonthId(), pageIndex, @@ -631,7 +634,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { log.error("calculateGridZhiLi customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); throw new RenException("客户【网格相关:治理能力】指标权重信息不存在"); } - //查询总记录数 + //查询总记录数:如果网格内没有产生业务数据,fact_index_govrn_ablity_grid_monthly为空,改为以screen_customer_grid为主表 + //举例:有10个网格,只有2个网格在指标表里面有记录,实际total应该还是为10. 并且那8个指标值赋值为0 int total = factIndexGovrnAblityGridMonthlyDao.selectCount(formDTO); if (NumConstant.ZERO == total) { log.warn(String.format("customerId%s,monthId%s,没有上传网格相关-治理能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java index 3bc97544d0..b362211f37 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java @@ -217,6 +217,8 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); return true; } + String quarterId = DateUtils.getQuarterId(monthId); + String yearId = DateUtils.getYearId(monthId); List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); Map agencyMap = agencyMap(customerId); @@ -225,7 +227,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict //党建能力平均值 indexDetailList.forEach(detail -> { if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { - List subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); + List subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvgNew(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,quarterId,yearId); subGridPartyAvgScore.forEach(s -> { gridPartyScoreSampleCountMap.put(s.getParentId().concat(":").concat(IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode()), s.getSampleCount()); }); @@ -252,7 +254,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } } else { // 区名义发文数量 - List> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId,IndexCalConstant.DISTRICT_LEVEL); + List> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapNew(customerId, monthId,IndexCalConstant.DISTRICT_LEVEL,quarterId,yearId); log.info("publishArticleCountList:::"+publishArticleCountList.toString()); if (CollectionUtils.isEmpty(publishArticleCountList)) { log.warn(IndexCalConstant.DISTRICT_PUBLISH_ARTICLE_LIST_NULL); @@ -308,6 +310,8 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); return true; } + String quarterId = DateUtils.getQuarterId(monthId); + String yearId = DateUtils.getYearId(monthId); List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); // key:agencyId,value:sampleCount样本量 @@ -315,7 +319,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict Map agencyMap = agencyMap(customerId); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { - List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); + List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgNew(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,quarterId,yearId); districtGovernAvgList.forEach(s -> { gridPartyScoreSampleCountMap.put(s.getParentId().concat(":").concat(IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode()), s.getSampleCount()); }); @@ -346,7 +350,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict }); } } else if (IndexCodeEnum.SUO_YOU_ZHI_SHU_BMZLNLPJZ.getCode().equals(detail.getIndexCode())){ - List deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + List deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvgNew(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),quarterId,yearId); log.info("deptScoreAvgList:::"+deptScoreAvgList.toString()); for (int i = 0; i < deptScoreAvgList.size(); i++) { if (deptScoreAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ @@ -401,6 +405,8 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); return true; } + String quarterId = DateUtils.getQuarterId(monthId); + String yearId = DateUtils.getYearId(monthId); List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); // key:agencyId,value:sampleCount样本量 @@ -409,8 +415,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { - List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); - + List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgNew(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,quarterId,yearId); subStreetAvgList.forEach(s -> { gridPartyScoreSampleCountMap.put(s.getParentId().concat(":").concat(IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode()), s.getSampleCount()); }); @@ -643,13 +648,15 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); return true; } + String quarterId = DateUtils.getQuarterId(monthId); + String yearId = DateUtils.getYearId(monthId); List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); Map agencyMap = agencyMap(customerId); //党建能力平均值 indexDetailList.forEach(detail -> { if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { - List subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode()); + List subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvgExistsSubNew(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId); log.info("subGridPartyAvgScore:::"+subGridPartyAvgScore.toString()); if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { log.warn(IndexCalConstant.DISTRICT_PARTY_AVG_NULL); @@ -677,7 +684,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } } else { // 区名义发文数量 - List> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapExistSubNotSelf(monthId,form.getCustomerAreaCode()); + List> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapExistSubNotSelfNew(monthId,form.getCustomerAreaCode(),quarterId,yearId); log.info("publishArticleCountList:::"+publishArticleCountList.toString()); if (CollectionUtils.isEmpty(publishArticleCountList)) { log.warn(IndexCalConstant.DISTRICT_PUBLISH_ARTICLE_LIST_NULL); @@ -729,12 +736,14 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); return true; } + String quarterId = DateUtils.getQuarterId(monthId); + String yearId = DateUtils.getYearId(monthId); List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); Map agencyMap = agencyMap(customerId); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { - List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode()); + List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSubNew(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId); log.info("districtGovernAvgList:::"+districtGovernAvgList.toString()); for (int i = 0; i < districtGovernAvgList.size(); i++) { if (districtGovernAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ @@ -766,7 +775,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict }); } } else if (IndexCodeEnum.SUO_YOU_ZHI_SHU_BMZLNLPJZ.getCode().equals(detail.getIndexCode())){ - List deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvgExistsSubNotSelf(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode()); + List deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvgExistsSubNotSelfNew(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId); log.info("deptScoreAvgList:::"+deptScoreAvgList.toString()); for (int i = 0; i < deptScoreAvgList.size(); i++) { if (deptScoreAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ @@ -817,13 +826,15 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); return true; } + String quarterId = DateUtils.getQuarterId(monthId); + String yearId = DateUtils.getYearId(monthId); List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); Map agencyMap = agencyMap(customerId); detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { - List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode()); + List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSubNew(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId); log.info("subStreetAvgList:::"+subStreetAvgList.toString()); for (int i = 0; i < subStreetAvgList.size(); i++) { if (subStreetAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java index 35c9bdc671..0b3efc7392 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java @@ -225,6 +225,8 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); return true; } + String quarterId = DateUtils.getQuarterId(monthId); + String yearId = DateUtils.getYearId(monthId); List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); @@ -233,7 +235,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ //下属所有社区的党建能力平均值 detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { - List subCommPartyAvgScore = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + List subCommPartyAvgScore = communityScoreDao.selectSubCommAvgScoreNew(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),quarterId,yearId); subCommPartyAvgScore.forEach(s -> { gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode()), s.getSampleCount()); }); @@ -257,7 +259,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ } } else { // 街道名义发文数量 - List> mapList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId, IndexCalConstant.STREET_LEVEL); + List> mapList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapNew(customerId, monthId, IndexCalConstant.STREET_LEVEL,quarterId,yearId); if (CollectionUtils.isEmpty(mapList)) { log.warn(IndexCalConstant.STREET_PUBLISH_ARTICLE_LIST_NULL); } else { @@ -313,6 +315,8 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); return true; } + String quarterId = DateUtils.getQuarterId(monthId); + String yearId = DateUtils.getYearId(monthId); List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); @@ -320,7 +324,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ Map gridPartyScoreSampleCountMap = new HashMap<>(); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode().equals(detail.getIndexCode())) { - List subGridGovernAvg = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + List subGridGovernAvg = communityScoreDao.selectSubCommAvgScoreNew(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),quarterId,yearId); subGridGovernAvg.forEach(s -> { gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode()), s.getSampleCount()); }); @@ -343,7 +347,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ } } else { // 治理能力的六个五级指标 - List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbility(customerId, monthId,IndexCalConstant.STREET_LEVEL); + List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityNew(customerId, monthId,IndexCalConstant.STREET_LEVEL,quarterId,yearId); if (CollectionUtils.isEmpty(communityGovernAbility)){ log.warn(IndexCalConstant.STREET_GOVERN_ABILITY_NULL); }else{ @@ -396,6 +400,8 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); return true; } + String quarterId = DateUtils.getQuarterId(monthId); + String yearId = DateUtils.getYearId(monthId); List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); @@ -405,12 +411,10 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.JIE_DAO_XIA_SHU_SQFWNLDFPYZ.getCode().equals(indexCode)) { - List subCommServiceAvg = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); - + List subCommServiceAvg = communityScoreDao.selectSubCommAvgScoreNew(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),quarterId,yearId); subCommServiceAvg.forEach(s -> { gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.JIE_DAO_XIA_SHU_SQFWNLDFPYZ.getCode()), s.getSampleCount()); }); - if (CollectionUtils.isEmpty(subCommServiceAvg)) { log.warn("查询街道下属社区服务能力得分平均值为空"); } else if (subCommServiceAvg.size() > NumConstant.ZERO) { @@ -429,7 +433,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ }); } } else { - List> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMap(customerId, monthId,IndexCalConstant.STREET_LEVEL); + List> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapNew(customerId, monthId,IndexCalConstant.STREET_LEVEL,quarterId,yearId); if (CollectionUtils.isEmpty(communityActivityCountList)) { log.warn(IndexCalConstant.STREET_SERVICE_ABILITY_NULL); }else{ @@ -648,12 +652,14 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); return true; } + String quarterId = DateUtils.getQuarterId(monthId); + String yearId = DateUtils.getYearId(monthId); List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); //下属所有社区的党建能力平均值 detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { - List dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelf(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode()); + List dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelfNew(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId); List subCommPartyAvgScore = disposeSubAvg(dispose, form); if (CollectionUtils.isEmpty(subCommPartyAvgScore)) { log.warn(IndexCalConstant.COMMUNITY_PARTY_AVG_NULL); @@ -676,7 +682,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ } } else { // 街道名义发文数量 - List> mapList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapExistSubStreet(monthId,form.getCustomerAreaCode()); + List> mapList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapExistSubStreetNew(monthId,form.getCustomerAreaCode(),quarterId,yearId); if (CollectionUtils.isEmpty(mapList)) { log.warn(IndexCalConstant.STREET_PUBLISH_ARTICLE_LIST_NULL); } else { @@ -726,11 +732,13 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); return true; } + String quarterId = DateUtils.getQuarterId(monthId); + String yearId = DateUtils.getYearId(monthId); List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode().equals(detail.getIndexCode())) { - List dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelf(monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode()); + List dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelfNew(monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId); List subGridGovernAvg = disposeSubAvg(dispose,form); if (CollectionUtils.isEmpty(subGridGovernAvg)){ log.warn("查询街道下属所有社区治理能力汇总为空"); @@ -801,12 +809,14 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); return true; } + String quarterId = DateUtils.getQuarterId(monthId); + String yearId = DateUtils.getYearId(monthId); List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.JIE_DAO_XIA_SHU_SQFWNLDFPYZ.getCode().equals(indexCode)) { - List dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelf(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode()); + List dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelfNew(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId); List subCommServiceAvg = disposeSubAvg(dispose,form); if (CollectionUtils.isEmpty(subCommServiceAvg)) { log.warn("查询街道下属社区服务能力得分平均值为空"); @@ -943,9 +953,11 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ } public List> disposeFiveLevel(CalculateCommonFormDTO formDTO){ + String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); + String yearId = DateUtils.getYearId(formDTO.getMonthId()); List> result = new ArrayList<>(); - List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityExistsSubNotSelf(formDTO.getMonthId(),formDTO.getCustomerAreaCode(), ScreenConstant.STREET); - List> kongCunGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityIsKongCun(formDTO.getMonthId(),formDTO.getCustomerAreaCode()); + List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityExistsSubNotSelfNew(formDTO.getMonthId(),formDTO.getCustomerAreaCode(), ScreenConstant.STREET,quarterId,yearId); + List> kongCunGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityIsKongCunNew(formDTO.getMonthId(),formDTO.getCustomerAreaCode(),quarterId,yearId); if (!CollectionUtils.isEmpty(kongCunGovernAbility)){ kongCunGovernAbility.forEach(k -> { k.put("AGENCY_ID",k.get("PARENT_ID")); @@ -962,9 +974,11 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ } public List> disposeActivityCount(CalculateCommonFormDTO formDTO){ + String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); + String yearId = DateUtils.getYearId(formDTO.getMonthId()); List> result = new ArrayList<>(); - List> ActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapExistsSub(formDTO.getMonthId(),formDTO.getCustomerAreaCode()); - List> kongCunActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapIsKongCun(formDTO.getMonthId(),formDTO.getCustomerAreaCode()); + List> ActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapExistsSubNew(formDTO.getMonthId(),formDTO.getCustomerAreaCode(),quarterId,yearId); + List> kongCunActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapIsKongCunNew(formDTO.getMonthId(),formDTO.getCustomerAreaCode(),quarterId,yearId); if (!CollectionUtils.isEmpty(kongCunActivityCountList)){ kongCunActivityCountList.forEach(k -> { k.put("AGENCY_ID",k.get("PARENT_ID")); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml index 215a7f3f31..3b9244eab7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml @@ -222,4 +222,52 @@ OR fias.INDEX_CODE = "dangjiannengli" OR fias.INDEX_CODE = "fuwunengli") + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml index 17e80da926..2327d508a2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml @@ -67,28 +67,26 @@ OR INDEX_CODE = "fuwunengli") - - SELECT - fics.PARENT_AGENCY_ID AS agencyId, - fics.month_id, - fics.quarter_id, - fics.year_id, - ROUND(AVG( fics.score ),6) AS score, - COUNT(1) AS sampleCount, - fics.customer_id, + sca.AGENCY_ID AS agencyId, + #{monthId} AS monthId, + #{quarterId} AS quarterId, + #{yearId} AS yearId, + IFNULL(ROUND(AVG( fics.score ),6),0) AS score, COUNT(1) AS sampleCount, + sca.customer_id, sca.pid AS parentId - FROM - fact_index_community_score fics - LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = fics.PARENT_AGENCY_ID - WHERE - fics.del_flag = '0' - AND sca.DEL_FLAG = 0 - AND sca.level = 'street' - AND fics.customer_id = #{customerId} - AND fics.month_id = #{monthId} - AND fics.index_code = #{indexCode} - GROUP BY fics.parent_agency_id + FROM screen_customer_agency sca + LEFT JOIN fact_index_community_score fics + ON (fics.PARENT_AGENCY_ID = sca.AGENCY_ID + AND fics.del_flag = '0' + AND fics.month_id = #{monthId} + AND fics.index_code = #{indexCode} + ) + WHERE sca.DEL_FLAG = 0 + AND sca.level = 'street' + AND sca.customer_id = #{customerId} + GROUP BY sca.AGENCY_ID - - SELECT - fics.PARENT_AGENCY_ID AS agencyId, - fics.month_id, - fics.quarter_id, - fics.year_id, - ROUND(AVG( fics.score ),6) AS score, - fics.customer_id, + sca.AGENCY_ID AS agencyId, + #{monthId} AS monthId, + #{quarterId} AS quarterId, + #{yearId} AS yearId, + IFNULL(ROUND(AVG( fics.score ),6),0) AS score, + sca.customer_id, sca.pid AS parentId - FROM - fact_index_community_score fics - LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = fics.PARENT_AGENCY_ID - WHERE - fics.del_flag = '0' - AND sca.DEL_FLAG = 0 - AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') - AND fics.month_id = #{monthId} - AND fics.index_code = #{indexCode} - GROUP BY fics.parent_agency_id - - diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml index 7f3545b825..b6f59818c8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml @@ -194,4 +194,51 @@ AND fidc.index_code = #{indexCode} GROUP BY fidc.agency_id + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml index f782210785..8b50b7c989 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml @@ -98,24 +98,16 @@ SELECT - m.CUSTOMER_ID, - m.DEPT_ID, - m.MONTH_ID, - MIN(m.TRANSFERED_COUNT) as TRANSFERED_COUNT_MIN, - MAX(m.TRANSFERED_COUNT) as TRANSFERED_COUNT_MAX, - MIN(m.CLOSED_PROJECT_COUNT) as CLOSED_PROJECT_COUNT_MIN, - MAX(m.CLOSED_PROJECT_COUNT) as CLOSED_PROJECT_COUNT_MAX, - MIN(m.RESP_PROJECT_RATIO) as RESP_PROJECT_RATIO_MIN, - MAX(m.RESP_PROJECT_RATIO) as RESP_PROJECT_RATIO_MAX, - MIN(m.HANDLE_PROJECT_RATIO) as HANDLE_PROJECT_RATIO_MIN, - MAX(m.HANDLE_PROJECT_RATIO) as HANDLE_PROJECT_RATIO_MAX, - MIN(M.CLOSED_PROJECT_RATIO) as CLOSED_PROJECT_RATIO_MIN, - MAX(M.CLOSED_PROJECT_RATIO) as CLOSED_PROJECT_RATIO_MAX, - MIN(M.SATISFACTION_RATIO) as SATISFACTION_RATIO_MIN, - MAX(M.SATISFACTION_RATIO) as SATISFACTION_RATIO_MAX + IFNULL(MIN(m.TRANSFERED_COUNT),0) as TRANSFERED_COUNT_MIN, + IFNULL(MAX(m.TRANSFERED_COUNT),0) as TRANSFERED_COUNT_MAX, + IFNULL(MIN(m.CLOSED_PROJECT_COUNT),0) as CLOSED_PROJECT_COUNT_MIN, + IFNULL(MAX(m.CLOSED_PROJECT_COUNT),0) as CLOSED_PROJECT_COUNT_MAX, + IFNULL(MIN(m.RESP_PROJECT_RATIO),0) as RESP_PROJECT_RATIO_MIN, + IFNULL(MAX(m.RESP_PROJECT_RATIO),0) as RESP_PROJECT_RATIO_MAX, + IFNULL(MIN(m.HANDLE_PROJECT_RATIO),0) as HANDLE_PROJECT_RATIO_MIN, + IFNULL(MAX(m.HANDLE_PROJECT_RATIO),0) as HANDLE_PROJECT_RATIO_MAX, + IFNULL(MIN(M.CLOSED_PROJECT_RATIO),0) as CLOSED_PROJECT_RATIO_MIN, + IFNULL(MAX(M.CLOSED_PROJECT_RATIO),0) as CLOSED_PROJECT_RATIO_MAX, + IFNULL(MIN(M.SATISFACTION_RATIO),0) as SATISFACTION_RATIO_MIN, + IFNULL(MAX(M.SATISFACTION_RATIO),0) as SATISFACTION_RATIO_MAX FROM fact_index_govrn_ablity_dept_monthly m inner join screen_customer_dept scd @@ -155,7 +144,6 @@ and scd.AREA_CODE LIKE concat( #{customerAreaCode}, '%') - AND m.CUSTOMER_ID =#{customerId} and scd.CUSTOMER_ID=#{customerId} @@ -164,38 +152,36 @@ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml index 800adbfb30..d58ae256b4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml @@ -100,80 +100,73 @@ SELECT - count( 1 ) AS total + count( scg.GRID_ID ) AS total FROM - fact_index_govrn_ablity_grid_monthly m - inner join screen_customer_grid scg - on( - m.GRID_ID=scg.GRID_ID - and scg.DEL_FLAG='0' + screen_customer_grid scg + WHERE scg.DEL_FLAG='0' and scg.UP_TO_CAL='yes' - ) - WHERE - m.DEL_FLAG = '0' - AND m.MONTH_ID=#{monthId} and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%') - AND m.CUSTOMER_ID =#{customerId} and scg.CUSTOMER_ID=#{customerId} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml index 3dbe2956ed..4d731cb5c7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml @@ -135,6 +135,35 @@ AND customer_id = #{customerId} AND month_id = #{monthId} + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml index a1d0e85e45..5b2920b8eb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml @@ -105,98 +105,92 @@ + - SELECT - count(1) as total + SELECT + count(scg.GRID_ID) as total FROM - fact_index_party_ablity_grid_monthly m - inner join screen_customer_grid scg - on( - m.GRID_ID=scg.GRID_ID - and scg.DEL_FLAG='0' - and scg.UP_TO_CAL='yes' - ) - WHERE - m.DEL_FLAG = '0' - AND m.MONTH_ID =#{monthId} - - - and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%') - - - AND m.CUSTOMER_ID =#{customerId} - and scg.CUSTOMER_ID=#{customerId} - - + screen_customer_grid scg + WHERE scg.DEL_FLAG='0' + and scg.UP_TO_CAL='yes' + + + and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + and scg.CUSTOMER_ID=#{customerId} + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml index eeddf7a408..5749931e9b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml @@ -112,6 +112,29 @@ AND month_id = #{monthId} + + + + + + + + SELECT - m.CUSTOMER_ID, - m.GRID_ID, - m.MONTH_ID, - m.ACTIVITY_COUNT, - m.VOLUNTEER_RATIO, - m.PARTY_VOLUNTEER_RATIO + scg.CUSTOMER_ID, + scg.GRID_ID, + #{monthId} AS MONTH_ID, + IFNULL( m.ACTIVITY_COUNT, 0 ) AS ACTIVITY_COUNT, + IFNULL( m.VOLUNTEER_RATIO, 0 ) AS VOLUNTEER_RATIO, + IFNULL( m.PARTY_VOLUNTEER_RATIO, 0 ) AS PARTY_VOLUNTEER_RATIO FROM - fact_index_service_ablity_grid_monthly m - WHERE - m.DEL_FLAG = '0' - and m.CUSTOMER_ID=#{customerId} - and m.MONTH_ID=#{monthId} - order by m.GRID_ID asc + screen_customer_grid scg + LEFT JOIN fact_index_service_ablity_grid_monthly m + ON ( scg.GRID_ID = m.GRID_ID + AND m.DEL_FLAG = '0' + AND m.MONTH_ID = #{monthId} + ) + WHERE scg.DEL_FLAG='0' + and scg.UP_TO_CAL='yes' + + + and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + and scg.CUSTOMER_ID=#{customerId} + + + ORDER BY + scg.GRID_ID ASC LIMIT #{pageIndex}, #{pageSize} SELECT - count(1) as total + count(scg.GRID_ID) as total FROM - fact_index_service_ablity_grid_monthly m - inner join screen_customer_grid scg - on( - m.GRID_ID=scg.GRID_ID - and scg.DEL_FLAG='0' + screen_customer_grid scg + WHERE scg.DEL_FLAG='0' and scg.UP_TO_CAL='yes' - ) - WHERE - m.DEL_FLAG = '0' - AND m.MONTH_ID =#{monthId} and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%') - AND m.CUSTOMER_ID =#{customerId} and scg.CUSTOMER_ID=#{customerId} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml index da861138bd..251956f3f4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml @@ -112,6 +112,29 @@ AND month_id = #{monthId} + + + + + +