From d337c8e2e21df8ff7d2ecae493fa7a65627fedea Mon Sep 17 00:00:00 2001
From: Zhu Zhonghua <zhonghua@qq.com>
Date: 星期四, 22 五月 2025 14:52:48 +0800
Subject: [PATCH] 处理焊缝大数据插入异常问题

---
 aps-modules/aps-core/src/main/resources/mapper/core/ApsBomHeaderMapper.xml |   26 +++++++++++++++++++++-----
 1 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/aps-modules/aps-core/src/main/resources/mapper/core/ApsBomHeaderMapper.xml b/aps-modules/aps-core/src/main/resources/mapper/core/ApsBomHeaderMapper.xml
index cc473bc..aaa2a8e 100644
--- a/aps-modules/aps-core/src/main/resources/mapper/core/ApsBomHeaderMapper.xml
+++ b/aps-modules/aps-core/src/main/resources/mapper/core/ApsBomHeaderMapper.xml
@@ -4,7 +4,7 @@
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.aps.core.mapper.ApsBomHeaderMapper">
     
-    <resultMap type="ApsBomHeader" id="ApsBomHeaderResult">
+    <resultMap type="com.aps.core.domain.ApsBomHeader" id="ApsBomHeaderResult">
         <result property="id"    column="id"    />
         <result property="bomHeaderId"    column="bom_header_id"    />
         <result property="itemCode"    column="item_code"    />
@@ -25,11 +25,11 @@
         from aps_bom_header
     </sql>
 
-    <select id="selectApsBomHeaderList" parameterType="ApsBomHeader" resultMap="ApsBomHeaderResult">
+    <select id="selectApsBomHeaderList" parameterType="com.aps.core.domain.ApsBomHeader" resultMap="ApsBomHeaderResult">
         <include refid="selectApsBomHeaderVo"/>
         <where>  
             <if test="bomHeaderId != null  and bomHeaderId != ''"> and bom_header_id = #{bomHeaderId}</if>
-            <if test="itemCode != null  and itemCode != ''"> and item_code = #{itemCode}</if>
+            <if test="itemCode != null  and itemCode != ''"> and item_code like '%' || #{itemCode} || '%'</if>
             <if test="itemName != null  and itemName != ''"> and item_name = #{itemName}</if>
             <if test="startDate != null "> and start_date = #{startDate}</if>
             <if test="endDate != null "> and end_date = #{endDate}</if>
@@ -42,7 +42,7 @@
         where id = #{id}
     </select>
 
-    <insert id="insertApsBomHeader" parameterType="ApsBomHeader">
+    <insert id="insertApsBomHeader" parameterType="com.aps.core.domain.ApsBomHeader">
         insert into aps_bom_header
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="id != null">id,</if>
@@ -74,7 +74,7 @@
          </trim>
     </insert>
 
-    <update id="updateApsBomHeader" parameterType="ApsBomHeader">
+    <update id="updateApsBomHeader" parameterType="com.aps.core.domain.ApsBomHeader">
         update aps_bom_header
         <trim prefix="SET" suffixOverrides=",">
             <if test="bomHeaderId != null">bom_header_id = #{bomHeaderId},</if>
@@ -102,4 +102,20 @@
             #{id}
         </foreach>
     </delete>
+
+    <select id="selectBomRedisData" parameterType="String" resultType="com.aps.core.domain.ApsBom">
+        SELECT a.item_code as mainItemCode,b.bom_line_id as bomLineId, b.item_code as itemCode,b.num
+        FROM aps_bom_header a
+        LEFT JOIN aps_bom_line b on a.bom_header_id=b.bom_header_id
+        LEFT JOIN aps_material_management d on b.item_code=d.item_number
+        LEFT JOIN aps_material_management c on a.item_code=c.item_number
+        <where>
+            <if test="orgCode != null and orgCode != ''">
+                and a.org_code=#{orgCode} and d.applicable_factories=#{orgCode}
+            </if>
+            and d.material_type='鍒堕�犱欢'
+            and c.material_type='鍒堕�犱欢'
+        </where>
+        ORDER BY mainItemCode
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3