From eeebc22772cbf7dc03ed4bc6f734e6de9f5c3e75 Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期三, 06 八月 2025 10:55:56 +0800
Subject: [PATCH] art: 订单BOM、物料工序 后端代码修改、优化

---
 src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml |   27 ++++++++++++++++++++++++++-
 1 files changed, 26 insertions(+), 1 deletions(-)

diff --git a/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml b/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml
index 4e876b7..3087928 100644
--- a/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml
+++ b/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml
@@ -12,7 +12,7 @@
 
     <!--鏌ヨ璁惧鐨勬墍灞炰骇绾垮悕绉颁俊鎭�-->
     <select id="getProNamesByEquipmentIds" resultType="org.jeecg.modules.mdc.vo.MdcEquipmentProVo">
-        SELECT p.production_name, pe.equipment_id FROM mdc_production_equipment pe, mdc_production p WHERE p.id = pe.production_id AND pe.equipment_id IN
+        SELECT f.factory_name, bef.equipment_id FROM base_equipment_factory bef, base_factory f WHERE f.id = bef.factory_id AND bef.equipment_id IN
         <foreach collection="equipmentIds" index="index" item="id" open="(" separator="," close=")">
             #{id}
         </foreach>
@@ -402,4 +402,29 @@
         </where>
     </select>
 
+    <select id="queryByFactoryId" resultType="org.jeecg.modules.mdc.entity.MdcEquipment">
+        SELECT
+            me.*
+        FROM
+            base_equipment_factory bef,
+            mdc_equipment me
+        WHERE
+            bef.equipment_id = me.id
+          AND bef.factory_id = #{ factoryId }
+        ORDER BY me.equipment_id
+    </select>
+
+    <select id="queryIdsByFactorys" resultType="java.lang.String">
+        SELECT
+            me.equipment_id
+        FROM
+            mdc_equipment me
+            LEFT JOIN base_equipment_factory bef ON me.id = bef.equipment_id
+        WHERE
+            bef.factory_id IN
+        <foreach collection="allFactoryIds" index="index" item="id" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </select>
+
 </mapper>

--
Gitblit v1.9.3