From 2f58ddd5085b9e51bcc4b7e1ad2e850a95e43bbd Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期三, 11 三月 2026 17:42:59 +0800
Subject: [PATCH] feat: 同步物料编码数据

---
 src/main/resources/mapper/productionPlan/ProductionPlanMapper.xml |   46 ++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 44 insertions(+), 2 deletions(-)

diff --git a/src/main/resources/mapper/productionPlan/ProductionPlanMapper.xml b/src/main/resources/mapper/productionPlan/ProductionPlanMapper.xml
index 22812ac..4bf0e0d 100644
--- a/src/main/resources/mapper/productionPlan/ProductionPlanMapper.xml
+++ b/src/main/resources/mapper/productionPlan/ProductionPlanMapper.xml
@@ -34,13 +34,55 @@
         <result property="dataSourceType" column="data_source_type"/>
         <result property="createTime" column="create_time"/>
         <result property="updateTime" column="update_time"/>
+        <result property="totalCount" column="total_count"/>
     </resultMap>
 
 
-    <select id="listPage" resultMap="ProductionPlanResultMap">
+    <select id="listPage" resultType="com.ruoyi.productionPlan.dto.ProductionPlanDto">
         SELECT *
-        FROM production_plan
+        FROM production_plan pp
         WHERE 1 = 1
+        <if test="c.customerName != null and c.customerName != '' ">
+            AND pp.customer_name LIKE CONCAT('%',#{c.customerName},'%')
+        </if>
+        <if test="c.productName != null and c.productName != '' ">
+            AND pp.product_name LIKE CONCAT('%',#{c.productName},'%')
+        </if>
+        <if test="c.productSpec != null and c.productSpec != '' ">
+            AND pp.product_spec LIKE CONCAT('%',#{c.productSpec},'%')
+        </if>
+        <if test="c.materialCode != null and c.materialCode != '' ">
+            AND pp.material_code LIKE CONCAT('%',#{c.materialCode},'%')
+        </if>
+    </select>
+
+    <select id="selectSummaryByProductType" resultType="com.ruoyi.productionPlan.dto.ProductionPlanSummaryDto">
+        SELECT
+        material_code,
+        product_name,
+        product_spec,
+        length,
+        width,
+        height,
+        COALESCE(SUM(quantity),0) AS quantity,
+        COALESCE(SUM(volume),0) AS volume
+        FROM production_plan
+        <where>
+            <if test="materialCode != null and materialCode != ''">
+                AND material_code LIKE CONCAT('%', #{materialCode}, '%')
+            </if>
+
+            <if test="productName != null and productName != ''">
+                AND product_name LIKE CONCAT('%', #{productName}, '%')
+            </if>
+        </where>
+        GROUP BY
+        material_code,
+        product_name,
+        product_spec,
+        length,
+        width,
+        height
     </select>
 
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3