feat(wms): 新增材质异常钢卷查询功能
- 在IWmsMaterialCoilService中添加queryMaterialMismatchCoils方法定义 - 在WmsMaterialCoilController中新增查询材质异常钢卷的API接口 - 在WmsMaterialCoilMapper中添加selectMaterialMismatchCoilsPage分页查询方法 - 在WmsMaterialCoilMapper.xml中实现材质异常钢卷的SQL查询逻辑 - 在WmsMaterialCoilServiceImpl中实现材质异常钢卷查询的具体业务逻辑 - 通过关联查询优化性能,避免N+1问题并支持分页返回结果
This commit is contained in:
@@ -936,5 +936,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
GROUP BY warehouse_id
|
||||
</select>
|
||||
|
||||
<!-- 分页查询材质异常的钢卷 -->
|
||||
<select id="selectMaterialMismatchCoilsPage" resultMap="WmsMaterialCoilResult">
|
||||
SELECT mc.*
|
||||
FROM wms_material_coil mc
|
||||
LEFT JOIN wms_raw_material rm ON mc.item_type = 'raw_material' AND mc.item_id = rm.raw_material_id AND rm.del_flag = 0
|
||||
LEFT JOIN wms_product wp ON mc.item_type = 'product' AND mc.item_id = wp.product_id AND wp.del_flag = 0
|
||||
WHERE mc.del_flag = 0
|
||||
AND mc.item_id IS NOT NULL
|
||||
AND mc.item_type IS NOT NULL
|
||||
AND mc.packing_status IS NOT NULL
|
||||
AND (
|
||||
(mc.item_type = 'raw_material' AND rm.material IS NOT NULL AND mc.packing_status != rm.material)
|
||||
OR
|
||||
(mc.item_type = 'product' AND wp.material IS NOT NULL AND mc.packing_status != wp.material)
|
||||
)
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user