aps-modules/aps-core/src/main/resources/mapper/core/ApsBomHeaderMapper.xml
@@ -103,16 +103,19 @@
        </foreach>
    </delete>
    <select id="selectBomRedisData" parameterType="String" resultType="com.alibaba.fastjson2.JSONObject">
        SELECT a.item_code as mainItemCode,f.num as mainStock,b.bom_line_id as bomLineId, b.item_code as itemCode,b.num ,c.num as subStock,d.self_made as selfMade
    <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_storage_management c on b.item_code=c.item_number
            LEFT JOIN aps_material_management d on b.item_code=d.item_number
            LEFT JOIN aps_material_storage_management as f on a.item_code=f.item_number
        <if test="orgCode != null and orgCode != ''">
            WHERE a.org_code=#{orgCode} and d.applicable_factories=#{orgCode} and c.applicable_factories=#{orgCode}
        </if>
        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>