From 3bdaa5708b94e64f813f70ede8ba0bbd1a3179ec Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期五, 27 三月 2026 15:08:01 +0800
Subject: [PATCH] 成品检数据查询

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

diff --git a/src/main/resources/mapper/production/ProductionProductRouteItemMapper.xml b/src/main/resources/mapper/production/ProductionProductRouteItemMapper.xml
index bae946b..7416e9d 100644
--- a/src/main/resources/mapper/production/ProductionProductRouteItemMapper.xml
+++ b/src/main/resources/mapper/production/ProductionProductRouteItemMapper.xml
@@ -14,5 +14,54 @@
         <result column="update_time" property="updateTime"/>
         <result column="tenant_id" property="tenantId"/>
     </resultMap>
+    <select id="processPage" resultType="com.ruoyi.quality.dto.ProcessPageDto">
+        select ppri.id productionProductRouteItemId,
+               ppri.create_time,
+               ppm.product_no,
+               po.nps_no,
+               pp.name process,
+               ppri.post_name,
+               ppm.schedule,
+               pms.material_code,
+               pm.product_name,
+               pms.model,
+               po.strength,
+               ppo.quantity qualifiedQuantity,
+               ppo.scrap_qty unqualifiedQuantity,
+               ppo.quantity + ppo.scrap_qty quantity
+        from production_product_route_item ppri
+                 left join production_product_main ppm on ppri.product_main_id = ppm.id
+                 left join production_product_output ppo on ppo.product_main_id = ppm.id
+                 left join product_order po on ppm.product_order_id = po.id
+                 left join product_process pp on ppri.process_id = pp.id
+                 left join product_material_sku pms on pms.id = po.product_material_sku_id
+                 left join product_material pm on pm.id = pms.product_id
+        where 1=1
+            <if test="c.npsNo != null and c.npsNo != ''">
+                AND po.nps_no LIKE CONCAT('%', #{c.npsNo}, '%')
+            </if>
+            <if test="c.process != null and c.process != ''">
+                AND pp.name LIKE CONCAT('%', #{c.process}, '%')
+            </if>
+            <if test="c.productNo != null and c.productNo != ''">
+                AND ppm.product_no LIKE CONCAT('%', #{c.productNo}, '%')
+            </if>
+            <if test="c.productName != null and c.productName != ''">
+                AND pm.product_name LIKE CONCAT('%', #{c.productName}, '%')
+            </if>
+            <if test="c.materialCode != null and c.materialCode != ''">
+                AND pms.material_code LIKE CONCAT('%', #{c.materialCode}, '%')
+            </if>
+            <if test="c.model != null and c.model != ''">
+                AND pms.model LIKE CONCAT('%', #{c.model}, '%')
+            </if>
+            <if test="c.strength != null and c.strength != ''">
+                AND po.strength = #{c.strength}
+            </if>
+            <if test="c.startTime != null and c.endTime != null">
+                AND ppri.create_time BETWEEN #{c.startTime} AND #{c.endTime} + INTERVAL 1 DAY - INTERVAL 1 MICROSECOND
+            </if>
+        order by ppri.id desc
+    </select>
 
 </mapper>

--
Gitblit v1.9.3