From 87db70e35f8e562a17c02ef20fa16512871b0e63 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期六, 03 八月 2024 14:17:21 +0800
Subject: [PATCH] 优云录像可用
---
ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml
index 687d7f7..38b6aad 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml
@@ -243,4 +243,23 @@
]]>
</select>
+ <select id="home" resultType="java.util.Map">
+ SELECT
+ u.unit_name AS name,
+ CONCAT(MONTH(w.create_time), '鏈�') AS months,
+ COUNT(w.id) AS num1,
+ COUNT(m.id) - COUNT(w.id) AS num2
+ FROM
+ t_monitor m
+ LEFT JOIN t_yw_point p ON m.serial_number = p.serial_number
+ LEFT JOIN t_yw_unit u ON p.unit_id = u.id
+ LEFT JOIN t_work_order w ON p.id = w.point_id
+ WHERE u.id = #{unitId} AND MONTH(w.create_time) IS NOT NULL
+ <if test="dateRange != null and dateRange.size > 0">
+ AND DATE_FORMAT(w.create_time, '%Y-%m') BETWEEN #{dateRange[0]} AND #{dateRange[1]}
+ </if>
+ GROUP BY months
+ ORDER BY months
+ </select>
+
</mapper>
--
Gitblit v1.8.0