From 3c87c3ff67c2193ab5bfaa31f0fb1ad5a68cd5af Mon Sep 17 00:00:00 2001
From: guoyuji <guoyujie@ng.com>
Date: 星期五, 15 三月 2024 09:09:10 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
---
north-glass-erp/src/main/resources/mapper/sd/OrderProcessDetail.xml | 72 ++++++++++++++++++++++++++++++++++++
1 files changed, 72 insertions(+), 0 deletions(-)
diff --git a/north-glass-erp/src/main/resources/mapper/sd/OrderProcessDetail.xml b/north-glass-erp/src/main/resources/mapper/sd/OrderProcessDetail.xml
new file mode 100644
index 0000000..2307263
--- /dev/null
+++ b/north-glass-erp/src/main/resources/mapper/sd/OrderProcessDetail.xml
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.example.erp.mapper.sd.OrderProcessDetailMapper">
+
+ <insert id="insertOrderProcessDetail" >
+ insert into
+ order_process_detail(
+ order_id,
+ order_number,
+ technology_number,
+ process,
+ process_id
+ )
+ values
+ <foreach collection ="processDetailList" item="processDetail" separator =",">
+ (
+ #{processDetail.orderId},
+ #{processDetail.orderNumber},
+ #{processDetail.technologyNumber},
+ #{processDetail.process},
+ #{processDetail.processId}
+ )
+ </foreach>
+
+
+ </insert>
+ <update id="updateQuantity">
+ update sd.order_process_detail as a
+ inner join
+ (select
+ rwd.completed_quantity,
+ rwd.breakage_quantity,
+ rw.process_id,
+ rwd.order_number,
+ rwd.technology_number
+ from pp.reporting_work_detail as rwd
+ left join pp.reporting_work as rw
+ on rwd.reporting_work_id = rw.reporting_work_id
+ where rwd.reporting_work_id =#{reportingWorkId} ) as b
+ on a.process_id = b.process_id
+ and a.order_number = b.order_number
+ and a.technology_number = b.technology_number
+
+ <if test="type == 'delete'">
+ set a.reporting_work_num_count
+ = a.reporting_work_num_count-b.completed_quantity,
+
+ a.reporting_work_num
+ = a.reporting_work_num-b.completed_quantity,
+
+ a.broken_num
+ = a.broken_num-b.breakage_quantity
+ </if>
+
+ <if test="type == 'add'">
+ set a.reporting_work_num_count
+ = a.reporting_work_num_count+b.completed_quantity,
+
+ a.reporting_work_num
+ = a.reporting_work_num+b.completed_quantity,
+
+ a.broken_num
+ = a.broken_num+b.breakage_quantity
+ </if>
+
+ where a.process = #{process}
+
+ </update>
+
+</mapper>
\ No newline at end of file
--
Gitblit v1.8.0