From e6ebaf71bd67866d6233a03ae6eff4a7fb2e5d67 Mon Sep 17 00:00:00 2001
From: zhanghl <253316343@qq.com>
Date: 星期四, 15 五月 2025 11:40:27 +0800
Subject: [PATCH] 钣金工单计划:优化子件工单的读取方式 先存储内存,再从内存扣减,最后一起保存

---
 aps-modules/aps-core/src/main/resources/mapper/core/ApsStandardProcessRouteHeaderMapper.xml |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/aps-modules/aps-core/src/main/resources/mapper/core/ApsStandardProcessRouteHeaderMapper.xml b/aps-modules/aps-core/src/main/resources/mapper/core/ApsStandardProcessRouteHeaderMapper.xml
index 0416d52..8ca8ab2 100644
--- a/aps-modules/aps-core/src/main/resources/mapper/core/ApsStandardProcessRouteHeaderMapper.xml
+++ b/aps-modules/aps-core/src/main/resources/mapper/core/ApsStandardProcessRouteHeaderMapper.xml
@@ -107,10 +107,19 @@
 
     <select id="queryStandardProcessRouteHeaderByPlantAndItemCode" parameterType="String" resultMap="ApsStandardProcessRouteHeaderResult">
         <include refid="selectApsStandardProcessRouteHeaderVo"/>
-        <where>
+         where del_flag = '0'
             <if test="orgCode != null  and orgCode != ''"> and org_code = #{orgCode}</if>
             <if test="itemCode != null  and itemCode != ''"> and item_code = #{itemCode} </if>
-            and del_flag = '0'
-        </where>
+    </select>
+    
+    <select id="selectProcessRouteStandardTimeData" parameterType="String" resultType="com.alibaba.fastjson2.JSONObject">
+        select  hd.item_code,sum(standard_time) as standardTime,hd.org_code
+        from aps_standard_process_route_line as ln
+                 left join aps_standard_process_route_header as hd on ln.route_id=hd.route_id
+        where ln.del_flag='0' and hd.del_flag='0'
+        <if test="orgCode != null  and orgCode != ''">
+          and hd.org_code = #{orgCode}
+        </if>
+        group by hd.item_code,hd.org_code
     </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3