From cd00884c3db8fa6808b3b5949ab1a2b1459d6bdc Mon Sep 17 00:00:00 2001
From: cuilei <ray_tsu1@163.com>
Date: 星期三, 11 六月 2025 10:36:55 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcDowntimeMapper.xml |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcDowntimeMapper.xml b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcDowntimeMapper.xml
index e5adea6..898cd96 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcDowntimeMapper.xml
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcDowntimeMapper.xml
@@ -40,4 +40,24 @@
             AND t2.downtime_type = #{closeType}
             AND t1.the_date = #{validDate}
     </select>
+
+    <select id="equDowntimeStatistics" resultType="org.jeecg.modules.board.vo.EquDowntimeInfo">
+        SELECT
+            t2.downtime_description AS shutdown_info,
+            SUM ( DATEDIFF( SECOND, t1.start_date, t1.end_date ) ) / 3600.0 AS duration_hours
+        FROM
+            mdc_downtime t1
+                LEFT JOIN mdc_downtime_reason t2 ON t1.reason_id = t2.id
+        WHERE
+            t1.reason_id != ''
+          AND t1.the_date BETWEEN #{start} AND #{end}
+        AND t1.equipment_id IN
+        <foreach collection="equipmentIdList" item="equipmentId" index="index" open="(" close=")" separator=",">
+            #{ equipmentId }
+        </foreach>
+        GROUP BY
+            t2.downtime_description
+        ORDER BY
+            duration_hours DESC
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3