Browse Source

【pc端 - 用户数据分析 】-【网格开通情况 新闻sql修改】-(魏凯)-2020/05/29

feature/dangjian
weikai 5 years ago
parent
commit
0e9f293b7a
  1. 52
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/user/UserAnalysisDao.xml

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

@ -112,7 +112,7 @@
<!--新闻数 通知数 议题数--> <!--新闻数 通知数 议题数-->
<select id="selectListNewsNoticeEventCount" resultType="com.elink.esua.epdc.dto.user.result.GridOpeningResultDTO"> <select id="selectListNewsNoticeEventCount" resultType="com.elink.esua.epdc.dto.user.result.GridOpeningResultDTO">
<!-- SELECT SELECT
dept.id gridId, dept.id gridId,
COUNT( DISTINCT nne.id ) newsCount, COUNT( DISTINCT nne.id ) newsCount,
COUNT( DISTINCT nnn.ID ) noticeCount, COUNT( DISTINCT nnn.ID ) noticeCount,
@ -138,55 +138,7 @@
AND dept.id in <include refid="foreachGridIdList"></include> AND dept.id in <include refid="foreachGridIdList"></include>
</if> </if>
GROUP BY GROUP BY
dept.id --> dept.id 
SELECT
dept.id gridId,
(
SELECT
count(1)
FROM
esua_epdc_news.epdc_news
WHERE
DEL_FLAG = '0'
<if test="startTime != null and endTime != null and endTime != ''">
AND DATE_FORMAT(CREATED_TIME,'%Y-%m-%d') BETWEEN #{startTime} AND #{endTime}
</if>
AND DEPT_ID = dept.id
) AS newsCount,
(
SELECT
count(1)
FROM
esua_epdc_news.epdc_notice
WHERE
DEL_FLAG = '0'
<if test="startTime != null and endTime != null and endTime != ''">
AND DATE_FORMAT(CREATED_TIME,'%Y-%m-%d') BETWEEN #{startTime} AND #{endTime}
</if>
AND DEPT_ID = dept.id
) AS noticeCount,
(SELECT
count(1)
FROM
esua_epdc_events.epdc_issue
WHERE
DEL_FLAG = '0'
<if test="startTime != null and endTime != null and endTime != ''">
AND DATE_FORMAT(CREATED_TIME,'%Y-%m-%d') BETWEEN #{startTime} AND #{endTime}
</if>
AND GRID_ID = dept.id
) AS eventCount
FROM
esua_epdc_admin.sys_dept dept
WHERE
dept.DEL_FLAG = '0'
AND dept.type_key = 'grid_party'
<if test="gridIdList != null and gridIdList.size() > 0">
AND dept.id in <include refid="foreachGridIdList"></include>
</if>
GROUP BY dept.id
</select> </select>
<!--项目数--> <!--项目数-->

Loading…
Cancel
Save