From ed48aa9f30a87c528f071d06bf6b59d7d15428e9 Mon Sep 17 00:00:00 2001
From: qushaowei <qushaowei@163.com>
Date: 星期一, 26 五月 2025 16:12:55 +0800
Subject: [PATCH] 点检报表后端

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

diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/EquipmentLogMapper.xml b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/EquipmentLogMapper.xml
index d31b630..88b331d 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/EquipmentLogMapper.xml
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/EquipmentLogMapper.xml
@@ -9,4 +9,20 @@
     <select id="selectEquipmentOporation" resultType="org.jeecg.modules.mdc.entity.EquipmentLog">
         SELECT TOP 1 * FROM EquipmentLog WHERE EquipmentID = #{ equipmentId } ORDER BY CollectTime DESC
     </select>
+
+    <!--鏌ヨ璁惧鏈�鏂颁竴鏉℃暟鎹�-->
+    <select id="getEquipmentStatusList" resultType="org.jeecg.modules.mdc.entity.EquipmentLog">
+        SELECT
+            t1.*
+        FROM
+            EquipmentLog t1
+        INNER JOIN ( SELECT MAX ( CollectTime ) AS CollectTime, EquipmentID FROM EquipmentLog GROUP BY EquipmentID ) t2 ON t1.CollectTime= t2.CollectTime
+        AND t1.EquipmentID= t2.EquipmentID
+        <if test="equipmentIdList != null and equipmentIdList.size() > 0">
+            AND t1.EquipmentID IN
+            <foreach collection="equipmentIdList" index="index" item="id" open="(" separator="," close=")">
+                #{id}
+            </foreach>
+        </if>
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3