Browse Source

Merge branch 'hotfix/selectDate' of http://121.42.41.42:7070/r/esua-epdc-cloud into hotfix/selectDate

feature/dangjian
wanggongfeng 5 years ago
parent
commit
d9335b47ab
  1. 70
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/user/UserAnalysisDao.xml
  2. 37
      esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/resources/mapper/NewsDao.xml

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

@ -141,19 +141,36 @@
<select id="selectListItemCount" resultType="com.elink.esua.epdc.dto.user.result.GridOpeningResultDTO"> <select id="selectListItemCount" resultType="com.elink.esua.epdc.dto.user.result.GridOpeningResultDTO">
SELECT SELECT
GRID_ID AS gridId, GRID_ID AS gridId,
IFNULL(SUM( ITEM_STATE = 0 )+SUM( ITEM_STATE = 5 )+SUM( ITEM_STATE = 10 ),0) AS itemCount, COUNT( STATE = 0 OR NULL)+COUNT( STATE = 5 OR NULL)+COUNT( STATE = 10 OR NULL) AS itemCount,
IFNULL(SUM( ITEM_STATE = '10' OR ITEM_STATE = '5' OR NULL ),0) AS itemCloseCount, COUNT( STATE = '10' OR STATE = '5' OR NULL ) AS itemCloseCount,
IFNULL(SUM(EVALUATION_SCORE != '0' OR NULL),0) AS itemPraiseCount COUNT((EVALUATION_SCORE != '0'
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT(EVALUATION_TIME,'%Y-%m-%d') BETWEEN #{startTime} AND #{endTime}
</if>) OR NULL) AS itemPraiseCount
FROM FROM
esua_epdc_events.epdc_item (SELECT DISTINCT
WHERE item.*,handle.STATE
FROM
esua_epdc_events.epdc_item item
LEFT JOIN ( SELECT MAX( CREATED_TIME ) AS CREATED_TIME, ITEM_ID FROM esua_epdc_events.epdc_item_handle_process
WHERE
DEL_FLAG = '0' DEL_FLAG = '0'
<if test="gridIdList != null and gridIdList.size() > 0"> <if test="endTime != null and endTime != ''">
AND GRID_ID in <include refid="foreachGridIdList"></include> AND DATE_FORMAT(CREATED_TIME,'%Y-%m-%d') &lt;= #{endTime}
</if>
<if test="startTime != null and endTime != null and endTime != ''">
AND DATE_FORMAT(CREATED_TIME,'%Y-%m-%d') BETWEEN #{startTime} AND #{endTime}
</if> </if>
GROUP BY ITEM_ID
) maxitem ON maxitem.ITEM_ID = item.ID
LEFT JOIN esua_epdc_events.epdc_item_handle_process handle ON maxitem.ITEM_ID = handle.ITEM_ID
AND maxitem.CREATED_TIME = handle.CREATED_TIME)t
WHERE
DEL_FLAG = '0'
<if test="gridIdList != null and gridIdList.size() > 0">
AND GRID_ID in
<include refid="foreachGridIdList"></include>
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT(CREATED_TIME,'%Y-%m-%d') BETWEEN #{startTime} AND #{endTime}
</if>
GROUP BY GRID_ID GROUP BY GRID_ID
</select> </select>
@ -670,21 +687,36 @@
<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,
IFNULL(SUM( ITEM_STATE = 0 )+SUM( ITEM_STATE = 5 )+SUM( ITEM_STATE = 10 ),0) AS itemCount, COUNT( STATE = 0 OR NULL)+COUNT( STATE = 5 OR NULL)+COUNT( STATE = 10 OR NULL) AS itemCount,
IFNULL(SUM( ITEM_STATE = '10' OR NULL ),0) AS itemCloseCount COUNT( STATE = '10' OR NULL ) 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_admin.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 (SELECT
item.*,handle.STATE
FROM
(select eie.*
from esua_epdc_events.epdc_item eie
left join esua_epdc_admin.sys_dept sd on eie.GRID_ID=sd.ID
where sd.del_flag='0') item
LEFT JOIN ( SELECT MAX( CREATED_TIME ) AS CREATED_TIME, ITEM_ID FROM esua_epdc_events.epdc_item_handle_process WHERE
DEL_FLAG = '0'
<if test="endTime != null and endTime != ''">
AND DATE_FORMAT(CREATED_TIME,'%Y-%m-%d') &lt;= #{endTime}
</if>
GROUP BY ITEM_ID
) maxitem ON maxitem.ITEM_ID = item.ID
LEFT JOIN esua_epdc_events.epdc_item_handle_process handle ON maxitem.ITEM_ID = handle.ITEM_ID
AND maxitem.CREATED_TIME = handle.CREATED_TIME)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 DATE_FORMAT(epen.CREATED_TIME,'%Y-%m-%d') BETWEEN #{operationStartTime} AND #{operationEndTime} AND DATE_FORMAT(epen.CREATED_TIME,'%Y-%m-%d') BETWEEN #{operationStartTime} AND #{operationEndTime}
@ -693,9 +725,9 @@
and DATE_FORMAT(epen.CREATED_TIME,'%Y-%m-%d') &lt;= DATE_FORMAT(#{endTime},'%Y-%m-%d') 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
ORDER BY ORDER BY
t0.id ASC t0.id ASC
</select> </select>
<!--社群数--> <!--社群数-->
<select id="selectExportGroupCount" resultType="com.elink.esua.epdc.dto.user.result.ExportOperationDataResultDTO"> <select id="selectExportGroupCount" resultType="com.elink.esua.epdc.dto.user.result.ExportOperationDataResultDTO">

37
esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/resources/mapper/NewsDao.xml

@ -95,25 +95,31 @@
SELECT SELECT
* *
FROM FROM
( <!-- (-->
SELECT DISTINCT <!-- SELECT DISTINCT-->
nd.NEWS_ID <!-- nd.NEWS_ID-->
FROM <!-- FROM-->
epdc_news_department nd <!-- epdc_news_department nd-->
<!-- WHERE-->
<!-- <if test="deptIdList != null and deptIdList.size()>0">-->
<!-- nd.DEPT_ID IN-->
<!-- <foreach collection="deptIdList" open="(" separator="," close=")" item="deptId">#{deptId}</foreach>-->
<!-- AND-->
<!-- </if>-->
<!-- nd.DEL_FLAG = '0'-->
<!-- GROUP BY-->
<!-- nd.NEWS_ID-->
<!-- ) t0-->
-- LEFT JOIN
epdc_news n
-- ON t0.NEWS_ID = n.ID
WHERE WHERE
n.ID IS NOT NULL
AND n.DEL_FLAG = '0'
<if test="deptIdList != null and deptIdList.size()>0"> <if test="deptIdList != null and deptIdList.size()>0">
nd.DEPT_ID IN AND n.DEPT_ID IN
<foreach collection="deptIdList" open="(" separator="," close=")" item="deptId">#{deptId}</foreach> <foreach collection="deptIdList" open="(" separator="," close=")" item="deptId">#{deptId}</foreach>
AND
</if> </if>
nd.DEL_FLAG = '0'
GROUP BY
nd.NEWS_ID
) t0
LEFT JOIN epdc_news n ON t0.NEWS_ID = n.ID
WHERE
n.ID IS NOT NULL
AND n.DEL_FLAG = '0'
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT( n.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} AND DATE_FORMAT( n.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if> </if>
@ -127,6 +133,7 @@
<if test="gridId != null and gridId != ''"> <if test="gridId != null and gridId != ''">
AND n.ALL_DEPT_IDS like concat('%', #{gridId}, '%') AND n.ALL_DEPT_IDS like concat('%', #{gridId}, '%')
</if> </if>
group by n.id
ORDER BY ORDER BY
n.CREATED_TIME DESC n.CREATED_TIME DESC
</select> </select>

Loading…
Cancel
Save