Browse Source

Merge remote-tracking branch 'remotes/origin/dev_bugfix_ljj' into dev_temp

# Conflicts:
#	epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java
#	epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java
#	epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java
#	epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml
dev_shibei_match
jianjun 4 years ago
parent
commit
fe87ae2e5e
  1. 4
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml
  2. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java
  3. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java
  4. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java
  5. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java
  6. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java
  7. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java
  8. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java
  9. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java
  10. 46
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java
  11. 48
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml
  12. 91
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml
  13. 47
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml
  14. 82
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml
  15. 105
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml
  16. 82
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml
  17. 156
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml
  18. 63
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml
  19. 80
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml
  20. 67
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml

4
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

3
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<AgencyScoreEntity> {
* @date 2020/8/31 1:51 下午
*/
List<SubAgencyScoreAvgResultDTO> selectAgencyScoreAvg(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("dataType")String dataType);
List<SubAgencyScoreAvgResultDTO> 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<AgencyScoreEntity> {
* @date 2021/1/18 上午9:09
*/
List<SubAgencyScoreAvgResultDTO> selectAgencyScoreAvgExistsSub(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("areaCode")String areaCode);
List<SubAgencyScoreAvgResultDTO> selectAgencyScoreAvgExistsSubNew(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("areaCode")String areaCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId);
List<SubAgencyScoreAvgResultDTO> selectAgencyScoreAvgByOrgIds(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("orgIds")List<String> orgIds);

7
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<FactIndexCommunityScoreEntity
* @author zxc
* @date 2020/8/31 1:51 下午
*/
List<SubCommunityAvgResultDTO> selectSubCommAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode);
List<SubCommunityAvgResultDTO> 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<FactIndexCommunityScoreEntity
* @author zxc
* @date 2021/1/15 下午3:19
*/
List<SubCommunityAvgResultDTO> selectSubCommAvgScoreExistSub(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("areaCode")String areaCode);
List<SubCommunityAvgResultDTO> selectSubCommAvgScoreExistSubNotSelf(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("areaCode")String areaCode);
List<SubCommunityAvgResultDTO> selectSubCommAvgScoreExistSubNotSelfNew(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("areaCode")String areaCode,
@Param("quarterId")String quarterId,@Param("yearId")String yearId);
/**
* 根据入参查询 查询社区id

2
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<DeptScoreEntity> {
* @date 2020/9/4 10:53 上午
*/
List<SubAgencyScoreAvgResultDTO> selectGovernDeptScoreAvg(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode);
List<SubAgencyScoreAvgResultDTO> 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<DeptScoreEntity> {
*/
List<SubAgencyScoreAvgResultDTO> selectGovernDeptScoreAvgExistsSub(@Param("areaCode")String areaCode, @Param("monthId")String monthId, @Param("indexCode")String indexCode);
List<SubAgencyScoreAvgResultDTO> selectGovernDeptScoreAvgExistsSubNotSelf(@Param("areaCode")String areaCode, @Param("monthId")String monthId, @Param("indexCode")String indexCode);
List<SubAgencyScoreAvgResultDTO> selectGovernDeptScoreAvgExistsSubNotSelfNew(@Param("areaCode")String areaCode, @Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId);
/**
* @return int

4
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<FactIndexGovr
* @date 2020/8/26 1:40 下午
*/
List<Map<String,Object>> selectCommunityGovernAbility(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level);
List<Map<String,Object>> 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<FactIndexGovr
*/
List<Map<String,Object>> selectCommunityGovernAbilityExistsSub(@Param("monthId")String monthId,@Param("areaCode")String areaCode);
List<Map<String,Object>> selectCommunityGovernAbilityExistsSubNotSelf(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("level")String level);
List<Map<String,Object>> 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<FactIndexGovr
* @date 2021/3/11 下午5:21
*/
List<Map<String,Object>> selectCommunityGovernAbilityIsKongCun(@Param("monthId")String monthId,@Param("areaCode")String areaCode);
List<Map<String,Object>> selectCommunityGovernAbilityIsKongCunNew(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId);
/**
* 根据组织类型删除数据

4
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<FactIndexPart
* @date 2020/8/26 10:49 上午
*/
List<Map<String,Object>> selectPublishArticleCountMap(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level);
List<Map<String,Object>> 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<FactIndexPart
* @date 2021/1/15 下午3:31
*/
List<Map<String,Object>> selectPublishArticleCountMapExistSubStreet(@Param("monthId")String monthId,@Param("areaCode")String areaCode);
List<Map<String,Object>> selectPublishArticleCountMapExistSubStreetNew(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId);
List<Map<String,Object>> selectPublishArticleCountMapExistSubNotSelf(@Param("monthId")String monthId,@Param("areaCode")String areaCode);
List<Map<String,Object>> selectPublishArticleCountMapExistSubNotSelfNew(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId);
/**
* @Description 查询社区下的发文数 Map根据areaCode

4
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<FactIndexSe
* @date 2020/9/2 2:09 下午
*/
List<Map<String,Object>> selectActivityCountMap(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level);
List<Map<String,Object>> 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<FactIndexSe
* @date 2021/1/15 下午1:53
*/
List<Map<String,Object>> selectActivityCountMapExistsSub(@Param("monthId")String monthId,@Param("areaCode")String areaCode);
List<Map<String,Object>> selectActivityCountMapExistsSubNew(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId);
List<Map<String,Object>> selectActivityCountMapIsKongCun(@Param("monthId")String monthId,@Param("areaCode")String areaCode);
List<Map<String,Object>> selectActivityCountMapIsKongCunNew(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId);
List<Map<String,Object>> selectActivityCountMapExistsSubNotSelf(@Param("monthId")String monthId,@Param("areaCode")String areaCode);
/**

10
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<Map<String, Object>> 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()));

33
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<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
Map<String, String> 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<SubAgencyScoreAvgResultDTO> subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL);
List<SubAgencyScoreAvgResultDTO> 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<Map<String, Object>> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId,IndexCalConstant.DISTRICT_LEVEL);
List<Map<String, Object>> 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<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
// key:agencyId,value:sampleCount样本量
@ -315,7 +319,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
Map<String, String> agencyMap = agencyMap(customerId);
detailListByParentCode.forEach(detail -> {
if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) {
List<SubAgencyScoreAvgResultDTO> districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL);
List<SubAgencyScoreAvgResultDTO> 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<SubAgencyScoreAvgResultDTO> deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
List<SubAgencyScoreAvgResultDTO> 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<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> 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<SubAgencyScoreAvgResultDTO> subStreetAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL);
List<SubAgencyScoreAvgResultDTO> 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<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
Map<String, String> agencyMap = agencyMap(customerId);
//党建能力平均值
indexDetailList.forEach(detail -> {
if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) {
List<SubAgencyScoreAvgResultDTO> subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode());
List<SubAgencyScoreAvgResultDTO> 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<Map<String, Object>> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapExistSubNotSelf(monthId,form.getCustomerAreaCode());
List<Map<String, Object>> 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<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
Map<String, String> agencyMap = agencyMap(customerId);
detailListByParentCode.forEach(detail -> {
if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) {
List<SubAgencyScoreAvgResultDTO> districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode());
List<SubAgencyScoreAvgResultDTO> 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<SubAgencyScoreAvgResultDTO> deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvgExistsSubNotSelf(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode());
List<SubAgencyScoreAvgResultDTO> 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<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
Map<String, String> agencyMap = agencyMap(customerId);
detailListByParentCode.forEach(detail -> {
String indexCode = detail.getIndexCode();
if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) {
List<SubAgencyScoreAvgResultDTO> subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode());
List<SubAgencyScoreAvgResultDTO> 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)){

46
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<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> 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<SubCommunityAvgResultDTO> subCommPartyAvgScore = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode());
List<SubCommunityAvgResultDTO> 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<Map<String, Object>> mapList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId, IndexCalConstant.STREET_LEVEL);
List<Map<String, Object>> 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<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
@ -320,7 +324,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
Map<String, Integer> gridPartyScoreSampleCountMap = new HashMap<>();
detailListByParentCode.forEach(detail -> {
if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode().equals(detail.getIndexCode())) {
List<SubCommunityAvgResultDTO> subGridGovernAvg = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
List<SubCommunityAvgResultDTO> 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<Map<String, Object>> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbility(customerId, monthId,IndexCalConstant.STREET_LEVEL);
List<Map<String, Object>> 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<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> 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<SubCommunityAvgResultDTO> subCommServiceAvg = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode());
List<SubCommunityAvgResultDTO> 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<Map<String, Object>> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMap(customerId, monthId,IndexCalConstant.STREET_LEVEL);
List<Map<String, Object>> 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<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
//下属所有社区的党建能力平均值
detailListByParentCode.forEach(detail -> {
if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode().equals(detail.getIndexCode())) {
List<SubCommunityAvgResultDTO> dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelf(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode());
List<SubCommunityAvgResultDTO> dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelfNew(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId);
List<SubCommunityAvgResultDTO> 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<Map<String, Object>> mapList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapExistSubStreet(monthId,form.getCustomerAreaCode());
List<Map<String, Object>> 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<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
detailListByParentCode.forEach(detail -> {
if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode().equals(detail.getIndexCode())) {
List<SubCommunityAvgResultDTO> dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelf(monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode());
List<SubCommunityAvgResultDTO> dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelfNew(monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId);
List<SubCommunityAvgResultDTO> 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<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
detailListByParentCode.forEach(detail -> {
String indexCode = detail.getIndexCode();
if (IndexCodeEnum.JIE_DAO_XIA_SHU_SQFWNLDFPYZ.getCode().equals(indexCode)) {
List<SubCommunityAvgResultDTO> dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelf(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode());
List<SubCommunityAvgResultDTO> dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelfNew(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId);
List<SubCommunityAvgResultDTO> subCommServiceAvg = disposeSubAvg(dispose,form);
if (CollectionUtils.isEmpty(subCommServiceAvg)) {
log.warn("查询街道下属社区服务能力得分平均值为空");
@ -943,9 +953,11 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
}
public List<Map<String, Object>> disposeFiveLevel(CalculateCommonFormDTO formDTO){
String quarterId = DateUtils.getQuarterId(formDTO.getMonthId());
String yearId = DateUtils.getYearId(formDTO.getMonthId());
List<Map<String, Object>> result = new ArrayList<>();
List<Map<String, Object>> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityExistsSubNotSelf(formDTO.getMonthId(),formDTO.getCustomerAreaCode(), ScreenConstant.STREET);
List<Map<String, Object>> kongCunGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityIsKongCun(formDTO.getMonthId(),formDTO.getCustomerAreaCode());
List<Map<String, Object>> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityExistsSubNotSelfNew(formDTO.getMonthId(),formDTO.getCustomerAreaCode(), ScreenConstant.STREET,quarterId,yearId);
List<Map<String, Object>> 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<Map<String, Object>> disposeActivityCount(CalculateCommonFormDTO formDTO){
String quarterId = DateUtils.getQuarterId(formDTO.getMonthId());
String yearId = DateUtils.getYearId(formDTO.getMonthId());
List<Map<String, Object>> result = new ArrayList<>();
List<Map<String, Object>> ActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapExistsSub(formDTO.getMonthId(),formDTO.getCustomerAreaCode());
List<Map<String, Object>> kongCunActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapIsKongCun(formDTO.getMonthId(),formDTO.getCustomerAreaCode());
List<Map<String, Object>> ActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapExistsSubNew(formDTO.getMonthId(),formDTO.getCustomerAreaCode(),quarterId,yearId);
List<Map<String, Object>> kongCunActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapIsKongCunNew(formDTO.getMonthId(),formDTO.getCustomerAreaCode(),quarterId,yearId);
if (!CollectionUtils.isEmpty(kongCunActivityCountList)){
kongCunActivityCountList.forEach(k -> {
k.put("AGENCY_ID",k.get("PARENT_ID"));

48
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")
</select>
<select id="selectAgencyScoreAvgNew" resultType="com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO">
SELECT
sca.agency_id,
#{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 screen_customer_agency sca
LEFT JOIN fact_index_agency_score fics ON
(fics.PARENT_AGENCY_ID = sca.AGENCY_ID
AND fics.del_flag = '0'
AND fics.customer_id = #{customerId}
AND fics.month_id = #{monthId}
AND fics.index_code = #{indexCode}
AND fics.DATA_TYPE = #{dataType}
)
WHERE sca.DEL_FLAG = 0
AND sca.level = 'district'
AND sca.customer_id = #{customerId}
GROUP BY sca.AGENCY_ID
</select>
<select id="selectAgencyScoreAvgExistsSubNew" resultType="com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO">
SELECT a2.pid AS parentId,a.monthId,a.quarterId,a.yearId,ROUND(AVG( a.score ),6) AS score,a.customerId,a.parentId AS agencyId FROM
(SELECT
sca.agency_id AS agencyId,
fics.month_id AS monthId,
fics.quarter_id AS quarterId,
fics.year_id AS yearId,
IFNULL(ROUND(AVG( fics.score ),6),0) AS score,
sca.customer_id AS customerId,
(SELECT AGENCY_ID FROM screen_customer_agency WHERE AREA_CODE = #{areaCode} AND DEL_FLAG = 0) AS parentId
FROM screen_customer_agency sca
LEFT JOIN fact_index_agency_score fics ON
(fics.agency_id = sca.agency_id
AND fics.del_flag = '0'
AND fics.month_id = #{monthId}
AND fics.index_code = #{indexCode}
AND fics.agency_id IN (SELECT AGENCY_ID FROM screen_customer_agency WHERE PARENT_AREA_CODE = #{areaCode} AND DEL_FLAG = 0)
)
WHERE sca.DEL_FLAG = '0'
GROUP BY agencyId) a
LEFT JOIN screen_customer_agency a2 ON a2.AGENCY_ID = a.parentId AND a2.DEL_FLAG = 0
GROUP BY a2.AGENCY_ID
</select>
</mapper>

91
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml

@ -67,28 +67,26 @@
OR INDEX_CODE = "fuwunengli")
</select>
<!-- 街道下级所有社区服务能力得分平均值 -->
<select id="selectSubCommAvgScore" resultType="com.epmet.dto.indexcal.SubCommunityAvgResultDTO">
<select id="selectSubCommAvgScoreNew" resultType="com.epmet.dto.indexcal.SubCommunityAvgResultDTO">
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>
<select id="selectListCommunityScore" resultType="com.epmet.dto.screen.FactIndexCommunityScoreDTO">
@ -149,46 +147,25 @@
OR cs.INDEX_CODE = "fuwunengli")
</select>
<!-- 街道下级所有社区得分平均值 存在下级客户 -->
<select id="selectSubCommAvgScoreExistSub" resultType="com.epmet.dto.indexcal.SubCommunityAvgResultDTO">
<select id="selectSubCommAvgScoreExistSubNotSelfNew" resultType="com.epmet.dto.indexcal.SubCommunityAvgResultDTO">
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
</select>
<select id="selectSubCommAvgScoreExistSubNotSelf" resultType="com.epmet.dto.indexcal.SubCommunityAvgResultDTO">
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.pid AS parentId
FROM
fact_index_community_score fics
LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = fics.AGENCY_ID
WHERE
fics.del_flag = '0'
AND sca.DEL_FLAG = 0
FROM screen_customer_agency sca
LEFT JOIN fact_index_community_score fics ON
( sca.AGENCY_ID = fics.PARENT_AGENCY_ID
AND fics.del_flag = '0'
AND fics.month_id = #{monthId}
AND fics.index_code = #{indexCode}
)
WHERE sca.DEL_FLAG = 0
AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%')
AND sca.`LEVEL` = 'community'
AND fics.month_id = #{monthId}
AND fics.index_code = #{indexCode}
GROUP BY parentId
GROUP BY sca.AGENCY_ID
</select>
</mapper>

47
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
</select>
<select id="selectGovernDeptScoreAvgNew" resultType="com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO">
SELECT
sca.agency_id,
#{monthId} AS monthId,
#{quarterId} AS quarterId,
#{yearId} AS yearId,
IFNULL(AVG( fidc.score ),0) AS score,
sca.customer_id,
sca.pid AS parentId
FROM screen_customer_agency sca
LEFT JOIN fact_index_dept_score fidc ON
(fidc.AGENCY_ID = sca.AGENCY_ID
AND fidc.del_flag = '0'
AND fidc.IS_TOTAL = '0'
AND fidc.customer_id = #{customerId}
AND fidc.month_id = #{monthId}
AND fidc.index_code = #{indexCode}
)
WHERE sca.DEL_FLAG = '0'
AND sca.level = 'district'
AND sca.customer_id = #{customerId}
GROUP BY sca.agency_id
</select>
<select id="selectGovernDeptScoreAvgExistsSubNotSelfNew" resultType="com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO">
SELECT
sca.agency_id,
fidc.month_id,
fidc.quarter_id,
fidc.year_id,
IFNULL(AVG( fidc.score ),0) AS score,
sca.customer_id,
sca.pid AS parentId
FROM screen_customer_agency sca
LEFT JOIN fact_index_dept_score fidc ON
(sca.AGENCY_ID = fidc.AGENCY_ID
AND fidc.del_flag = '0'
AND fidc.IS_TOTAL = '0'
AND fidc.month_id = #{monthId}
AND fidc.index_code = #{indexCode}
)
WHERE sca.DEL_FLAG = '0'
AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%')
AND sca.AREA_CODE != #{areaCode}
GROUP BY sca.agency_id
</select>
</mapper>

82
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml

@ -98,24 +98,16 @@
<!-- 查询(治理能力-区直部门相关数据 )当前月共上传了多少条记录 -->
<select id="selectCount" parameterType="com.epmet.dto.indexcal.CalculateCommonFormDTO" resultType="java.lang.Integer">
SELECT
count( 1 ) AS total
count( SCD.DEPT_ID ) AS total
FROM
fact_index_govrn_ablity_dept_monthly m
inner join screen_customer_dept scd
on(
m.DEPT_ID=scd.DEPT_ID
and scd.DEL_FLAG='0'
and scd.UP_TO_CAL='yes'
)
WHERE
m.DEL_FLAG = '0'
AND m.MONTH_ID=#{monthId}
screen_customer_dept scd
WHERE scd.DEL_FLAG='0'
and scd.UP_TO_CAL='yes'
<choose>
<when test="null!=subCustomerIds and subCustomerIds.size()>0">
and scd.AREA_CODE LIKE concat( #{customerAreaCode}, '%')
</when>
<otherwise>
AND m.CUSTOMER_ID =#{customerId}
and scd.CUSTOMER_ID=#{customerId}
</otherwise>
</choose>
@ -124,21 +116,18 @@
<!-- 计算最大最小值 -->
<select id="selectExtremeValue" parameterType="com.epmet.dto.indexcal.CalculateCommonFormDTO" resultType="java.util.Map">
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}, '%')
</when>
<otherwise>
AND m.CUSTOMER_ID =#{customerId}
and scd.CUSTOMER_ID=#{customerId}
</otherwise>
</choose>
@ -164,38 +152,36 @@
<!-- 分页查询事实记录 -->
<select id="selectListByMonthId" parameterType="map" resultType="java.util.Map">
SELECT
m.CUSTOMER_ID,
m.AGENCY_ID,
m.DEPT_ID,
m.MONTH_ID,
m.TRANSFERED_COUNT,
m.CLOSED_PROJECT_COUNT,
m.RESP_PROJECT_RATIO,
m.HANDLE_PROJECT_RATIO,
m.CLOSED_PROJECT_RATIO,
SATISFACTION_RATIO
scd.CUSTOMER_ID,
scd.PARENT_AGENCY_ID AS AGENCY_ID,
scd.DEPT_ID,
#{monthId} AS MONTH_ID,
IFNULL(m.TRANSFERED_COUNT,0) AS TRANSFERED_COUNT,
IFNULL(m.CLOSED_PROJECT_COUNT,0) AS CLOSED_PROJECT_COUNT,
IFNULL(m.RESP_PROJECT_RATIO,0) AS RESP_PROJECT_RATIO,
IFNULL(m.HANDLE_PROJECT_RATIO,0) AS HANDLE_PROJECT_RATIO,
IFNULL(m.CLOSED_PROJECT_RATIO,0) AS CLOSED_PROJECT_RATIO,
IFNULL(M.SATISFACTION_RATIO,0) AS SATISFACTION_RATIO
FROM
fact_index_govrn_ablity_dept_monthly m
inner join screen_customer_dept scd
screen_customer_dept scd
LEFT join fact_index_govrn_ablity_dept_monthly m
on(
m.DEPT_ID=scd.DEPT_ID
and scd.DEL_FLAG='0'
and scd.UP_TO_CAL='yes'
)
WHERE
m.DEL_FLAG = '0'
scd.DEPT_ID=m.DEPT_ID
AND m.DEL_FLAG = '0'
AND m.MONTH_ID =#{monthId}
)
WHERE scd.DEL_FLAG='0'
and scd.UP_TO_CAL='yes'
<choose>
<when test="null!=subCustomerIds and subCustomerIds.size()>0">
and scd.AREA_CODE LIKE concat( #{customerAreaCode}, '%')
</when>
<otherwise>
AND m.CUSTOMER_ID =#{customerId}
and scd.CUSTOMER_ID=#{customerId}
</otherwise>
</choose>
ORDER BY
m.DEPT_ID ASC
scd.DEPT_ID ASC
LIMIT #{offset},#{pageSize}
</select>

105
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml

@ -100,80 +100,73 @@
<!-- 当前客户下,所有网格的治理能力相关五级指标 -->
<select id="selectListGovrnAblityGrid" parameterType="com.epmet.dto.indexcal.PageQueryGridFormDTO" resultType="java.util.HashMap">
SELECT
m.CUSTOMER_ID,
m.GRID_ID,
m.MONTH_ID,
m.ISSUE_TOTAL,
m.AVG_ISSUE_COUNT,
m.ISSUE_TO_PROJECT_RATIO,
m.PROJECT_TOTAL,
m.SELF_SOLVE_PROJECT_COUNT,
m.RESOLVE_PROJECT_COUNT,
m.TRANSFER_RIGHT_RATIO,
m.SATISFACTION_RATIO
scg.CUSTOMER_ID,
scg.GRID_ID,
#{monthId} as MONTH_ID,
IFNULL(m.ISSUE_TOTAL,0) AS ISSUE_TOTAL,
IFNULL(m.AVG_ISSUE_COUNT,0) AS AVG_ISSUE_COUNT,
IFNULL(m.ISSUE_TO_PROJECT_RATIO,0) AS ISSUE_TO_PROJECT_RATIO,
IFNULL(m.PROJECT_TOTAL,0) AS PROJECT_TOTAL,
IFNULL(m.SELF_SOLVE_PROJECT_COUNT,0) AS SELF_SOLVE_PROJECT_COUNT,
IFNULL(m.RESOLVE_PROJECT_COUNT,0) AS RESOLVE_PROJECT_COUNT,
IFNULL(m.TRANSFER_RIGHT_RATIO,0) AS TRANSFER_RIGHT_RATIO,
IFNULL(m.SATISFACTION_RATIO,0) AS SATISFACTION_RATIO
FROM
fact_index_govrn_ablity_grid_monthly m
inner join screen_customer_grid scg
screen_customer_grid scg
LEFT join fact_index_govrn_ablity_grid_monthly m
on(
m.GRID_ID=scg.GRID_ID
and scg.DEL_FLAG='0'
and scg.UP_TO_CAL='yes'
)
WHERE
m.DEL_FLAG = '0'
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'
<choose>
<when test="null!=subCustomerIds and subCustomerIds.size()>0">
and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%')
</when>
<otherwise>
and m.CUSTOMER_ID=#{customerId}
and scg.CUSTOMER_ID=#{customerId}
</otherwise>
</choose>
order by m.GRID_ID asc
order by scg.GRID_ID asc
LIMIT #{pageIndex}, #{pageSize}
</select>
<!-- 查询治理能力,网格相关,各五级指标最大值,最小值 -->
<select id="selectGovrnAblityGridMinAndMax" parameterType="com.epmet.dto.indexcal.CalculateCommonFormDTO" resultType="java.util.Map">
SELECT
m.CUSTOMER_ID,
m.GRID_ID,
m.MONTH_ID,
MIN(m.ISSUE_TOTAL) AS ISSUE_TOTAL_MIN,
MAX(m.ISSUE_TOTAL) AS ISSUE_TOTAL_MAX,
MIN(m.AVG_ISSUE_COUNT) AS AVG_ISSUE_COUNT_MIN,
MAX(m.AVG_ISSUE_COUNT) AS AVG_ISSUE_COUNT_MAX,
MIN(m.ISSUE_TO_PROJECT_RATIO) AS ISSUE_TO_PROJECT_RATIO_MIN,
MAX(m.ISSUE_TO_PROJECT_RATIO) AS ISSUE_TO_PROJECT_RATIO_MAX,
MIN(m.PROJECT_TOTAL) AS PROJECT_TOTAL_MIN,
MAX(m.PROJECT_TOTAL) AS PROJECT_TOTAL_MAX,
MIN(m.SELF_SOLVE_PROJECT_COUNT) AS SELF_SOLVE_PROJECT_COUNT_MIN,
MAX(m.SELF_SOLVE_PROJECT_COUNT) AS SELF_SOLVE_PROJECT_COUNT_MAX,
MIN(m.RESOLVE_PROJECT_COUNT) AS RESOLVE_PROJECT_COUNT_MIN,
MAX(m.RESOLVE_PROJECT_COUNT) AS RESOLVE_PROJECT_COUNT_MAX,
MIN(m.TRANSFER_RIGHT_RATIO) AS TRANSFER_RIGHT_RATIO_MIN,
MAX(m.TRANSFER_RIGHT_RATIO) AS TRANSFER_RIGHT_RATIO_MAX,
MIN(m.SATISFACTION_RATIO) AS SATISFACTION_RATIO_MIN,
MAX(m.SATISFACTION_RATIO) AS SATISFACTION_RATIO_MAX
IFNULL(MIN(m.ISSUE_TOTAL),0) AS ISSUE_TOTAL_MIN,
IFNULL(MAX(m.ISSUE_TOTAL),0) AS ISSUE_TOTAL_MAX,
IFNULL(MIN(m.AVG_ISSUE_COUNT),0) AS AVG_ISSUE_COUNT_MIN,
IFNULL(MAX(m.AVG_ISSUE_COUNT),0) AS AVG_ISSUE_COUNT_MAX,
IFNULL(MIN(m.ISSUE_TO_PROJECT_RATIO),0) AS ISSUE_TO_PROJECT_RATIO_MIN,
IFNULL(MAX(m.ISSUE_TO_PROJECT_RATIO),0) AS ISSUE_TO_PROJECT_RATIO_MAX,
IFNULL(MIN(m.PROJECT_TOTAL),0) AS PROJECT_TOTAL_MIN,
IFNULL(MAX(m.PROJECT_TOTAL),0) AS PROJECT_TOTAL_MAX,
IFNULL(MIN(m.SELF_SOLVE_PROJECT_COUNT),0) AS SELF_SOLVE_PROJECT_COUNT_MIN,
IFNULL(MAX(m.SELF_SOLVE_PROJECT_COUNT),0) AS SELF_SOLVE_PROJECT_COUNT_MAX,
IFNULL(MIN(m.RESOLVE_PROJECT_COUNT),0) AS RESOLVE_PROJECT_COUNT_MIN,
IFNULL(MAX(m.RESOLVE_PROJECT_COUNT),0) AS RESOLVE_PROJECT_COUNT_MAX,
IFNULL(MIN(m.TRANSFER_RIGHT_RATIO),0) AS TRANSFER_RIGHT_RATIO_MIN,
IFNULL(MAX(m.TRANSFER_RIGHT_RATIO),0) AS TRANSFER_RIGHT_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_grid_monthly m
inner join screen_customer_grid scg
screen_customer_grid scg
left join fact_index_govrn_ablity_grid_monthly m
on(
m.GRID_ID=scg.GRID_ID
and scg.DEL_FLAG='0'
and scg.UP_TO_CAL='yes'
)
WHERE
m.DEL_FLAG = '0'
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'
<choose>
<when test="null!=subCustomerIds and subCustomerIds.size()>0">
and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%')
</when>
<otherwise>
and m.CUSTOMER_ID=#{customerId}
and scg.CUSTOMER_ID=#{customerId}
</otherwise>
</choose>
@ -181,24 +174,16 @@
<select id="selectCount" resultType="java.lang.Integer" parameterType="com.epmet.dto.indexcal.CalculateCommonFormDTO">
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}
<choose>
<when test="null!=subCustomerIds and subCustomerIds.size()>0">
and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%')
</when>
<otherwise>
AND m.CUSTOMER_ID =#{customerId}
and scg.CUSTOMER_ID=#{customerId}
</otherwise>
</choose>

82
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}
</select>
<select id="selectCommunityGovernAbilityNew" resultType="java.util.Map">
SELECT
sca.AGENCY_ID,
sca.PID AS PARENT_ID,
#{monthId} AS MONTH_ID,
#{quarterId} AS QUARTER_ID,
#{yearId} AS YEAR_ID,
IFNULL(om.TRANSFERED_COUNT,0) AS TRANSFERED_COUNT,
IFNULL(om.CLOSED_PROJECT_COUNT,0) AS CLOSED_PROJECT_COUNT,
IFNULL(om.RESP_PROJECT_RATIO,0) AS RESP_PROJECT_RATIO,
IFNULL(om.OVERDUE_PROJECT_RATIO,0) AS OVERDUE_PROJECT_RATIO,
IFNULL(om.CLOSED_PROJECT_RATIO,0) AS CLOSED_PROJECT_RATIO,
IFNULL(om.SATISFACTION_RATIO,0) AS SATISFACTION_RATIO,
IFNULL(om.HANDLE_PROJECT_RATIO,0) AS HANDLE_PROJECT_RATIO
FROM screen_customer_agency sca
LEFT JOIN fact_index_govrn_ablity_org_monthly om ON
(om.AGENCY_ID = sca.AGENCY_ID
AND om.del_flag = '0'
AND om.data_type = #{level}
AND om.customer_id = #{customerId}
AND om.month_id = #{monthId}
)
WHERE
sca.del_flag = '0'
AND sca.`LEVEL` = #{level}
AND sca.customer_id = #{customerId}
</select>
<select id="selectOrgByCustomer" resultType="com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity">
SELECT
AGENCY_ID,
@ -199,6 +228,33 @@
AND gm.PARENT_ID = '0'
</select>
<select id="selectCommunityGovernAbilityExistsSubNotSelfNew" resultType="java.util.Map">
SELECT
sca.AGENCY_ID,
sca.PID AS PARENT_ID,
#{monthId} AS MONTH_ID,
#{quarterId} AS QUARTER_ID,
#{yearId} AS YEAR_ID,
IFNULL(gm.TRANSFERED_COUNT,0) AS TRANSFERED_COUNT,
IFNULL(gm.CLOSED_PROJECT_COUNT,0) AS CLOSED_PROJECT_COUNT,
IFNULL(gm.RESP_PROJECT_RATIO,0) AS RESP_PROJECT_RATIO,
IFNULL(gm.OVERDUE_PROJECT_RATIO,0) AS OVERDUE_PROJECT_RATIO,
IFNULL(gm.CLOSED_PROJECT_RATIO,0) AS CLOSED_PROJECT_RATIO,
IFNULL(gm.SATISFACTION_RATIO,0) AS SATISFACTION_RATIO,
IFNULL(gm.HANDLE_PROJECT_RATIO,0) AS HANDLE_PROJECT_RATIO
FROM screen_customer_agency sca
LEFT JOIN fact_index_govrn_ablity_org_monthly gm ON
(sca.AGENCY_ID = gm.AGENCY_ID
AND gm.del_flag = '0'
AND gm.month_id = #{monthId}
AND gm.DATA_TYPE = #{level}
AND gm.PARENT_ID = '0'
)
WHERE sca.DEL_FLAG = '0'
AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%')
AND sca.AREA_CODE != #{areaCode}
</select>
<!-- 孔村单独查询 -->
<select id="selectCommunityGovernAbilityIsKongCun" resultType="java.util.Map">
SELECT
@ -226,4 +282,30 @@
AND sca.AREA_CODE != #{areaCode}
AND gm.PARENT_ID != '0'
</select>
<select id="selectCommunityGovernAbilityIsKongCunNew" resultType="java.util.Map">
SELECT
sca.AGENCY_ID,
sca.pid AS PARENT_ID,
#{monthId} AS MONTH_ID,
#{quarterId} AS QUARTER_ID,
#{yearId} AS YEAR_ID,
IFNULL(ROUND(SUM(gm.TRANSFERED_COUNT),6),0) AS TRANSFERED_COUNT,
IFNULL(ROUND(SUM(gm.CLOSED_PROJECT_COUNT),6),0) AS CLOSED_PROJECT_COUNT,
IFNULL(ROUND(AVG(gm.RESP_PROJECT_RATIO),6),0) AS RESP_PROJECT_RATIO,
IFNULL(ROUND(AVG(gm.OVERDUE_PROJECT_RATIO),6),0) AS OVERDUE_PROJECT_RATIO,
IFNULL(ROUND(AVG(gm.CLOSED_PROJECT_RATIO),6),0) AS CLOSED_PROJECT_RATIO,
IFNULL(ROUND(AVG(gm.SATISFACTION_RATIO),6),0) AS SATISFACTION_RATIO,
IFNULL(ROUND(AVG(gm.HANDLE_PROJECT_RATIO),6),0) AS HANDLE_PROJECT_RATIO
FROM screen_customer_agency sca
LEFT JOIN fact_index_govrn_ablity_org_monthly gm ON
(gm.AGENCY_ID = sca.AGENCY_ID
AND gm.del_flag = '0'
AND gm.month_id = #{monthId}
AND gm.DATA_TYPE = 'street'
AND gm.PARENT_ID != '0'
)
WHERE sca.DEL_FLAG = '0'
AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%')
AND sca.AREA_CODE != #{areaCode}
</select>
</mapper>

156
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml

@ -105,98 +105,92 @@
</insert>
<!-- 这块逻辑也要改为以screen_customer_grid表为主表,没有五级指标值的网格,赋值为0 -->
<!-- 当前客户下,所有网格的党建能力相关五级指标 -->
<select id="selectListPartyAblityGrid" parameterType="com.epmet.dto.indexcal.PageQueryGridFormDTO" resultType="java.util.HashMap">
SELECT
m.CUSTOMER_ID,
m.GRID_ID,
m.MONTH_ID,
m.USER_COUNT,
m.PARTY_COUNT,
m.ACTIVE_USER_COUNT,
m.ACTIVE_PARTY_COUNT,
m.PARTY_AVG_TOPIC_COUNT,
m.USER_AVG_TOPIC_COUNT,
m.PARTY_AVG_SHIFT_PROJECT_COUNT,
m.USER_AVG_SHIFT_PROJECT_COUNT,
m.CREATE_GROUP_PARTY_COUNT,
m.PUBLISH_ARTICLE_COUNT,
m.ISSUE_TO_PROJECT_RATIO,
m.CREATE_THREE_MEETS_COUNT,
m.JOIN_THREE_MEETS_COUNT
scg.CUSTOMER_ID,
scg.GRID_ID,
#{monthId} as MONTH_ID,
IFNULL(m.USER_COUNT,0) AS USER_COUNT,
IFNULL(m.PARTY_COUNT,0) AS PARTY_COUNT,
IFNULL(m.ACTIVE_USER_COUNT,0) AS ACTIVE_USER_COUNT,
IFNULL(m.ACTIVE_PARTY_COUNT,0) AS ACTIVE_PARTY_COUNT,
IFNULL(m.PARTY_AVG_TOPIC_COUNT,0) AS PARTY_AVG_TOPIC_COUNT,
IFNULL(m.USER_AVG_TOPIC_COUNT,0) AS USER_AVG_TOPIC_COUNT,
IFNULL(m.PARTY_AVG_SHIFT_PROJECT_COUNT,0) AS PARTY_AVG_SHIFT_PROJECT_COUNT,
IFNULL(m.USER_AVG_SHIFT_PROJECT_COUNT,0) AS USER_AVG_SHIFT_PROJECT_COUNT,
IFNULL(m.CREATE_GROUP_PARTY_COUNT,0) AS CREATE_GROUP_PARTY_COUNT,
IFNULL(m.PUBLISH_ARTICLE_COUNT,0) AS PUBLISH_ARTICLE_COUNT,
IFNULL(m.ISSUE_TO_PROJECT_RATIO,0) AS ISSUE_TO_PROJECT_RATIO,
IFNULL(m.CREATE_THREE_MEETS_COUNT,0) AS CREATE_THREE_MEETS_COUNT,
IFNULL(m.JOIN_THREE_MEETS_COUNT,0) AS JOIN_THREE_MEETS_COUNT
FROM
fact_index_party_ablity_grid_monthly m
inner join screen_customer_grid scg
screen_customer_grid scg
left join fact_index_party_ablity_grid_monthly m
on(
m.GRID_ID=scg.GRID_ID
and scg.DEL_FLAG='0'
and scg.UP_TO_CAL='yes'
scg.GRID_ID=m.GRID_ID
AND m.DEL_FLAG = '0'
AND m.MONTH_ID =#{monthId}
)
WHERE
m.DEL_FLAG = '0'
AND m.MONTH_ID =#{monthId}
WHERE scg.DEL_FLAG='0'
and scg.UP_TO_CAL='yes'
<choose>
<when test="null!=subCustomerIds and subCustomerIds.size()>0">
and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%')
</when>
<otherwise>
AND m.CUSTOMER_ID =#{customerId}
and scg.CUSTOMER_ID=#{customerId}
</otherwise>
</choose>
order by m.GRID_ID asc
order by scg.GRID_ID asc
LIMIT #{pageIndex}, #{pageSize}
</select>
<!-- 查询党建能力,网格相关,各五级指标最大值,最小值 -->
<select id="selectPartyAblityGridMinAndMax" resultType="java.util.Map" parameterType="com.epmet.dto.indexcal.CalculateCommonFormDTO">
SELECT
m.CUSTOMER_ID,
m.GRID_ID,
m.MONTH_ID,
MIN(m.USER_COUNT) AS USER_COUNT_MIN,
MAX(m.USER_COUNT) AS USER_COUNT_MAX,
MIN(m.PARTY_COUNT) AS PARTY_COUNT_MIN,
MAX(m.PARTY_COUNT) AS PARTY_COUNT_MAX,
MIN(m.ACTIVE_USER_COUNT) AS ACTIVE_USER_COUNT_MIN,
MAX(m.ACTIVE_USER_COUNT) AS ACTIVE_USER_COUNT_MAX,
MIN(m.ACTIVE_PARTY_COUNT) AS ACTIVE_PARTY_COUNT_MIN,
MAX(m.ACTIVE_PARTY_COUNT) AS ACTIVE_PARTY_COUNT_MAX,
MIN(m.PARTY_AVG_TOPIC_COUNT) AS PARTY_AVG_TOPIC_COUNT_MIN,
MAX(m.PARTY_AVG_TOPIC_COUNT) AS PARTY_AVG_TOPIC_COUNT_MAX,
MIN(m.USER_AVG_TOPIC_COUNT) AS USER_AVG_TOPIC_COUNT_MIN,
MAX(m.USER_AVG_TOPIC_COUNT) AS USER_AVG_TOPIC_COUNT_MAX,
MIN(m.PARTY_AVG_SHIFT_PROJECT_COUNT) AS PARTY_AVG_SHIFT_PROJECT_COUNT_MIN,
MAX(m.PARTY_AVG_SHIFT_PROJECT_COUNT) AS PARTY_AVG_SHIFT_PROJECT_COUNT_MAX,
MIN(m.USER_AVG_SHIFT_PROJECT_COUNT) AS USER_AVG_SHIFT_PROJECT_COUNT_MIN,
MAX(m.USER_AVG_SHIFT_PROJECT_COUNT) AS USER_AVG_SHIFT_PROJECT_COUNT_MAX,
MIN(m.CREATE_GROUP_PARTY_COUNT) AS CREATE_GROUP_PARTY_COUNT_MIN,
MAX(m.CREATE_GROUP_PARTY_COUNT) AS CREATE_GROUP_PARTY_COUNT_MAX,
MIN(m.PUBLISH_ARTICLE_COUNT) AS PUBLISH_ARTICLE_COUNT_MIN,
MAX(m.PUBLISH_ARTICLE_COUNT) AS PUBLISH_ARTICLE_COUNT_MAX,
MIN(m.ISSUE_TO_PROJECT_RATIO) AS ISSUE_TO_PROJECT_RATIO_MIN,
MAX(m.ISSUE_TO_PROJECT_RATIO) AS ISSUE_TO_PROJECT_RATIO_MAX,
MIN(m.CREATE_THREE_MEETS_COUNT) AS CREATE_THREE_MEETS_COUNT_MIN,
MAX(m.CREATE_THREE_MEETS_COUNT) AS CREATE_THREE_MEETS_COUNT_MAX,
MIN(m.JOIN_THREE_MEETS_COUNT) AS JOIN_THREE_MEETS_COUNT_MIN,
MAX(m.JOIN_THREE_MEETS_COUNT) AS JOIN_THREE_MEETS_COUNT_MAX
IFNULL(MIN(m.USER_COUNT),0) AS USER_COUNT_MIN,
IFNULL(MAX(m.USER_COUNT),0) AS USER_COUNT_MAX,
IFNULL(MIN(m.PARTY_COUNT),0) AS PARTY_COUNT_MIN,
IFNULL(MAX(m.PARTY_COUNT),0) AS PARTY_COUNT_MAX,
IFNULL(MIN(m.ACTIVE_USER_COUNT),0) AS ACTIVE_USER_COUNT_MIN,
IFNULL(MAX(m.ACTIVE_USER_COUNT),0) AS ACTIVE_USER_COUNT_MAX,
IFNULL(MIN(m.ACTIVE_PARTY_COUNT),0) AS ACTIVE_PARTY_COUNT_MIN,
IFNULL(MAX(m.ACTIVE_PARTY_COUNT),0) AS ACTIVE_PARTY_COUNT_MAX,
IFNULL(MIN(m.PARTY_AVG_TOPIC_COUNT),0) AS PARTY_AVG_TOPIC_COUNT_MIN,
IFNULL(MAX(m.PARTY_AVG_TOPIC_COUNT),0) AS PARTY_AVG_TOPIC_COUNT_MAX,
IFNULL(MIN(m.USER_AVG_TOPIC_COUNT),0) AS USER_AVG_TOPIC_COUNT_MIN,
IFNULL(MAX(m.USER_AVG_TOPIC_COUNT),0) AS USER_AVG_TOPIC_COUNT_MAX,
IFNULL(MIN(m.PARTY_AVG_SHIFT_PROJECT_COUNT),0) AS PARTY_AVG_SHIFT_PROJECT_COUNT_MIN,
IFNULL(MAX(m.PARTY_AVG_SHIFT_PROJECT_COUNT),0) AS PARTY_AVG_SHIFT_PROJECT_COUNT_MAX,
IFNULL(MIN(m.USER_AVG_SHIFT_PROJECT_COUNT),0) AS USER_AVG_SHIFT_PROJECT_COUNT_MIN,
IFNULL(MAX(m.USER_AVG_SHIFT_PROJECT_COUNT),0) AS USER_AVG_SHIFT_PROJECT_COUNT_MAX,
IFNULL(MIN(m.CREATE_GROUP_PARTY_COUNT),0) AS CREATE_GROUP_PARTY_COUNT_MIN,
IFNULL(MAX(m.CREATE_GROUP_PARTY_COUNT),0) AS CREATE_GROUP_PARTY_COUNT_MAX,
IFNULL(MIN(m.PUBLISH_ARTICLE_COUNT),0) AS PUBLISH_ARTICLE_COUNT_MIN,
IFNULL(MAX(m.PUBLISH_ARTICLE_COUNT),0) AS PUBLISH_ARTICLE_COUNT_MAX,
IFNULL(MIN(m.ISSUE_TO_PROJECT_RATIO),0) AS ISSUE_TO_PROJECT_RATIO_MIN,
IFNULL(MAX(m.ISSUE_TO_PROJECT_RATIO),0) AS ISSUE_TO_PROJECT_RATIO_MAX,
IFNULL(MIN(m.CREATE_THREE_MEETS_COUNT),0) AS CREATE_THREE_MEETS_COUNT_MIN,
IFNULL(MAX(m.CREATE_THREE_MEETS_COUNT),0) AS CREATE_THREE_MEETS_COUNT_MAX,
IFNULL(MIN(m.JOIN_THREE_MEETS_COUNT),0) AS JOIN_THREE_MEETS_COUNT_MIN,
IFNULL(MAX(m.JOIN_THREE_MEETS_COUNT),0) AS JOIN_THREE_MEETS_COUNT_MAX
FROM
fact_index_party_ablity_grid_monthly m
inner join screen_customer_grid scg
screen_customer_grid scg
LEFT join fact_index_party_ablity_grid_monthly m
on(
m.GRID_ID=scg.GRID_ID
and scg.DEL_FLAG='0'
and scg.UP_TO_CAL='yes'
)
WHERE
m.DEL_FLAG = '0'
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'
<choose>
<when test="null!=subCustomerIds and subCustomerIds.size()>0">
and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%')
</when>
<otherwise>
AND m.CUSTOMER_ID =#{customerId}
and scg.CUSTOMER_ID=#{customerId}
</otherwise>
</choose>
@ -204,28 +198,20 @@
<!-- 查询 党建能力-网格相关事实表 这个月共上传记录数 -->
<select id="selectCount" parameterType="com.epmet.dto.indexcal.CalculateCommonFormDTO" resultType="java.lang.Integer">
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}
<choose>
<when test="null!=subCustomerIds and subCustomerIds.size()>0">
and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%')
</when>
<otherwise>
AND m.CUSTOMER_ID =#{customerId}
and scg.CUSTOMER_ID=#{customerId}
</otherwise>
</choose>
screen_customer_grid scg
WHERE scg.DEL_FLAG='0'
and scg.UP_TO_CAL='yes'
<choose>
<when test="null!=subCustomerIds and subCustomerIds.size()>0">
and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%')
</when>
<otherwise>
and scg.CUSTOMER_ID=#{customerId}
</otherwise>
</choose>
</select>
<!-- 场景:客户这个月只上传了一个网格的事实记录 -->

63
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml

@ -112,6 +112,29 @@
AND month_id = #{monthId}
</select>
<select id="selectPublishArticleCountMapNew" resultType="java.util.Map">
SELECT
sca.AGENCY_ID,
sca.PID AS PARENT_ID,
#{monthId} AS MONTH_ID,
#{quarterId} AS QUARTER_ID,
#{yearId} AS YEAR_ID,
ifnull(om.PUBLISH_ARTICLE_COUNT,0) AS PUBLISH_ARTICLE_COUNT,
sca.CUSTOMER_ID
FROM screen_customer_agency sca
LEFT JOIN fact_index_party_ablity_org_monthly om ON
(om.AGENCY_ID = sca.AGENCY_ID
AND om.del_flag = '0'
AND om.data_type = #{level}
AND om.customer_id = #{customerId}
AND om.month_id = #{monthId}
)
WHERE
sca.DEL_FLAG = 0
AND sca.CUSTOMER_ID = #{customerId}
AND sca.`LEVEL` = #{level}
</select>
<!-- 查询社区下的发文数 Map【根据areaCode】 -->
<select id="selectPublishArticleCountMapbyAreaCode" resultType="java.util.Map">
SELECT
@ -149,6 +172,27 @@
AND sca.PARENT_AREA_CODE = #{areaCode}
AND pm.month_id = #{monthId}
</select>
<select id="selectPublishArticleCountMapExistSubStreetNew" resultType="java.util.Map">
SELECT
sca.AGENCY_ID,
sca.pid AS PARENT_ID,
#{monthId} AS MONTH_ID,
#{quarterId} AS QUARTER_ID,
#{yearId} AS YEAR_ID,
IFNULL(pm.PUBLISH_ARTICLE_COUNT,0) AS PUBLISH_ARTICLE_COUNT,
sca.CUSTOMER_ID
FROM screen_customer_agency sca
LEFT JOIN fact_index_party_ablity_org_monthly pm ON
(sca.AGENCY_ID = pm.AGENCY_ID
AND pm.del_flag = '0'
AND pm.month_id = #{monthId}
)
WHERE
sca.DEL_FLAG = '0'
AND sca.PARENT_AREA_CODE = #{areaCode}
</select>
<select id="selectPublishArticleCountMapExistSubNotSelf" resultType="java.util.Map">
SELECT
pm.AGENCY_ID,
@ -166,6 +210,25 @@
AND sca.AREA_CODE = #{areaCode}
AND pm.month_id = #{monthId}
</select>
<select id="selectPublishArticleCountMapExistSubNotSelfNew" resultType="java.util.Map">
SELECT
pm.AGENCY_ID,
pm.PARENT_ID,
pm.MONTH_ID,
pm.QUARTER_ID,
pm.YEAR_ID,
pm.PUBLISH_ARTICLE_COUNT,
pm.CUSTOMER_ID
FROM
fact_index_party_ablity_org_monthly pm
LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = pm.AGENCY_ID
WHERE
pm.del_flag = '0'
AND sca.AREA_CODE = #{areaCode}
AND pm.month_id = #{monthId}
</select>
<select id="selectPublishArticleCountMapbyAreaCodeNotSelf" resultType="java.util.Map">
SELECT
fm.AGENCY_ID,

80
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml

@ -81,51 +81,59 @@
<!-- 当前客户下,所有网格的治理能力相关五级指标 -->
<select id="selectListServiceAblityGrid" parameterType="com.epmet.dto.indexcal.PageQueryGridFormDTO" resultType="java.util.HashMap">
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'
<choose>
<when test="null!=subCustomerIds and subCustomerIds.size()>0">
and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%')
</when>
<otherwise>
and scg.CUSTOMER_ID=#{customerId}
</otherwise>
</choose>
ORDER BY
scg.GRID_ID ASC
LIMIT #{pageIndex}, #{pageSize}
</select>
<!-- 查询 服务能力,网格相关,各五级指标最大值,最小值 -->
<select id="selectServiceAblityGridMinAndMax" parameterType="com.epmet.dto.indexcal.CalculateCommonFormDTO" resultType="java.util.Map">
SELECT
m.CUSTOMER_ID,
m.GRID_ID,
m.MONTH_ID,
MIN(m.ACTIVITY_COUNT) AS ACTIVITY_COUNT_MIN,
MAX(m.ACTIVITY_COUNT) AS ACTIVITY_COUNT_MAX,
MIN(m.VOLUNTEER_RATIO) AS VOLUNTEER_RATIO_MIN,
MAX(m.VOLUNTEER_RATIO) AS VOLUNTEER_RATIO_MAX,
MIN(m.PARTY_VOLUNTEER_RATIO) AS PARTY_VOLUNTEER_RATIO_MIN,
MAX(m.PARTY_VOLUNTEER_RATIO) AS PARTY_VOLUNTEER_RATIO_MAX
IFNULL(MIN(m.ACTIVITY_COUNT),0) AS ACTIVITY_COUNT_MIN,
IFNULL(MAX(m.ACTIVITY_COUNT),0) AS ACTIVITY_COUNT_MAX,
IFNULL(MIN(m.VOLUNTEER_RATIO),0) AS VOLUNTEER_RATIO_MIN,
IFNULL(MAX(m.VOLUNTEER_RATIO),0) AS VOLUNTEER_RATIO_MAX,
IFNULL(MIN(m.PARTY_VOLUNTEER_RATIO),0) AS PARTY_VOLUNTEER_RATIO_MIN,
IFNULL(MAX(m.PARTY_VOLUNTEER_RATIO),0) AS PARTY_VOLUNTEER_RATIO_MAX
FROM
fact_index_service_ablity_grid_monthly m
inner join screen_customer_grid scg
screen_customer_grid scg
left join fact_index_service_ablity_grid_monthly m
on(
m.GRID_ID=scg.GRID_ID
and scg.DEL_FLAG='0'
and scg.UP_TO_CAL='yes'
scg.GRID_ID=m.GRID_ID
and m.DEL_FLAG = '0'
and m.MONTH_ID=#{monthId}
)
WHERE
m.DEL_FLAG = '0'
and m.MONTH_ID=#{monthId}
scg.DEL_FLAG='0'
and scg.UP_TO_CAL='yes'
<choose>
<when test="null!=subCustomerIds and subCustomerIds.size()>0">
and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%')
</when>
<otherwise>
and m.CUSTOMER_ID=#{customerId}
and scg.CUSTOMER_ID=#{customerId}
</otherwise>
</choose>
@ -134,24 +142,16 @@
<!-- 查询(服务能力-网格相关事实表)共上传记录数 -->
<select id="selectCount" parameterType="com.epmet.dto.indexcal.CalculateCommonFormDTO" resultType="java.lang.Integer">
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}
<choose>
<when test="null!=subCustomerIds and subCustomerIds.size()>0">
and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%')
</when>
<otherwise>
AND m.CUSTOMER_ID =#{customerId}
and scg.CUSTOMER_ID=#{customerId}
</otherwise>
</choose>

67
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml

@ -112,6 +112,29 @@
AND month_id = #{monthId}
</select>
<select id="selectActivityCountMapNew" resultType="java.util.Map">
SELECT
sca.AGENCY_ID,
sca.PID AS PARENT_ID,
#{monthId} AS MONTH_ID,
#{quarterId} AS QUARTER_ID,
#{yearId} AS YEAR_ID,
IFNULL(om.ACTIVITY_COUNT,0) AS ACTIVITY_COUNT,
sca.CUSTOMER_ID
FROM screen_customer_agency sca
LEFT JOIN fact_index_service_ablity_org_monthly om ON
(om.AGENCY_ID = sca.AGENCY_ID
AND om.del_flag = '0'
AND om.data_type = #{level}
AND om.customer_id = #{customerId}
AND om.month_id = #{monthId}
)
WHERE
sca.del_flag = 0
AND sca.`LEVEL` = #{level}
AND sca.CUSTOMER_ID = #{customerId}
</select>
<!-- 社区活动组织次数 存在下级客户 -->
<select id="selectActivityCountMapExistsSub" resultType="java.util.Map">
SELECT
@ -172,4 +195,48 @@
AND sm.month_id = #{monthId}
AND sm.PARENT_ID != '0'
</select>
<select id="selectActivityCountMapExistsSubNew" resultType="java.util.Map">
SELECT
sca.AGENCY_ID,
sca.PID AS PARENT_ID,
#{monthId} AS MONTH_ID,
#{quarterId} AS QUARTER_ID,
#{yearId} AS YEAR_ID,
IFNULL(sm.ACTIVITY_COUNT,0) AS ACTIVITY_COUNT,
sca.CUSTOMER_ID
FROM screen_customer_agency sca
LEFT JOIN fact_index_service_ablity_org_monthly sm ON
(sm.AGENCY_ID = sca.AGENCY_ID
AND sm.del_flag = '0'
AND sm.DATA_TYPE = 'street'
AND sm.month_id = #{monthId}
AND sm.PARENT_ID = '0'
)
WHERE sca.DEL_FLAG = '0'
AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%')
AND sca.AREA_CODE != #{areaCode}
</select>
<select id="selectActivityCountMapIsKongCunNew" resultType="java.util.Map">
SELECT
sca.AGENCY_ID,
sca.PID AS PARENT_ID,
#{monthId} AS MONTH_ID,
#{quarterId} AS QUARTER_ID,
#{yearId} AS YEAR_ID,
ROUND(SUM(sm.ACTIVITY_COUNT),6) AS ACTIVITY_COUNT,
sca.CUSTOMER_ID
FROM screen_customer_agency sca
LEFT JOIN fact_index_service_ablity_org_monthly sm ON
(sca.AGENCY_ID = sm.AGENCY_ID
AND sm.del_flag = '0'
AND sm.DATA_TYPE = 'street'
AND sm.month_id = #{monthId}
AND sm.PARENT_ID != '0'
)
WHERE sca.DEL_FLAG = '0'
AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%')
AND sca.AREA_CODE != #{areaCode}
</select>
</mapper>

Loading…
Cancel
Save