From 35a8e2f73dd2a959409d07b1bd657580662b6956 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期二, 24 三月 2026 13:03:44 +0800
Subject: [PATCH] feat: 根据产品规格获取产品名称
---
src/main/resources/mapper/production/ProductMaterialMapper.xml | 20 ++++++++++++++++++--
1 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/src/main/resources/mapper/production/ProductMaterialMapper.xml b/src/main/resources/mapper/production/ProductMaterialMapper.xml
index 0f55a3b..7e014c9 100644
--- a/src/main/resources/mapper/production/ProductMaterialMapper.xml
+++ b/src/main/resources/mapper/production/ProductMaterialMapper.xml
@@ -9,11 +9,27 @@
<result property="tenantId" column="tenant_id"/>
<result property="materialTypeId" column="material_type_id"/>
<result property="inventoryCategoryId" column="inventory_category_id"/>
- <result property="materialName" column="material_name"/>
- <result property="baseUnit" column="base_unit"/>
+ <result property="productName" column="product_name"/>
+ <result property="unit" column="unit"/>
<result property="remark" column="remark"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
</resultMap>
+ <select id="selectProductModelIdByName" resultType="java.lang.String" parameterType="java.lang.Long">
+ select pm.product_name
+ from product_material pm
+ left join product_material_sku pms on pms.product_id = pm.id
+ <where>
+ <choose>
+ <when test="productModelId != null">
+ pms.id = #{productModelId}
+ </when>
+ <otherwise>
+ 1 = 0
+ </otherwise>
+ </choose>
+ </where>
+ </select>
+
</mapper>
\ No newline at end of file
--
Gitblit v1.9.3