From cebef271a105494b4e4e5c09f2d12636d620304c Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期三, 18 三月 2026 10:14:50 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_宁夏_中盛建材' into dev_宁夏_中盛建材

---
 src/main/resources/mapper/production/ProductBomMapper.xml |   41 ++++++++++++++++++++---------------------
 1 files changed, 20 insertions(+), 21 deletions(-)

diff --git a/src/main/resources/mapper/production/ProductBomMapper.xml b/src/main/resources/mapper/production/ProductBomMapper.xml
index ec06cd3..e3532c5 100644
--- a/src/main/resources/mapper/production/ProductBomMapper.xml
+++ b/src/main/resources/mapper/production/ProductBomMapper.xml
@@ -5,7 +5,7 @@
     <!-- 閫氱敤鏌ヨ鏄犲皠缁撴灉 -->
     <resultMap id="BaseResultMap" type="com.ruoyi.production.pojo.ProductBom">
         <id column="id" property="id"/>
-        <result column="product_model_id" property="productModelId"/>
+        <result column="dict_code" property="dictCode"/>
         <result column="bom_no" property="bomNo"/>
         <result column="remark" property="remark"/>
         <result column="version" property="version"/>
@@ -15,34 +15,33 @@
         <result column="update_user" property="updateUser"/>
         <result column="tenant_id" property="tenantId"/>
     </resultMap>
+
     <select id="listPage" resultType="com.ruoyi.production.dto.ProductBomDto">
-        select * from (select pb.*,
-        pm.model productModelName,
-        p.product_name productName
-        from product_bom pb
-        left join product_model pm on pb.product_model_id = pm.id
-        left join product p on pm.product_id = p.id)A
-        where 1=1
-        <if test="c.productModelName != null">
-            and productModelName = #{c.productModelName}
+        SELECT
+        pm.*,
+        sdd.dict_label AS dictLabel
+        FROM product_bom pm
+        LEFT JOIN sys_dict_data sdd ON sdd.dict_code = pm.dict_code
+        WHERE 1=1
+        <if test="c.dictCode != null">
+            AND pm.dict_code = #{c.dictCode}
         </if>
-        <if test="c.productName != null">
-            and productName = #{c.productName}
+        <if test="c.bomNo != null and c.bomNo != ''">
+            AND pm.bom_no = #{c.bomNo}
         </if>
-        <if test="c.bomNo != null">
-            and bom_no = #{c.bomNo}
-        </if>
-        <if test="c.version != null">
-            and version = #{c.version}
+        <if test="c.version != null and c.version != ''">
+            AND pm.version = #{c.version}
         </if>
     </select>
+
     <select id="getById" resultType="com.ruoyi.production.dto.ProductBomDto">
         select pb.*,
-               pm.model productModelName,
-               p.product_name productName
+               pms.model       AS productModelName,
+               pm.product_name AS productName
         from product_bom pb
-                 left join product_model pm on pb.product_model_id = pm.id
-                 left join product p on pm.product_id = p.id
+                 left join product_material_sku pms on pb.product_model_id = pms.id
+                 left join product_material pm on pms.product_id = pm.id
+        where pb.id = #{id}
     </select>
 
 </mapper>

--
Gitblit v1.9.3