From a249695911e6e6b3e318dd4dd14812994e2eb3a9 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期二, 06 八月 2024 09:52:56 +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