feat(wms): 添加退火性能查询中的双重库区筛选功能

- 在 WmsAnnealPerformanceBo 中新增 coilWarehouseId 字段用于钢卷本身库区筛选
- 更新数据库查询映射,支持出炉时逻辑库区和钢卷本身库区的分别筛选
- 修改服务实现逻辑,区分出炉时逻辑库区和钢卷本身库区的数据处理
- 优化查询条件判断,支持多种筛选条件组合的统计信息重新计算
This commit is contained in:
2026-07-10 15:39:55 +08:00
parent d0b3c7e766
commit 8ee5ab0a8d
3 changed files with 32 additions and 14 deletions

View File

@@ -20,12 +20,17 @@
<if test="enterCoilNo != null and enterCoilNo != ''">
AND mc.enter_coil_no LIKE CONCAT('%', #{enterCoilNo}, '%')
</if>
<!-- 当前钢卷号和逻辑库区id匹配 -->
<!-- 当前钢卷号匹配 -->
<if test="currentCoilNo != null and currentCoilNo != ''">
AND mc.current_coil_no LIKE CONCAT('%', #{currentCoilNo}, '%')
</if>
<!-- 出炉时的逻辑库区筛选wms_furnace_plan_coil.logic_warehouse_id -->
<if test="warehouseId != null">
AND mc.warehouse_id = #{warehouseId}
AND pc.logic_warehouse_id = #{warehouseId}
</if>
<!-- 钢卷本身的逻辑库区筛选wms_material_coil.warehouse_id -->
<if test="coilWarehouseId != null">
AND mc.warehouse_id = #{coilWarehouseId}
</if>
</where>
</sql>
@@ -49,7 +54,7 @@
p.end_time AS endTime
FROM wms_furnace_plan p
LEFT JOIN wms_furnace f ON f.furnace_id = p.target_furnace_id
<if test="enterCoilNo != null and enterCoilNo != '' or currentCoilNo != null and currentCoilNo != '' or warehouseId != null">
<if test="enterCoilNo != null and enterCoilNo != '' or currentCoilNo != null and currentCoilNo != '' or warehouseId != null or coilWarehouseId != null">
INNER JOIN wms_furnace_plan_coil pc ON pc.plan_id = p.plan_id AND pc.del_flag = 0
INNER JOIN wms_material_coil mc ON mc.coil_id = pc.coil_id AND mc.del_flag = 0
</if>