From 0d328d0c8f8a11ee04a3748a2f56987d06ab22e6 Mon Sep 17 00:00:00 2001
From: gongjiale <942894820@qq.com>
Date: Wed, 4 Dec 2024 17:22:36 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=A5=E6=9C=9F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../main/resources/mybatis/oil/HomeMapper.xml | 4 ++--
.../mybatis/oil/ThDeviceReportMapper.xml | 20 +++++++++----------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/HomeMapper.xml b/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/HomeMapper.xml
index 3f88bde..2450767 100644
--- a/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/HomeMapper.xml
+++ b/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/HomeMapper.xml
@@ -52,8 +52,8 @@
JOIN
sys_dept p ON d.dept_id = p.dept_id
WHERE
- r.REPORT_TIME >= TO_DATE(#{date}, 'YYYY-MM-DD') - 3
- AND r.REPORT_TIME < TO_DATE(#{date}, 'YYYY-MM-DD') + 1
+ TRUNC(r.REPORT_TIME) >= TO_DATE(#{date}, 'YYYY-MM-DD') - 3
+ AND TRUNC(r.REPORT_TIME) < TO_DATE(#{date}, 'YYYY-MM-DD') + 1
GROUP BY
p.dept_name
HAVING
diff --git a/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/ThDeviceReportMapper.xml b/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/ThDeviceReportMapper.xml
index b2cdcab..c71cb0c 100644
--- a/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/ThDeviceReportMapper.xml
+++ b/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/ThDeviceReportMapper.xml
@@ -35,10 +35,10 @@
AND d.sn = #{sn}
- AND d.report_time >= 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')
- AND d.report_time <= TO_DATE(#{params.endTime}, 'YYYY-MM-DD HH24:MI:SS')
+ AND TRUNC(d.REPORT_TIME)<= TO_DATE(#{params.endTime}, 'YYYY-MM-DD HH24:MI:SS')
ORDER BY d.report_time ASC
@@ -53,8 +53,8 @@
WHERE d.dept_id IN (SELECT dept_id
FROM sys_dept START WITH dept_id = #{deptId}
CONNECT BY PRIOR dept_id = parent_id))
- AND d.report_time >= TO_DATE(#{startMonth}, 'YYYY-MM')
- AND d.report_time <= ADD_MONTHS(TO_DATE(#{endMonth}, 'YYYY-MM'), 1)
+ AND TRUNC(d.REPORT_TIME) >= TO_DATE(#{startMonth}, 'YYYY-MM')
+ AND TRUNC(d.REPORT_TIME)<= ADD_MONTHS(TO_DATE(#{endMonth}, 'YYYY-MM'), 1)
GROUP BY TO_CHAR(d.report_time, 'YYYY-MM')
ORDER BY month
@@ -73,8 +73,8 @@
LEFT JOIN th_device td ON d.sn = td.sn
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})
- AND d.report_time >= TO_DATE(#{startMonth}, 'YYYY-MM')
- AND d.report_time <= ADD_MONTHS(TO_DATE(#{endMonth}, 'YYYY-MM'), 1)
+ AND TRUNC(d.REPORT_TIME) >= TO_DATE(#{startMonth}, 'YYYY-MM')
+ AND TRUNC(d.REPORT_TIME)<= ADD_MONTHS(TO_DATE(#{endMonth}, 'YYYY-MM'), 1)
GROUP BY d.sn, p.dept_name, td.name, td.address, td.longitude, td.latitude
ORDER BY p.dept_name
@@ -199,8 +199,8 @@
WHERE d.dept_id IN (SELECT dept_id
FROM sys_dept START WITH dept_id = #{deptId}
CONNECT BY PRIOR dept_id = parent_id))
- AND d.report_time >= TO_DATE(#{beginDate}, 'YYYY-MM-DD')
- AND d.report_time <= TO_DATE(#{endDate}, 'YYYY-MM-DD')
+ AND TRUNC(d.REPORT_TIME) >= TO_DATE(#{beginDate}, 'YYYY-MM-DD')
+ AND TRUNC(d.REPORT_TIME) <= TO_DATE(#{endDate}, 'YYYY-MM-DD')
GROUP BY TO_CHAR(d.report_time, 'YYYY-MM-DD')
ORDER BY day
@@ -227,8 +227,8 @@
WHERE d.dept_id IN (SELECT dept_id
FROM sys_dept START WITH dept_id = #{deptId}
CONNECT BY PRIOR dept_id = parent_id))
- AND d.report_time >= TO_DATE(#{beginDate}, 'YYYY-MM-DD')
- AND d.report_time <= TO_DATE(#{endDate}, 'YYYY-MM-DD')
+ AND TRUNC(d.REPORT_TIME) >= TO_DATE(#{beginDate}, 'YYYY-MM-DD')
+ AND TRUNC(d.REPORT_TIME) <= TO_DATE(#{endDate}, 'YYYY-MM-DD')
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
ORDER BY count DESC