From 0b4c9f2a37a825a84725cb66ecf04060831ac5d0 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期三, 25 三月 2026 09:59:49 +0800
Subject: [PATCH] fix: 报工详情返回工序详细信息、产品详细信息
---
src/main/resources/mapper/production/ProductBomMapper.xml | 45 +++++++++++++++++++++++++++------------------
1 files changed, 27 insertions(+), 18 deletions(-)
diff --git a/src/main/resources/mapper/production/ProductBomMapper.xml b/src/main/resources/mapper/production/ProductBomMapper.xml
index e812b2c..b99aefa 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"/>
@@ -17,38 +17,47 @@
</resultMap>
<select id="listPage" resultType="com.ruoyi.production.dto.ProductBomDto">
- SELECT * FROM (
SELECT
- pb.*,
- pms.model AS productModelName,
- pm.product_name AS productName
- FROM product_bom pb
- LEFT JOIN product_material_sku pms ON pb.product_model_id = pms.id
- LEFT JOIN product_material pm ON pms.product_id = pm.id
- ) A
+ 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.productModelName != null and c.productModelName != ''">
- AND productModelName LIKE CONCAT('%', #{c.productModelName}, '%')
- </if>
- <if test="c.productName != null and c.productName != ''">
- AND productName LIKE CONCAT('%', #{c.productName}, '%')
+ <if test="c.dictCode != null">
+ AND pm.dict_code = #{c.dictCode}
</if>
<if test="c.bomNo != null and c.bomNo != ''">
- AND bom_no = #{c.bomNo}
+ AND pm.bom_no = #{c.bomNo}
</if>
<if test="c.version != null and c.version != ''">
- AND version = #{c.version}
+ AND pm.version = #{c.version}
</if>
</select>
<select id="getById" resultType="com.ruoyi.production.dto.ProductBomDto">
select pb.*,
- pms.model AS productModelName,
- pm.product_name AS productName
+ pms.model AS productModelName,
+ pm.product_name AS productName
from product_bom pb
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>
+ <select id="selectStrengthById" resultType="java.lang.String" parameterType="java.lang.Long">
+ select sdd.dict_label
+ from product_bom pb
+ left join sys_dict_data sdd on pb.dict_code = sdd.dict_code
+ <where>
+ <choose>
+ <when test="bomId != null">
+ pb.id = #{bomId}
+ </when>
+ <otherwise>
+ 1 = 0
+ </otherwise>
+ </choose>
+ </where>
+ </select>
+
</mapper>
--
Gitblit v1.9.3