From 2a21bf56c3296510fa56024b6062aae8e99d2293 Mon Sep 17 00:00:00 2001
From: zhanghl <253316343@qq.com>
Date: 星期四, 08 五月 2025 10:37:13 +0800
Subject: [PATCH] 生成钣金工单计划 基础代码

---
 aps-modules/aps-core/src/main/resources/mapper/core/ApsPlatePlanMapper.xml |   31 ++++++++++++++++++++++++++++++-
 1 files changed, 30 insertions(+), 1 deletions(-)

diff --git a/aps-modules/aps-core/src/main/resources/mapper/core/ApsPlatePlanMapper.xml b/aps-modules/aps-core/src/main/resources/mapper/core/ApsPlatePlanMapper.xml
index 5bf67f2..84ab2b7 100644
--- a/aps-modules/aps-core/src/main/resources/mapper/core/ApsPlatePlanMapper.xml
+++ b/aps-modules/aps-core/src/main/resources/mapper/core/ApsPlatePlanMapper.xml
@@ -44,6 +44,8 @@
         <result property="opStatus"    column="op_status"    />
         <result property="nextOpName"    column="next_op_name"    />
         <result property="unmatchedQuantity"    column="unmatched_quantity"    />
+        <result property="professionalAffiliation"    column="professional_affiliation"    />
+        <result property="requireId"    column="require_id"    />
     </resultMap>
 
     <sql id="selectApsPlatePlanVo">
@@ -53,7 +55,7 @@
                work_center, department, plan_start_day, plan_end_day, standby_number, standby_name,
                standby_stock, next_process_deparment, is_suspended, is_outsourcing, account, advanced_materials,
                advanced_document_number, advanced_requirement_day, is_plan_complete, is_stock_complete,
-               has_turnback, has_risk, std_op, op_status, next_op_name ,unmatched_quantity
+               has_turnback, has_risk, std_op, op_status, next_op_name ,unmatched_quantity,professional_affiliation
         from aps_plate_plan
     </sql>
 
@@ -263,4 +265,31 @@
         update  aps_plate_plan  set del_flag='1' where del_flag ='0'
     </update>
 
+    <select id="selectPlatePlanByPlantMajor" parameterType="ApsPlatePlan" resultMap="ApsPlatePlanResult">
+        select  id,document_number,main_part_number,item_number,plant,professional_affiliation,production_quantity,require_id
+        from aps_plate_plan
+        <where>
+            <if test="plant != null "> and plant = #{plant}</if>
+            <if test="professionalAffiliation != null "> and professional_affiliation = #{professionalAffiliation}</if>
+            and del_flag='0'
+        </where>
+        order by document_number asc,id asc
+    </select>
+
+    <select id="selectUnMatchPlateSubPlan" parameterType="ApsPlatePlan" resultMap="ApsPlatePlanResult">
+        select  id,document_number,main_part_number,item_number,plant,professional_affiliation,production_quantity,
+             ,unmatched_quantity
+        from aps_plate_plan
+        where  del_flag='0' and professional_affiliation !='0' and unmatched_quantity > 0
+        <if test="plant != null  and plan !='' "> and plant = #{plant}</if>
+        order by document_number asc,id asc
+        limit 1
+    </select>
+
+
+    <update id="updatePlanUnMatchQtyByVersion" parameterType="ApsPlatePlan">
+        update aps_plate_plan
+        set unmatched_quantity=#{unmatched_quantity},version=version+1
+        where id=#{id} and version=#{version}
+    </update>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3