Browse Source

大屏统计默认查询截至昨天的数据

feature/dangjian
wanggongfeng 3 years ago
parent
commit
b972870147
  1. 66
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml

66
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml

@ -1095,9 +1095,14 @@
WHERE item.DEL_FLAG = '0'
and item.IS_PEOPLE = '1'
and item.IS_DIFFICULTY = '1'
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT( item.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
<choose>
<when test="startTime != null and startTime != '' and endTime != null and endTime != '">
AND DATE_FORMAT( item.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</when>
<otherwise>
AND DATE_FORMAT( item.CREATED_TIME, '%Y-%m-%d' ) <![CDATA[ <= ]]> DATE_FORMAT(date_sub(now(),interval 1 day),'%Y-%m-%d')
</otherwise>
</choose>
<if test="deptId != null and deptId != ''">
AND find_in_set(#{deptId},item.ALL_DEPT_IDS)
</if>
@ -2707,9 +2712,14 @@
and item.EVENT_ID is null
and item.ISSUE_ID is null
and SUBSTRING_INDEX(item.CATEGORY_FULL_NAME,'-',1) != '其他'
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT( item.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
<choose>
<when test="startTime != null and startTime != '' and endTime != null and endTime != '">
AND DATE_FORMAT( item.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</when>
<otherwise>
AND DATE_FORMAT( item.CREATED_TIME, '%Y-%m-%d' ) <![CDATA[ <= ]]> DATE_FORMAT(date_sub(now(),interval 1 day),'%Y-%m-%d')
</otherwise>
</choose>
<if test="deptId != null and deptId != ''">
AND find_in_set(#{deptId},item.ALL_DEPT_IDS)
</if>
@ -2732,9 +2742,14 @@
and item.ISSUE_ID is null
and SUBSTRING_INDEX(item.CATEGORY_FULL_NAME,'-',1) != '其他'
and SUBSTRING_INDEX(item.CATEGORY_FULL_NAME,'-',2) != '城市综合'
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT( item.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
<choose>
<when test="startTime != null and startTime != '' and endTime != null and endTime != '">
AND DATE_FORMAT( item.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</when>
<otherwise>
AND DATE_FORMAT( item.CREATED_TIME, '%Y-%m-%d' ) <![CDATA[ <= ]]> DATE_FORMAT(date_sub(now(),interval 1 day),'%Y-%m-%d')
</otherwise>
</choose>
<if test="deptId != null and deptId != ''">
AND find_in_set(#{deptId},item.ALL_DEPT_IDS)
</if>
@ -2761,9 +2776,14 @@
and item.EVENT_ID is null
and item.ISSUE_ID is null
and SUBSTRING_INDEX(item.CATEGORY_FULL_NAME,'-',1) != '其他'
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT( item.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
<choose>
<when test="startTime != null and startTime != '' and endTime != null and endTime != '">
AND DATE_FORMAT( item.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</when>
<otherwise>
AND DATE_FORMAT( item.CREATED_TIME, '%Y-%m-%d' ) <![CDATA[ <= ]]> DATE_FORMAT(date_sub(now(),interval 1 day),'%Y-%m-%d')
</otherwise>
</choose>
<if test="deptId != null and deptId != ''">
AND find_in_set(#{deptId},item.ALL_DEPT_IDS)
</if>
@ -2789,9 +2809,14 @@
and item.EVENT_ID is null
and item.ISSUE_ID is null
and SUBSTRING_INDEX(item.CATEGORY_FULL_NAME,'-',1) != '其他'
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT( item.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
<choose>
<when test="startTime != null and startTime != '' and endTime != null and endTime != '">
AND DATE_FORMAT( item.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</when>
<otherwise>
AND DATE_FORMAT( item.CREATED_TIME, '%Y-%m-%d' ) <![CDATA[ <= ]]> DATE_FORMAT(date_sub(now(),interval 1 day),'%Y-%m-%d')
</otherwise>
</choose>
<if test="deptId != null and deptId != ''">
AND find_in_set(#{deptId},item.ALL_DEPT_IDS)
</if>
@ -2820,9 +2845,14 @@
and item.EVENT_ID is null
and item.ISSUE_ID is null
and SUBSTRING_INDEX(item.CATEGORY_FULL_NAME,'-',1) != '其他'
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT( item.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
<choose>
<when test="startTime != null and startTime != '' and endTime != null and endTime != '">
AND DATE_FORMAT( item.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</when>
<otherwise>
AND DATE_FORMAT( item.CREATED_TIME, '%Y-%m-%d' ) <![CDATA[ <= ]]> DATE_FORMAT(date_sub(now(),interval 1 day),'%Y-%m-%d')
</otherwise>
</choose>
<if test="deptId != null and deptId != ''">
AND find_in_set(#{deptId},item.ALL_DEPT_IDS)
</if>

Loading…
Cancel
Save