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