|
|
@ -28,17 +28,19 @@ |
|
|
|
|
|
|
|
<select id="selecCpcAvgScore" resultType="com.epmet.evaluationindex.index.result.IndexScoreResult"> |
|
|
|
SELECT |
|
|
|
id, customer_id, agency_id, grid_id, year_id, month_id, user_id, |
|
|
|
fact.id, fact.customer_id, fact.agency_id, fact.grid_id, fact.year_id, fact.month_id, fact.user_id, |
|
|
|
COUNT(*) SAMPLE_COUNT, |
|
|
|
ROUND(AVG(score),1) score, |
|
|
|
index_code, all_parent_index_code, |
|
|
|
ROUND(weight,2) weight |
|
|
|
FROM fact_index_cpc_sub_score |
|
|
|
WHERE ALL_PARENT_INDEX_CODE = #{allParentIndexCode} |
|
|
|
AND CUSTOMER_ID = #{customerId} |
|
|
|
and GRID_ID = #{orgId} |
|
|
|
and MONTH_ID = #{monthId} |
|
|
|
GROUP BY INDEX_CODE; |
|
|
|
ROUND(AVG(fact.score),1) score, |
|
|
|
fact.index_code, fact.all_parent_index_code, |
|
|
|
ROUND(fact.weight,2) weight, |
|
|
|
dict.VALUE_TYPE |
|
|
|
FROM fact_index_cpc_sub_score fact |
|
|
|
LEFT JOIN index_dict dict ON fact.index_code = dict.index_code |
|
|
|
WHERE fact.ALL_PARENT_INDEX_CODE = #{allParentIndexCode} |
|
|
|
AND fact.CUSTOMER_ID = #{customerId} |
|
|
|
and fact.GRID_ID = #{orgId} |
|
|
|
and fact.MONTH_ID = #{monthId} |
|
|
|
GROUP BY fact.INDEX_CODE; |
|
|
|
</select> |
|
|
|
|
|
|
|
</mapper> |
|
|
|