From 9363b7a09744b3003ad6163ac42591fe40c59c5e Mon Sep 17 00:00:00 2001
From: Lius <Lius2225@163.com>
Date: 星期四, 14 三月 2024 15:50:06 +0800
Subject: [PATCH] 首页设备利用率和oee接口

---
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/EquipmentLogMapper.xml |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 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 b178c17..42fffcd 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
@@ -6,7 +6,23 @@
         SELECT top 1 * FROM EquipmentLog WHERE EquipmentID = #{ equipmentid } AND CollectTime &lt;= #{ startTime } AND Oporation in ('0','1','2','3') ORDER BY CollectTime ASC
     </select>
 
-    <select id="selectEquipmentOporation" resultType="java.lang.Integer">
-        SELECT TOP 1 Oporation FROM EquipmentLog WHERE EquipmentID = #{ equipmentId } ORDER BY CollectTime DESC
+    <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