Browse Source

网格治理指数(天)、组织治理指数(天)大屏接口, 解决百分比误差问题(+-0.001)

ftature/screen
zhangyongzhangyong 4 years ago
parent
commit
9c3a2026a6
  1. 22
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/ScreenGovernanceDao.xml

22
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/ScreenGovernanceDao.xml

@ -263,12 +263,14 @@
</select> </select>
<select id="gridgoverndaily" resultType="com.elink.esua.epdc.dto.screen.result.ScreenGridGovernDailyResultDTO"> <select id="gridgoverndaily" resultType="com.elink.esua.epdc.dto.screen.result.ScreenGridGovernDailyResultDTO">
SELECT ratio.*,
(1 - ROUND(ratio.communityClosedRatio,4) - ROUND(ratio.streetClosedRatio,4) - ROUND(ratio.districtDeptClosedRatio,4)) gridSelfGovernRatio
from(
SELECT SELECT
info.*, info.*,
IFNULL((info.problemResolvedCount - info.communityClosedCount - info.streetClosedCount - info.districtClosedCount), 0) gridSelfGovernProjectTotal, IFNULL((info.problemResolvedCount - info.communityClosedCount - info.streetClosedCount - info.districtClosedCount), 0) gridSelfGovernProjectTotal,
IFNULL( ( info.inGroupTopicResolvedCount + info.inGroupTopicUnResolvedCount ) / info.problemResolvedCount, 0 ) AS groupSelfGovernRatio, IFNULL( ( info.inGroupTopicResolvedCount + info.inGroupTopicUnResolvedCount ) / info.problemResolvedCount, 0 ) AS groupSelfGovernRatio,
IFNULL( IFNULL((info.problemResolvedCount - info.communityClosedCount - info.streetClosedCount - info.districtClosedCount), 0)
/ info.problemResolvedCount, 0 ) AS gridSelfGovernRatio,
IFNULL( info.communityClosedCount / info.problemResolvedCount, 0 ) AS communityClosedRatio, IFNULL( info.communityClosedCount / info.problemResolvedCount, 0 ) AS communityClosedRatio,
IFNULL( info.streetClosedCount / info.problemResolvedCount, 0 ) AS streetClosedRatio, IFNULL( info.streetClosedCount / info.problemResolvedCount, 0 ) AS streetClosedRatio,
IFNULL( info.districtClosedCount / info.problemResolvedCount, 0 ) AS districtDeptClosedRatio IFNULL( info.districtClosedCount / info.problemResolvedCount, 0 ) AS districtDeptClosedRatio
@ -467,9 +469,14 @@
AND sd.id NOT IN ( SELECT t.dept_id FROM esua_epdc_admin.sys_dept_config t WHERE t.del_flag = '0' ) AND sd.id NOT IN ( SELECT t.dept_id FROM esua_epdc_admin.sys_dept_config t WHERE t.del_flag = '0' )
GROUP BY sd.id GROUP BY sd.id
) info ) info
) ratio
</select> </select>
<select id="agencygoverndaily" resultType="com.elink.esua.epdc.dto.screen.result.ScreenAgencyGovernDailyResultDTO"> <select id="agencygoverndaily" resultType="com.elink.esua.epdc.dto.screen.result.ScreenAgencyGovernDailyResultDTO">
SELECT
radio.*,
(1 - ROUND(radio.communityClosedRatio, 4) - ROUND(radio.streetClosedRatio, 4) - ROUND(radio.districtDeptClosedRatio, 4)) AS gridSelfGovernRatio
FROM (
SELECT SELECT
DATE_FORMAT( date_add( now(), INTERVAL - 1 DAY ), '%Y%m%d' ) AS dateId, DATE_FORMAT( date_add( now(), INTERVAL - 1 DAY ), '%Y%m%d' ) AS dateId,
sd.id AS agencyId, sd.id AS agencyId,
@ -509,17 +516,11 @@
IFNULL( ( sum( info.inGroupTopicResolvedCount ) + sum( info.inGroupTopicUnResolvedCount ) ) IFNULL( ( sum( info.inGroupTopicResolvedCount ) + sum( info.inGroupTopicUnResolvedCount ) )
/ sum( info.problemResolvedCount ), 0 ) AS groupSelfGovernRatio, / sum( info.problemResolvedCount ), 0 ) AS groupSelfGovernRatio,
IFNULL( IFNULL(( IFNULL( sum( info.problemResolvedCount ), 0 )
- IFNULL( sum( info.communityClosedCount ), 0 )
- IFNULL( sum( info.streetClosedCount ), 0 )
- IFNULL( sum( info.districtClosedCount ), 0 )), 0
)
/ sum( info.problemResolvedCount ), 0 ) AS gridSelfGovernRatio,
IFNULL( sum( info.communityClosedCount ) / sum( info.problemResolvedCount ), 0 ) AS communityClosedRatio, IFNULL( sum( info.communityClosedCount ) / sum( info.problemResolvedCount ), 0 ) AS communityClosedRatio,
IFNULL( sum( info.streetClosedCount ) / sum( info.problemResolvedCount ), 0 ) AS streetClosedRatio, IFNULL( sum( info.streetClosedCount ) / sum( info.problemResolvedCount ), 0 ) AS streetClosedRatio,
IFNULL( sum( info.districtClosedCount ) / sum( info.problemResolvedCount ), 0 ) AS districtDeptClosedRatio IFNULL( sum( info.districtClosedCount ) / sum( info.problemResolvedCount ), 0 ) AS districtDeptClosedRatio
FROM FROM (
(
SELECT SELECT
sd.pids, sd.pids,
IFNULL (( IFNULL ((
@ -713,5 +714,6 @@
AND sd.id NOT IN ( SELECT t.dept_id FROM esua_epdc_admin.sys_dept_config t WHERE t.del_flag = '0' ) AND sd.id NOT IN ( SELECT t.dept_id FROM esua_epdc_admin.sys_dept_config t WHERE t.del_flag = '0' )
AND sd.type_key IN ( 'community_party', 'community_dept', 'street_party', 'street_dept', 'district_party', 'district_dept' ) AND sd.type_key IN ( 'community_party', 'community_dept', 'street_party', 'street_dept', 'district_party', 'district_dept' )
GROUP BY sd.id GROUP BY sd.id
) radio
</select> </select>
</mapper> </mapper>

Loading…
Cancel
Save