From cc9e229da3a5d06be13e9ade5b5254d403f47c57 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期四, 02 四月 2026 14:42:30 +0800
Subject: [PATCH] 生产报表相关接口
---
src/main/resources/mapper/production/ProductionProductMainMapper.xml | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/src/main/resources/mapper/production/ProductionProductMainMapper.xml b/src/main/resources/mapper/production/ProductionProductMainMapper.xml
index 875c2a1..5ea73fa 100644
--- a/src/main/resources/mapper/production/ProductionProductMainMapper.xml
+++ b/src/main/resources/mapper/production/ProductionProductMainMapper.xml
@@ -19,9 +19,13 @@
u.nick_name as nickName,
p.product_name as productName,
pp.name as process,
+ pp.qualified_rate as processQualifiedRate,
pm.model as productModelName,
+ pm.material_code as materialCode,
ppo.quantity,
ppo.scrap_qty,
+ (ppo.quantity - ppo.scrap_qty) as qualifiedQty,
+ case when ppo.quantity > 0 then round((ppo.quantity - ppo.scrap_qty) / ppo.quantity * 100, 2) else 0 end as actualQualifiedRate,
ppo.other_data,
pm.unit,
sl.sales_contract_no salesContractNo
@@ -64,7 +68,6 @@
ppo.quantity,
ppo.scrap_qty,
ppo.other_data,
- (ppo.quantity - ppo.scrap_qty) as qualifiedQty,
pm.unit
from
production_product_main ppm
@@ -97,6 +100,7 @@
p.product_name,
pm.model as product_model_name,
pm.unit,
+ pm.material_code as materialCode,
slpa.process,
ppo.quantity,
slpa.work_hours,
@@ -147,4 +151,13 @@
#{id}
</foreach>
</delete>
+
+ <select id="checkPreviousProcessReported" resultType="java.lang.Boolean">
+ SELECT CASE WHEN COUNT(*) > 0 THEN TRUE ELSE FALSE END
+ FROM production_product_main ppm
+ JOIN product_work_order pwo ON ppm.work_order_id = pwo.id
+ JOIN product_process_route_item ppri ON pwo.product_process_route_item_id = ppri.id
+ WHERE ppri.product_route_id = #{productRouteId}
+ AND ppri.drag_sort = #{currentDragSort} - 1
+ </select>
</mapper>
--
Gitblit v1.9.3