From fcc62c9f3b829b51eb8f0607d9276c49b63c6331 Mon Sep 17 00:00:00 2001
From: zhanghl <253316343@qq.com>
Date: 星期日, 27 四月 2025 14:24:57 +0800
Subject: [PATCH] 零件统计问题修复

---
 aps-modules/aps-core/src/main/resources/mapper/core/ApsPartPlanMapper.xml |   24 +++++++++++++++++++++---
 1 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/aps-modules/aps-core/src/main/resources/mapper/core/ApsPartPlanMapper.xml b/aps-modules/aps-core/src/main/resources/mapper/core/ApsPartPlanMapper.xml
index ce3e188..b6f44c9 100644
--- a/aps-modules/aps-core/src/main/resources/mapper/core/ApsPartPlanMapper.xml
+++ b/aps-modules/aps-core/src/main/resources/mapper/core/ApsPartPlanMapper.xml
@@ -40,10 +40,11 @@
         <result property="isStockComplete"    column="is_stock_complete"    />
         <result property="hasTurnback"    column="has_turnback"    />
         <result property="hasRisk"    column="has_risk"    />
+        <result property="stdOp"    column="std_op"    />
     </resultMap>
 
     <sql id="selectApsPartPlanVo">
-        select id, master_planner, week_day, week_cycle, main_part_number, main_part_drawing_number, customer, business_type, document_number, requirement_type, document_status, item_number, drawing_no, version_number, production_quantity, good_products_quantity, process_number, 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 from aps_part_plan
+        select id, master_planner, week_day, week_cycle, main_part_number, main_part_drawing_number, customer, business_type, document_number, requirement_type, document_status, item_number, drawing_no, version_number, production_quantity, good_products_quantity, process_number, 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 from aps_part_plan
     </sql>
 
     <select id="selectApsPartPlanList" parameterType="com.aps.core.domain.ApsPartPlan" resultMap="ApsPartPlanResult">
@@ -82,6 +83,8 @@
             <if test="isStockComplete != null "> and is_stock_complete = #{isStockComplete}</if>
             <if test="hasTurnback != null "> and has_turnback = #{hasTurnback}</if>
             <if test="hasRisk != null "> and has_risk = #{hasRisk}</if>
+            <if test="stdOp != null "> and std_op = #{stdOp}</if>
+             and del_flag='0'
         </where>
     </select>
     
@@ -128,6 +131,7 @@
             <if test="isStockComplete != null">is_stock_complete,</if>
             <if test="hasTurnback != null">has_turnback,</if>
             <if test="hasRisk != null">has_risk,</if>
+            <if test="stdOp != null">std_op,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null and id != ''">#{id},</if>
@@ -165,6 +169,7 @@
             <if test="isStockComplete != null">#{isStockComplete},</if>
             <if test="hasTurnback != null">#{hasTurnback},</if>
             <if test="hasRisk != null">#{hasRisk},</if>
+            <if test="stdOp != null">#{stdOp},</if>
          </trim>
     </insert>
 
@@ -205,6 +210,7 @@
             <if test="isStockComplete != null">is_stock_complete = #{isStockComplete},</if>
             <if test="hasTurnback != null">has_turnback = #{hasTurnback},</if>
             <if test="hasRisk != null">has_risk = #{hasRisk},</if>
+            <if test="stdOp != null">std_op = #{stdOp},</if>
         </trim>
         where id = #{id}
     </update>
@@ -256,7 +262,8 @@
         is_stock_complete,
         has_turnback,
         has_risk,
-        plant
+        plant,
+        std_op
         ) values
         <foreach item="item" index="index" collection="list" separator=",">
             (#{item.id},#{item.masterPlanner},#{item.weekDay},#{item.weekCycle}
@@ -268,7 +275,18 @@
             ,#{item.standbyNumber},#{item.standbyName},#{item.standbyStock},#{item.nextProcessDeparment}
             ,#{item.isSuspended},#{item.isOutsourcing},#{item.account},#{item.advancedMaterials}
             ,#{item.advancedDocumentNumber},#{item.advancedRequirementDay},#{item.isPlanComplete}
-            ,#{item.isStockComplete},#{item.hasTurnback},#{item.hasRisk},#{item.plant})
+            ,#{item.isStockComplete},#{item.hasTurnback},#{item.hasRisk},#{item.plant}),#{item.stdOp})
         </foreach>
     </insert>
+
+    <update id="selectPartPlanListByDocumentNumbers" parameterType="String" >
+        select id from aps_part_plan where documentNumber in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </update>
+
+    <update id="removeAllPartPlans" parameterType="String">
+        update  aps_part_plan  set del_flag='1' where del_flag ='0'
+    </update>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3