Browse Source

【运营导出数据】-【项目数量统计修改】-(王童)-2020/05/19

feature/dangjian
Jackwang 6 years ago
parent
commit
e354fedadb
  1. 28
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/user/UserAnalysisDao.xml

28
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/user/UserAnalysisDao.xml

@ -560,27 +560,27 @@
<select id="selectExportItemCount" resultType="com.elink.esua.epdc.dto.user.result.ExportOperationDataResultDTO"> <select id="selectExportItemCount" resultType="com.elink.esua.epdc.dto.user.result.ExportOperationDataResultDTO">
SELECT SELECT
t0.`name` streetName, t0.`name` streetName,
COUNT(epen.ID) itemCount, IFNULL(SUM( ITEM_STATE = 0 )+SUM( ITEM_STATE = 5 )+SUM( ITEM_STATE = 10 ),0) AS itemCount,
COUNT(epen.ITEM_STATE = '10' OR NULL) itemCloseCount IFNULL(SUM( ITEM_STATE = '10' OR NULL ),0) AS itemCloseCount
FROM FROM
( (
SELECT SELECT
ad.id, ad.id,
ad.`name`, ad.`name`,
ad.pid ad.pid
FROM FROM
esua_epdc_admin.sys_dept ad esua_epdc_analysis.meta_sys_dept ad
WHERE WHERE
ad.id IN <include refid="foreachAllDeptIdsShow"></include> ad.id IN <include refid="foreachAllDeptIdsShow"></include>
AND ad.del_flag = 0 AND ad.del_flag = 0
) t0 ) t0
LEFT JOIN esua_epdc_events.epdc_item epen ON find_in_set(t0.id, epen.ALL_DEPT_IDS) LEFT JOIN esua_epdc_analysis.meta_epdc_item epen ON find_in_set(t0.id, epen.ALL_DEPT_IDS)
AND epen.DEL_FLAG = '0' AND epen.DEL_FLAG = '0'
<if test="operationStartTime != null and operationEndTime != null and operationEndTime != ''"> <if test="operationStartTime != null and operationEndTime != null and operationEndTime != ''">
AND epen.CREATED_TIME BETWEEN #{operationStartTime} AND #{operationEndTime} AND DATE_FORMAT(epen.CREATED_TIME,'%Y-%m-%d') BETWEEN #{operationStartTime} AND #{operationEndTime}
</if> </if>
<if test="endTime != null and endTime != ''"> <if test="endTime != null and endTime != ''">
and epen.CREATED_TIME &lt;=#{endTime} and DATE_FORMAT(epen.CREATED_TIME,'%Y-%m-%d') &lt;= DATE_FORMAT(#{endTime},'%Y-%m-%d')
</if> </if>
GROUP BY GROUP BY
t0.id t0.id

Loading…
Cancel
Save