修改日期

This commit is contained in:
gongjiale 2024-12-04 17:22:36 +08:00
parent 9e4d29f9c9
commit 0d328d0c8f
2 changed files with 12 additions and 12 deletions

View File

@ -52,8 +52,8 @@
JOIN JOIN
sys_dept p ON d.dept_id = p.dept_id sys_dept p ON d.dept_id = p.dept_id
WHERE WHERE
r.REPORT_TIME >= TO_DATE(#{date}, 'YYYY-MM-DD') - 3 TRUNC(r.REPORT_TIME) >= TO_DATE(#{date}, 'YYYY-MM-DD') - 3
AND r.REPORT_TIME < TO_DATE(#{date}, 'YYYY-MM-DD') + 1 AND TRUNC(r.REPORT_TIME) < TO_DATE(#{date}, 'YYYY-MM-DD') + 1
GROUP BY GROUP BY
p.dept_name p.dept_name
HAVING HAVING

View File

@ -35,10 +35,10 @@
AND d.sn = #{sn} AND d.sn = #{sn}
</if> </if>
<if test="params.beginTime != null and params.beginTime != ''"> <if test="params.beginTime != null and params.beginTime != ''">
AND d.report_time &gt;= TO_DATE(#{params.beginTime}, 'YYYY-MM-DD HH24:MI:SS') AND TRUNC(d.REPORT_TIME)>= TO_DATE(#{params.beginTime}, 'YYYY-MM-DD HH24:MI:SS')
</if> </if>
<if test="params.endTime != null and params.endTime != ''"> <if test="params.endTime != null and params.endTime != ''">
AND d.report_time &lt;= TO_DATE(#{params.endTime}, 'YYYY-MM-DD HH24:MI:SS') AND TRUNC(d.REPORT_TIME)&lt;= TO_DATE(#{params.endTime}, 'YYYY-MM-DD HH24:MI:SS')
</if> </if>
ORDER BY d.report_time ASC ORDER BY d.report_time ASC
</select> </select>
@ -53,8 +53,8 @@
WHERE d.dept_id IN (SELECT dept_id WHERE d.dept_id IN (SELECT dept_id
FROM sys_dept START WITH dept_id = #{deptId} FROM sys_dept START WITH dept_id = #{deptId}
CONNECT BY PRIOR dept_id = parent_id)) CONNECT BY PRIOR dept_id = parent_id))
AND d.report_time &gt;= TO_DATE(#{startMonth}, 'YYYY-MM') AND TRUNC(d.REPORT_TIME) &gt;= TO_DATE(#{startMonth}, 'YYYY-MM')
AND d.report_time &lt;= ADD_MONTHS(TO_DATE(#{endMonth}, 'YYYY-MM'), 1) AND TRUNC(d.REPORT_TIME)&lt;= ADD_MONTHS(TO_DATE(#{endMonth}, 'YYYY-MM'), 1)
GROUP BY TO_CHAR(d.report_time, 'YYYY-MM') GROUP BY TO_CHAR(d.report_time, 'YYYY-MM')
ORDER BY month ORDER BY month
</select> </select>
@ -73,8 +73,8 @@
LEFT JOIN th_device td ON d.sn = td.sn LEFT JOIN th_device td ON d.sn = td.sn
LEFT JOIN sys_dept p ON td.dept_id = p.dept_id LEFT JOIN sys_dept p ON td.dept_id = p.dept_id
WHERE td.dept_id IN (SELECT dept_id FROM sys_dept WHERE dept_id = #{deptId} OR parent_id = #{deptId}) WHERE td.dept_id IN (SELECT dept_id FROM sys_dept WHERE dept_id = #{deptId} OR parent_id = #{deptId})
AND d.report_time &gt;= TO_DATE(#{startMonth}, 'YYYY-MM') AND TRUNC(d.REPORT_TIME) &gt;= TO_DATE(#{startMonth}, 'YYYY-MM')
AND d.report_time &lt;= ADD_MONTHS(TO_DATE(#{endMonth}, 'YYYY-MM'), 1) AND TRUNC(d.REPORT_TIME)&lt;= ADD_MONTHS(TO_DATE(#{endMonth}, 'YYYY-MM'), 1)
GROUP BY d.sn, p.dept_name, td.name, td.address, td.longitude, td.latitude GROUP BY d.sn, p.dept_name, td.name, td.address, td.longitude, td.latitude
ORDER BY p.dept_name ORDER BY p.dept_name
</select> </select>
@ -199,8 +199,8 @@
WHERE d.dept_id IN (SELECT dept_id WHERE d.dept_id IN (SELECT dept_id
FROM sys_dept START WITH dept_id = #{deptId} FROM sys_dept START WITH dept_id = #{deptId}
CONNECT BY PRIOR dept_id = parent_id)) CONNECT BY PRIOR dept_id = parent_id))
AND d.report_time &gt;= TO_DATE(#{beginDate}, 'YYYY-MM-DD') AND TRUNC(d.REPORT_TIME) &gt;= TO_DATE(#{beginDate}, 'YYYY-MM-DD')
AND d.report_time &lt;= TO_DATE(#{endDate}, 'YYYY-MM-DD') AND TRUNC(d.REPORT_TIME) &lt;= TO_DATE(#{endDate}, 'YYYY-MM-DD')
GROUP BY TO_CHAR(d.report_time, 'YYYY-MM-DD') GROUP BY TO_CHAR(d.report_time, 'YYYY-MM-DD')
ORDER BY day ORDER BY day
</select> </select>
@ -227,8 +227,8 @@
WHERE d.dept_id IN (SELECT dept_id WHERE d.dept_id IN (SELECT dept_id
FROM sys_dept START WITH dept_id = #{deptId} FROM sys_dept START WITH dept_id = #{deptId}
CONNECT BY PRIOR dept_id = parent_id)) CONNECT BY PRIOR dept_id = parent_id))
AND d.report_time &gt;= TO_DATE(#{beginDate}, 'YYYY-MM-DD') AND TRUNC(d.REPORT_TIME) &gt;= TO_DATE(#{beginDate}, 'YYYY-MM-DD')
AND d.report_time &lt;= TO_DATE(#{endDate}, 'YYYY-MM-DD') AND TRUNC(d.REPORT_TIME) &lt;= TO_DATE(#{endDate}, 'YYYY-MM-DD')
AND (d.zt = '一级报警' OR d.zt = '二级报警') AND (d.zt = '一级报警' OR d.zt = '二级报警')
GROUP BY d.sn, p.dept_name, pp.dept_name, ppp.dept_name, td.address, td.name, d.zt GROUP BY d.sn, p.dept_name, pp.dept_name, ppp.dept_name, td.address, td.name, d.zt
ORDER BY count DESC ORDER BY count DESC