From 792ff6e14b5074d30f8a7bd804d3b8e6454c3969 Mon Sep 17 00:00:00 2001
From: qushaowei <qushaowei@163.com>
Date: 星期四, 11 一月 2024 17:41:45 +0800
Subject: [PATCH] 保养拆分

---
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml |   97 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 96 insertions(+), 1 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 26d708c..893762f 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
@@ -58,6 +58,7 @@
         WHERE
             med.equipment_id = me.id
             AND med.dep_id = #{ departId }
+        ORDER BY me.equipment_id
     </select>
 
     <!--鏍规嵁浜х嚎id鏌ヨ璁惧-->
@@ -70,6 +71,7 @@
         WHERE
             mpe.equipment_id = me.id
             AND mpe.production_id = #{ productionId }
+        ORDER BY me.equipment_id
     </select>
 
     <!--鏍规嵁浜х嚎id鏌ヨ璁惧id闆嗗悎-->
@@ -129,7 +131,7 @@
             k.equipment_type,
             k.equipment_type_pictures
         ORDER BY
-            equipmentName
+            EquipmentID
     </select>
 
     <!--鏍规嵁閮ㄩ棬id鏌ヨ璁惧id闆嗗悎-->
@@ -146,5 +148,98 @@
         </foreach>
     </select>
 
+    <!--鏍规嵁璁惧缂栧彿鏌ヨ璁惧淇℃伅鍜岄儴闂ㄤ俊鎭�-->
+    <select id="findEquDepList" resultType="org.jeecg.modules.mdc.dto.MdcEquDepDto">
+        SELECT
+            sd.id,
+            sd.parent_id,
+            sd.depart_name,
+            sd.org_type,
+            me.equipment_id,
+            me.equipment_name,
+            me.equipment_type
+        FROM
+            mdc_equipment_depart med
+            LEFT JOIN sys_depart sd ON med.dep_id = sd.id
+            LEFT JOIN mdc_equipment me ON me.id = med.equipment_id
+        <where>
+            me.equipment_id IN
+            <foreach collection="equipmentIdList" index="index" item="id" open="(" separator="," close=")">
+                #{id}
+            </foreach>
+        </where>
+        ORDER BY sd.depart_order
+    </select>
+
+    <!--鏍规嵁璁惧缂栧彿鏌ヨ璁惧淇℃伅鍜屼骇绾夸俊鎭�-->
+    <select id="findEquProList" resultType="org.jeecg.modules.mdc.dto.MdcEquProDto">
+        SELECT
+            mp.id,
+            mp.parent_id,
+            mp.production_name,
+            mp.org_type,
+            me.equipment_id,
+            me.equipment_name,
+            me.equipment_type
+        FROM
+            mdc_production_equipment mpe
+            LEFT JOIN mdc_production mp ON mpe.production_id = mp.id
+            LEFT JOIN mdc_equipment me ON me.id = mpe.equipment_id
+        <where>
+            me.equipment_id IN
+            <foreach collection="equipmentIdList" index="index" item="id" open="(" separator="," close=")">
+                #{id}
+            </foreach>
+        </where>
+        ORDER BY mp.production_order
+    </select>
+
+    <!--鏍规嵁澶у睆杞﹂棿id鏌ヨ璁惧鍒楄〃-->
+    <select id="getEquipmentByWorkshopId" resultType="org.jeecg.modules.mdc.entity.MdcEquipment">
+        SELECT
+            me.*
+        FROM
+            mdc_workshop_equipment mwe
+            LEFT JOIN mdc_equipment me ON me.equipment_id = mwe.equipment_id
+        <where>
+            AND mwe.workshop_id = #{ workshopEquipmentVo.workshopId }
+            <if test="workshopEquipmentVo.equipmentId != null and workshopEquipmentVo.equipmentId != ''">
+                AND mwe.equipment_id = #{ workshopEquipmentVo.equipmentId }
+            </if>
+        </where>
+        ORDER BY me.equipment_id
+    </select>
+
+    <!--鍒嗛〉鍒楄〃-->
+    <select id="pageList" resultType="org.jeecg.modules.mdc.entity.MdcEquipment">
+        SELECT
+            t1.*
+        FROM
+            mdc_equipment t1
+            LEFT JOIN mdc_production_equipment t2 ON t1.id = t2.equipment_id
+            LEFT JOIN mdc_production t3 ON t2.production_id = t3.id
+        <where>
+            <if test="mdcEquipment.equipmentId != null and mdcEquipment.equipmentId != '' ">
+                AND t1.equipment_id LIKE CONCAT(CONCAT('%',#{mdcEquipment.equipmentId}),'%')
+            </if>
+            <if test="mdcEquipment.equipmentName != null and mdcEquipment.equipmentName != '' ">
+                AND t1.equipment_name LIKE CONCAT(CONCAT('%',#{mdcEquipment.equipmentName}),'%')
+            </if>
+            <if test="mdcEquipment.equipmentModel != null and mdcEquipment.equipmentModel != '' ">
+                AND t1.equipment_name = #{mdcEquipment.equipmentModel}
+            </if>
+            <if test="mdcEquipment.equipmentType != null and mdcEquipment.equipmentType != '' ">
+                AND t1.equipmentType = #{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.production_name LIKE CONCAT(CONCAT('%',#{mdcEquipment.productionName}),'%')
+            </if>
+        </where>
+        order by t1.sort_no
+    </select>
+
 
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3