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/ProductMaterialSkuMapper.xml |   33 +++++++++++++++++++++++++++++++--
 1 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/src/main/resources/mapper/production/ProductMaterialSkuMapper.xml b/src/main/resources/mapper/production/ProductMaterialSkuMapper.xml
index ccd26ed..678bb12 100644
--- a/src/main/resources/mapper/production/ProductMaterialSkuMapper.xml
+++ b/src/main/resources/mapper/production/ProductMaterialSkuMapper.xml
@@ -6,10 +6,10 @@
 
     <resultMap id="ProductMaterialSkuResultMap" type="com.ruoyi.production.pojo.ProductMaterialSku">
         <id property="id" column="id"/>
-        <result property="materialId" column="material_id"/>
+        <result property="productId" column="product_id"/>
         <result property="identifierCode" column="identifier_code"/>
         <result property="materialCode" column="material_code"/>
-        <result property="specification" column="specification"/>
+        <result property="model" column="model"/>
         <result property="supplyType" column="supply_type"/>
         <result property="originatorName" column="originator_name"/>
         <result property="originatorOrg" column="originator_org"/>
@@ -19,4 +19,33 @@
         <result property="updateTime" column="update_time"/>
     </resultMap>
 
+    <select id="selectSkuWithMaterialPage" resultType="com.ruoyi.production.dto.ProductMaterialSkuDto">
+        SELECT
+        sku.id AS id,
+        sku.product_id AS productId,
+        sku.material_code AS materialCode,
+        sku.model AS model,
+        sku.supply_type AS supplyType,
+        m.product_name AS productName,
+        m.unit AS unit
+        FROM product_material_sku sku
+        LEFT JOIN product_material m ON sku.product_id = m.id
+        <where>
+            <if test="dto.productId != null">
+                AND sku.product_id = #{dto.productId}
+            </if>
+            <if test="dto.model != null and dto.model != ''">
+                AND sku.model LIKE CONCAT('%', #{dto.model}, '%')
+            </if>
+            <if test="dto.materialCode != null and dto.materialCode != ''">
+                AND sku.material_code LIKE CONCAT('%', #{dto.materialCode}, '%')
+            </if>
+
+            <if test="type != null and type == 1 and dto.productName != null and dto.productName != ''">
+                AND m.product_name LIKE CONCAT('%', #{dto.productName}, '%')
+            </if>
+        </where>
+        ORDER BY sku.id ASC
+    </select>
+
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3