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/ProductOrderMapper.xml | 80 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 80 insertions(+), 0 deletions(-)
diff --git a/src/main/resources/mapper/production/ProductOrderMapper.xml b/src/main/resources/mapper/production/ProductOrderMapper.xml
index 4cd3372..b9193a0 100644
--- a/src/main/resources/mapper/production/ProductOrderMapper.xml
+++ b/src/main/resources/mapper/production/ProductOrderMapper.xml
@@ -151,4 +151,84 @@
ORDER BY pp.apply_no
</select>
+ <select id="finishedPage" resultType="com.ruoyi.quality.dto.FinishedPageDto">
+ select * from
+ (select po.id productOrderId,
+ po.status,
+ po.nps_no,
+ sku.material_code,
+ pm.product_name,
+ sku.model,
+ po.strength,
+ po.quantity needQuantity,
+ sum(ppo.quantity) qualifiedQuantity,
+ sum(ppo.scrap_qty) unqualifiedQuantity,
+ sum(ppo.quantity+ppo.scrap_qty) quantity
+ from product_order po
+ LEFT JOIN product_material_sku sku ON po.product_material_sku_id = sku.id
+ LEFT JOIN product_material pm ON sku.product_id = pm.id
+ LEFT JOIN production_product_main ppm ON ppm.product_order_id = po.id
+ LEFT JOIN production_product_output ppo ON ppo.product_main_id = ppm.id
+ group by po.id ,
+ po.status,
+ po.nps_no,
+ sku.material_code,
+ pm.product_name,
+ sku.model,
+ po.strength,
+ po.quantity
+ order by po.id desc )A
+ <where>
+ <if test="c.npsNo != null and c.npsNo != ''">
+ AND A.nps_no LIKE CONCAT('%', #{c.npsNo}, '%')
+ </if>
+ <if test="c.productName != null and c.productName != ''">
+ AND A.product_name LIKE CONCAT('%', #{c.productName}, '%')
+ </if>
+ <if test="c.materialCode != null and c.materialCode != ''">
+ AND A.material_code LIKE CONCAT('%', #{c.materialCode}, '%')
+ </if>
+ <if test="c.model != null and c.model != ''">
+ AND A.model LIKE CONCAT('%', #{c.model}, '%')
+ </if>
+ <if test="c.strength != null and c.strength != ''">
+ AND A.strength = #{c.strength}
+ </if>
+ </where>
+ </select>
+ <select id="finishedRatio" resultType="com.ruoyi.quality.dto.FinishedRatioDto">
+ select A.material_code,
+ product_name,
+ model,
+ unit,
+ actualInputQuantity,
+ actualOutputQuantity,
+ actualInputQuantity / actualOutputQuantity actualInputOutputRatio,
+ unit_quantity standardInputOutputRatio,
+ (actualInputQuantity / actualOutputQuantity - unit_quantity)/unit_quantity deviationRate
+ from (select
+ sku.material_code,
+ pm.product_name,
+ sku.model,
+ pprip.unit,
+ pos.unit_quantity,
+ sum(pprip.product_value) actualInputQuantity,
+ sum(ppo.quantity+ppo.scrap_qty) actualOutputQuantity
+ from production_product_route_item_param pprip
+ left join production_product_route_item ppri on ppri.id=pprip.production_product_route_item_id
+ left join production_product_main ppm on ppm.id=ppri.product_main_id
+ left join production_product_output ppo on ppm.id=ppo.product_main_id
+ left join product_material_sku sku ON pprip.product_id = sku.id
+ left join product_material pm ON sku.product_id = pm.id
+ left join production_order_structure pos ON pos.product_model_id = pprip.product_id
+ where ppm.product_order_id = #{productOrderId}
+ and pos.order_id = #{productOrderId}
+ and pprip.order_item_param_id is null
+ group by sku.material_code,
+ pm.product_name,
+ sku.model,
+ pos.unit_quantity,
+ pprip.unit)A
+
+ </select>
</mapper>
--
Gitblit v1.9.3