Browse Source

无用sql删除

dev_shibei_match
zxc 5 years ago
parent
commit
1e0f2adc4e
  1. 51
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySubScoreDao.java
  2. 50
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySubScoreDao.java
  3. 115
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml
  4. 113
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySubScoreDao.xml

51
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySubScoreDao.java

@ -52,55 +52,4 @@ public interface AgencySubScoreDao extends BaseDao<AgencyScoreEntity> {
*/ */
void deleteOldRecord(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("dataType") String dataType); void deleteOldRecord(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("dataType") String dataType);
/**
* @param customerId
* @param monthId
* @Description 查询fact_index_agency_score相关信息
* @author zxc
* @date 2020/9/1 9:41 上午
*/
List<AgencyScoreDTO> selectAgencyScoreInfo(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("dataType") String dataType);
/**
* @param customerId
* @param monthId
* @Description 区下级街道得分平均值
* @author zxc
* @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);
/**
* 根据入参查询 /街道相关分数表 记录
*
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.indexcal.AgencyScoreDTO>
* @Author zhangyong
* @Date 10:43 2020-09-03
**/
List<AgencyScoreDTO> selectListAgencyScore(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 批量插入区/街道相关分数表
*
* @param list
* @param customerId
* @return void
* @Author zhangyong
* @Date 11:11 2020-09-04
**/
void batchInsertAgencyScoreData(@Param("list") List<AgencyScoreEntity> list, @Param("customerId") String customerId);
/**
* 根据入参查询 /街道相关分数表id
*
* @param customerId
* @param monthId
* @return java.util.List<java.lang.String>
* @Author zhangyong
* @Date 10:43 2020-09-03
**/
List<String> selectListAgencyId(@Param("customerId") String customerId, @Param("monthId") String monthId);
} }

50
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySubScoreDao.java

