Browse Source

保留小数处理

dev_shibei_match
jianjun 4 years ago
parent
commit
d21fc7bf3f
  1. 4
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml
  2. 22
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcSubScoreDao.xml
  3. 25
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexDeptSubScoreDao.xml

4
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml

@ -47,9 +47,11 @@
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS origin_value, IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS origin_value,
IF(fact.SAMPLE_COUNT='',0,IFNULL(fact.SAMPLE_COUNT,0)) AS quantity, IF(fact.SAMPLE_COUNT='',0,IFNULL(fact.SAMPLE_COUNT,0)) AS quantity,
round(fact.score,1) AS score, round(fact.score,1) AS score,
round(fact.WEIGHT,2) AS weight round(fact.WEIGHT,2) AS weight,
dict.VALUE_TYPE
FROM FROM
fact_index_community_sub_score fact fact_index_community_sub_score fact
LEFT JOIN index_dict dict ON fact.index_code = dict.index_code
WHERE WHERE
fact.del_flag = '0' fact.del_flag = '0'
AND fact.all_parent_index_code = #{allParentIndexCode} AND fact.all_parent_index_code = #{allParentIndexCode}

22
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcSubScoreDao.xml

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

25
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexDeptSubScoreDao.xml

@ -7,19 +7,22 @@
<select id="selecDeptAvgScore" resultType="com.epmet.evaluationindex.index.result.IndexScoreResult"> <select id="selecDeptAvgScore" resultType="com.epmet.evaluationindex.index.result.IndexScoreResult">
SELECT SELECT
id, customer_id, dept_id, agency_id, month_id, fact.id, fact.customer_id, fact.dept_id, fact.agency_id, fact.month_id,
origin_value, fact.origin_value,
index_code, all_parent_index_code, weight, fact.index_code, fact.all_parent_index_code,
COUNT(*) SAMPLE_COUNT, COUNT(*) SAMPLE_COUNT,
ROUND(AVG(score),1) score, ROUND(AVG(fact.score),1) score,
round(weight,2) AS weight round(fact.weight,2) AS weight,
FROM fact_index_dept_sub_score dict.VALUE_TYPE
FROM
fact_index_dept_sub_score fact
LEFT JOIN index_dict dict ON fact.index_code = dict.index_code
WHERE WHERE
ALL_PARENT_INDEX_CODE = #{allParentIndexCode} fact.ALL_PARENT_INDEX_CODE = #{allParentIndexCode}
AND CUSTOMER_ID = #{customerId} AND fact.CUSTOMER_ID = #{customerId}
and AGENCY_ID= #{orgId} and fact.AGENCY_ID= #{orgId}
and MONTH_ID = #{monthId} and fact.MONTH_ID = #{monthId}
GROUP BY INDEX_CODE; GROUP BY fact.INDEX_CODE;
</select> </select>
</mapper> </mapper>

Loading…
Cancel
Save