Browse Source

street级别 能力指数修改

master
zxc 4 years ago
parent
commit
1045eedced
  1. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java
  2. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java
  3. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java
  4. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java
  5. 44
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java
  6. 90
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml
  7. 82
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml
  8. 63
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml
  9. 67
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml

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

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);
/**

44
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java

@ -225,12 +225,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> 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);
if (CollectionUtils.isEmpty(subCommPartyAvgScore)) {
log.warn(IndexCalConstant.COMMUNITY_PARTY_AVG_NULL);
} else if (subCommPartyAvgScore.size() > NumConstant.ZERO) {
@ -251,7 +253,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 {
@ -300,11 +302,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> 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);
if (CollectionUtils.isEmpty(subGridGovernAvg)){
log.warn("查询街道下属所有社区治理能力汇总为空");
}else if (subGridGovernAvg.size() > NumConstant.ZERO) {
@ -324,7 +328,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{
@ -372,12 +376,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> 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);
if (CollectionUtils.isEmpty(subCommServiceAvg)) {
log.warn("查询街道下属社区服务能力得分平均值为空");
} else if (subCommServiceAvg.size() > NumConstant.ZERO) {
@ -396,7 +402,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{
@ -610,12 +616,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);
@ -638,7 +646,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 {
@ -688,11 +696,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("查询街道下属所有社区治理能力汇总为空");
@ -763,12 +773,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("查询街道下属社区服务能力得分平均值为空");
@ -905,9 +917,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"));
@ -924,9 +938,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"));

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

@ -67,27 +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,
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.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">
@ -148,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>

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>

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,

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