@ -52,54 +52,4 @@ public interface CommunitySubScoreDao extends BaseDao<FactIndexCommunityScoreEnt
*/ */
void deleteOldRecord(@Param("customerId") String customerId, @Param("monthId") String monthId); void deleteOldRecord(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* @param customerId
* @param monthId
* @Description 查询社区相关信息
* @author zxc
* @date 2020/9/1 9:41 上午
*/
List<FactIndexCommunityScoreDTO> selectCommunityInfo(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 根据入参查询 查询社区相关信息
*
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.screen.FactIndexCommunityScoreDTO>
* @Author zhangyong
* @Date 10:43 2020-09-03
**/
List<FactIndexCommunityScoreDTO> selectListCommunityScore(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* @param customerId
* @param monthId
* @Description 街道下级所有社区得分平均值
* @author zxc
* @date 2020/8/31 1:51 下午
*/
List<SubCommunityAvgResultDTO> selectSubCommAvgScore(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("indexCode") String indexCode);
/**
* 批量插入 社区相关分数表
*
* @param list
* @param customerId
* @return void
* @Author zhangyong
* @Date 11:11 2020-09-04
**/
void batchInsertCommunityScoreData(@Param("list") List<FactIndexCommunityScoreEntity> list, @Param("customerId") String customerId);
/**
* 根据入参查询 查询社区id
*
* @param customerId
* @param monthId
* @return java.util.List<java.util.String>
* @Author zhangyong
* @Date 10:43 2020-09-03
**/
List<String> selectListCommunityId(@Param("customerId") String customerId, @Param("monthId") String monthId);
} }

115
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml

@ -42,119 +42,4 @@
AND data_type = #{dataType} AND data_type = #{dataType}
</delete> </delete>
<select id="selectListAgencyScore" resultType="com.epmet.dto.indexcal.AgencyScoreDTO">
SELECT
CUSTOMER_ID customerId,
AGENCY_ID agencyId,
PARENT_AGENCY_ID parentAgencyId,
YEAR_ID yearId,
MONTH_ID monthId,
SCORE score,
INDEX_CODE indexCode
FROM
fact_index_agency_score
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
ORDER BY AGENCY_ID
</select>
<!-- 查询街道相关信息 -->
<select id="selectAgencyScoreInfo" resultType="com.epmet.dto.indexcal.AgencyScoreDTO">
SELECT
CUSTOMER_ID,
AGENCY_ID,
MONTH_ID,
QUARTER_ID,
YEAR_ID,
SCORE,
INDEX_CODE,
PARENT_AGENCY_ID
FROM
fact_index_agency_score
WHERE
del_flag = 0
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
AND INDEX_CODE != "jiedaoxiangguan"
AND data_type = #{dataType}
</select>
<select id="selectAgencyScoreAvg" resultType="com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO">
SELECT
fics.agency_id,
fics.month_id,
fics.quarter_id,
fics.year_id,
ROUND(AVG( fics.score ),6) AS score,
fics.customer_id,
PARENT_AGENCY_ID AS parentId
FROM
fact_index_agency_score fics
WHERE
fics.del_flag = '0'
AND fics.customer_id = #{customerId}
AND fics.month_id = #{monthId}
AND fics.index_code = #{indexCode}
AND fics.DATA_TYPE = #{dataType}
GROUP BY fics.parent_agency_id
</select>
<insert id="batchInsertAgencyScoreData" parameterType="map">
insert into fact_index_agency_score
(
ID,
CUSTOMER_ID,
AGENCY_ID,
PARENT_AGENCY_ID,
YEAR_ID,
QUARTER_ID,
MONTH_ID,
DATA_TYPE,
SCORE,
INDEX_CODE,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
) values
<foreach collection="list" item="item" index="index" separator=",">
(
(SELECT REPLACE(UUID(), '-', '') AS id),
#{customerId},
#{item.agencyId},
#{item.parentAgencyId},
#{item.yearId},
#{item.quarterId},
#{item.monthId},
#{item.dataType},
#{item.score},
#{item.indexCode},
0,
0,
'APP_USER',
now(),
'APP_USER',
now()
)
</foreach>
</insert>
<select id="selectListAgencyId" resultType="String">
SELECT
AGENCY_ID agencyId
FROM
fact_index_agency_score
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
ORDER BY AGENCY_ID
</select>
</mapper> </mapper>

113
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySubScoreDao.xml

@ -40,117 +40,4 @@
AND month_id = #{monthId} AND month_id = #{monthId}
</delete> </delete>
<!-- 查询社区相关信息 -->
<select id="selectCommunityInfo" resultType="com.epmet.dto.screen.FactIndexCommunityScoreDTO">
SELECT
CUSTOMER_ID,
AGENCY_ID,
MONTH_ID,
QUARTER_ID,
YEAR_ID,
SCORE,
INDEX_CODE,
PARENT_AGENCY_ID
FROM
fact_index_community_score
WHERE
del_flag = 0
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
AND INDEX_CODE = "dangjiannengli"
OR INDEX_CODE = "zhilinengli"
OR INDEX_CODE = "fuwunengli"
</select>
<!-- 街道下级所有社区服务能力得分平均值 -->
<select id="selectSubCommAvgScore" 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.PARENT_AGENCY_ID
WHERE
fics.del_flag = '0'
AND sca.DEL_FLAG = 0
AND fics.customer_id = #{customerId}
AND fics.month_id = #{monthId}
AND fics.index_code = #{indexCode}
GROUP BY fics.parent_agency_id
</select>
<select id="selectListCommunityScore" resultType="com.epmet.dto.screen.FactIndexCommunityScoreDTO">
SELECT
CUSTOMER_ID customerId,
AGENCY_ID agencyId,
PARENT_AGENCY_ID parentAgencyId,
YEAR_ID yearId,
MONTH_ID monthId,
SCORE score,
INDEX_CODE indexCode
FROM
fact_index_community_score
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
ORDER BY AGENCY_ID
</select>
<insert id="batchInsertCommunityScoreData" parameterType="map">
insert into fact_index_community_score
(
ID,
CUSTOMER_ID,
AGENCY_ID,
PARENT_AGENCY_ID,
YEAR_ID,
QUARTER_ID,
MONTH_ID,
SCORE,
INDEX_CODE,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
) values
<foreach collection="list" item="item" index="index" separator=",">
(
(SELECT REPLACE(UUID(), '-', '') AS id),
#{customerId},
#{item.agencyId},
#{item.parentAgencyId},
#{item.yearId},
#{item.quarterId},
#{item.monthId},
#{item.score},
#{item.indexCode},
0,
0,
'APP_USER',
now(),
'APP_USER',
now()
)
</foreach>
</insert>
<select id="selectListCommunityId" resultType="String">
SELECT
AGENCY_ID agencyId
FROM
fact_index_community_score
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
ORDER BY AGENCY_ID
</select>
</mapper> </mapper>

Loading…
Cancel
Save