From ec7d3b867e7b7f5073dda1684a8720424b9da5ad Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期二, 24 三月 2026 15:38:00 +0800
Subject: [PATCH] feat: 生产报工的详情、修改、删除接口

---
 src/main/resources/mapper/production/ProductMaterialMapper.xml |   45 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 45 insertions(+), 0 deletions(-)

diff --git a/src/main/resources/mapper/production/ProductMaterialMapper.xml b/src/main/resources/mapper/production/ProductMaterialMapper.xml
index 827273a..6281790 100644
--- a/src/main/resources/mapper/production/ProductMaterialMapper.xml
+++ b/src/main/resources/mapper/production/ProductMaterialMapper.xml
@@ -16,4 +16,49 @@
         <result property="updateTime" column="update_time"/>
     </resultMap>
 
+    <select id="selectProductByModelId" resultType="com.ruoyi.production.dto.ProductMaterialSkuDto"
+            parameterType="java.lang.Long">
+        select pm.product_name as productName,
+        pm.unit,
+        pms.material_code as materialCode,
+        pms.model
+        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>
+
+    <select id="selectProductByProductMainId" resultType="com.ruoyi.production.dto.ProductMaterialSkuDto"
+            parameterType="java.lang.Long">
+        select
+        pm.product_name as productName,
+        pm.unit,
+        pms.material_code as materialCode,
+        pms.model
+        from product_order po
+        left join product_order_plan pop on po.id = pop.product_order_id
+        left join production_plan pp on pp.id = pop.production_plan_id
+        left join product_material_sku pms on pms.id = pop.production_plan_id
+        left join product_material pm on pm.id = pms.product_id
+        <where>
+            <choose>
+                <when test="productOrderId != null">
+                    po.id = #{productOrderId}
+                </when>
+                <otherwise>
+                    1 = 0
+                </otherwise>
+            </choose>
+        </where>
+    </select>
+
+
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3