From be3aa0812cb43be7484e162b4fece5344e9eb5c8 Mon Sep 17 00:00:00 2001
From: qushaowei <qushaowei@163.com>
Date: 星期四, 14 三月 2024 11:12:43 +0800
Subject: [PATCH] Merge branch 'master' of http://117.34.109.166:18448/r/mdc_430 into develop

---
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml |   42 ++++++++++++++++++++++++++++++++----------
 1 files changed, 32 insertions(+), 10 deletions(-)

diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml
index 492e4b3..480d71e 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml
@@ -238,16 +238,14 @@
             <if test="mdcEquipment.driveType != null and mdcEquipment.driveType != '' ">
                 AND t1.drive_type = #{mdcEquipment.driveType}
             </if>
-            <if test="mdcEquipment.productionName != null and mdcEquipment.productionName != '' ">
-                AND t3.id = #{ mdcEquipment.productionName } OR t3.parent_id = #{ mdcEquipment.productionName }
+            <if test="mdcEquipment.productionIds != null and mdcEquipment.productionIds.size() > 0 ">
+                AND t3.id IN
+                <foreach collection="mdcEquipment.productionIds" index="index" item="id" open="(" separator="," close=")">
+                    #{id}
+                </foreach>
             </if>
         </where>
         order by t1.sort_no
-    </select>
-
-
-    <select id="getWorkLineLast" resultType="org.jeecg.modules.mdc.dto.MdcEquipmentDto">
-        select top 1 spindlespeed, actualspindlespeed from [${tableName}] order by CollectTime  desc
     </select>
 
     <select id="exportXlsList" resultType="org.jeecg.modules.mdc.entity.MdcEquipment">
@@ -268,16 +266,40 @@
                 AND t1.equipment_name = #{mdcEquipment.equipmentModel}
             </if>
             <if test="mdcEquipment.equipmentType != null and mdcEquipment.equipmentType != '' ">
-                AND t1.equipmentType = #{mdcEquipment.equipmentType}
+                AND t1.equipment_type = #{mdcEquipment.equipmentType}
             </if>
             <if test="mdcEquipment.driveType != null and mdcEquipment.driveType != '' ">
                 AND t1.drive_type = #{mdcEquipment.driveType}
             </if>
-            <if test="mdcEquipment.productionName != null and mdcEquipment.productionName != '' ">
-                AND t3.id = #{ mdcEquipment.productionName } OR t3.parent_id = #{ mdcEquipment.productionName }
+            <if test="mdcEquipment.productionIds != null and mdcEquipment.productionIds.size() > 0 ">
+                AND t3.id IN
+                <foreach collection="mdcEquipment.productionIds" index="index" item="id" open="(" separator="," close=")">
+                    #{id}
+                </foreach>
             </if>
         </where>
         order by t1.sort_no
     </select>
 
+    <!--鏌ヨ鍗曡〃鏁版嵁-->
+    <select id="findWorkLineLast" resultType="org.jeecg.modules.mdc.dto.MdcEquipmentDto">
+        select top 1 spindlespeed, actualspindlespeed from [${tableName}] 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