From 19effb2444eaf331f61fd0d43d3735f8d1baf768 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期三, 18 三月 2026 10:14:44 +0800
Subject: [PATCH] fix: BOM的子集取消第一层限制

---
 src/main/resources/mapper/production/ProductStructureMapper.xml |   35 +++++++++++++++++------------------
 1 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/src/main/resources/mapper/production/ProductStructureMapper.xml b/src/main/resources/mapper/production/ProductStructureMapper.xml
index e5e692e..18a4f89 100644
--- a/src/main/resources/mapper/production/ProductStructureMapper.xml
+++ b/src/main/resources/mapper/production/ProductStructureMapper.xml
@@ -13,29 +13,28 @@
     </resultMap>
 
     <select id="listByBomId" resultType="com.ruoyi.production.dto.ProductStructureDto">
-        select ps.*,
-               pm.product_name as product_name,
-               pp.name         as process_name,
-               pms.product_id as product_id,
-               pms.model       as model,
-               pms.material_code       as productCode
-        from product_structure ps
-                 left join product_material_sku pms on ps.product_model_id = pms.id
-                 left join product_material pm on pms.product_id = pm.id
-                 left join product_process pp on ps.process_id = pp.id
-        where ps.bom_id = #{bomId}
-        order by ps.id
+        SELECT ps.id,
+               ps.parent_id,
+               ps.bom_id,
+               ps.unit_quantity,
+               ps.process_id,
+               pp.name         AS process_name,
+               pm.product_name AS productName,
+               pm.unit,
+               pms.model
+
+        FROM product_structure ps
+                 LEFT JOIN product_process pp ON ps.process_id = pp.id
+                 LEFT JOIN product_material_sku pms ON pms.id = ps.product_model_id
+                 LEFT JOIN product_material pm ON pm.id = pms.product_id
+        WHERE ps.bom_id = #{bomId}
+        ORDER BY ps.id
     </select>
 
     <select id="listByBomAndProcess" resultType="com.ruoyi.production.dto.ProductStructureDto">
         select ps.*,
-               pm.product_name as product_name,
-               pp.name         as process_name,
-               pms.product_id as product_id,
-               pms.model       as model
+               pp.name as process_name
         from product_structure ps
-                 left join product_material_sku pms on ps.product_model_id = pms.id
-                 left join product_material pm on pms.product_id = pm.id
                  left join product_process pp on ps.process_id = pp.id
         where ps.bom_id = #{bomId}
           and ps.process_id = #{processId}

--
Gitblit v1.9.3