From 39f62fa03a2463652e971edfabab56313db6af10 Mon Sep 17 00:00:00 2001
From: Lius <Lius2225@163.com>
Date: 星期六, 28 六月 2025 10:20:34 +0800
Subject: [PATCH] 涉密->工控

---
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcDowntimeMapper.xml |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 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 cbad115..85d3ca7 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
@@ -27,4 +27,35 @@
         </where>
         ORDER BY t1.create_time DESC
     </select>
+
+    <select id="findPlanTimeDuration" resultType="org.jeecg.modules.mdc.entity.MdcDowntime">
+        SELECT
+            t1.*
+        FROM
+            mdc_downtime t1
+                LEFT JOIN mdc_downtime_reason t2 ON t1.reason_id = t2.id
+        WHERE
+            t1.status = 1
+            AND t1.equipment_id = #{equipmentId}
+            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
+        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
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3