From 0be02df3d287f802c76e5738916301a877dfaa0e Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期一, 27 四月 2026 16:56:12 +0800
Subject: [PATCH] feat: 生产报工与报工台账功能更改完成
---
src/main/resources/mapper/production/ProductOrderMapper.xml | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/src/main/resources/mapper/production/ProductOrderMapper.xml b/src/main/resources/mapper/production/ProductOrderMapper.xml
index 6b993bf..f8d10e0 100644
--- a/src/main/resources/mapper/production/ProductOrderMapper.xml
+++ b/src/main/resources/mapper/production/ProductOrderMapper.xml
@@ -110,4 +110,14 @@
WHERE create_time >= #{startDate} AND create_time <= #{endDate}
AND complete_quantity < quantity
</select>
+
+ <update id="addCompleteQtyIfNotExceed">
+ update product_order
+ set
+ complete_quantity = complete_quantity + #{delta},
+ start_time = ifnull(start_time, now()),
+ end_time = case when (complete_quantity + #{delta}) = quantity then now() else end_time end
+ where id = #{id}
+ and (complete_quantity + #{delta}) <![CDATA[ <= ]]> quantity
+ </update>
</mapper>
--
Gitblit v1.9.3