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.SAMPLE_COUNT='',0,IFNULL(fact.SAMPLE_COUNT,0)) AS quantity,
round(fact.score,1) AS score,
round(fact.WEIGHT,2) AS weight
round(fact.WEIGHT,2) AS weight,
dict.VALUE_TYPE
FROM
fact_index_community_sub_score fact
LEFT JOIN index_dict dict ON fact.index_code = dict.index_code
WHERE
fact.del_flag = '0'
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, 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>

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, customer_id, dept_id, agency_id, month_id,
origin_value,
index_code, all_parent_index_code, weight,
fact.id, fact.customer_id, fact.dept_id, fact.agency_id, fact.month_id,
fact.origin_value,
fact.index_code, fact.all_parent_index_code,
COUNT(*) SAMPLE_COUNT,
ROUND(AVG(score),1) score,
round(weight,2) AS weight
FROM fact_index_dept_sub_score
ROUND(AVG(fact.score),1) score,
round(fact.weight,2) AS weight,
dict.VALUE_TYPE
FROM
fact_index_dept_sub_score fact
LEFT JOIN index_dict dict ON fact.index_code = dict.index_code
WHERE
ALL_PARENT_INDEX_CODE = #{allParentIndexCode}
AND CUSTOMER_ID = #{customerId}
and AGENCY_ID= #{orgId}
and MONTH_ID = #{monthId}
GROUP BY INDEX_CODE;
fact.ALL_PARENT_INDEX_CODE = #{allParentIndexCode}
AND fact.CUSTOMER_ID = #{customerId}
and fact.AGENCY_ID= #{orgId}
and fact.MONTH_ID = #{monthId}
GROUP BY fact.INDEX_CODE;
</select>
</mapper>

Loading…
Cancel
Save