fix(query): 修复查询时未考虑 del_flag 导致返回已删除数据问题

- 在多个 Mapper 文件中,为 LEFT JOIN 的条件添加 del_flag = 0 判断
- 确保查询结果中不包含已删除的数据
This commit is contained in:
2025-08-26 16:42:29 +08:00
parent 045096b579
commit 666c42a128
15 changed files with 29 additions and 29 deletions

View File

@@ -23,14 +23,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- 分页联查产品和原材料名称编码支持Wrapper动态条件返回Page<WmsProductBomVo> -->
<select id="selectVoPagePlus" resultType="com.klp.domain.vo.WmsProductBomVo">
SELECT
b.*,
b.*,
p.product_name AS productName,
p.product_code AS productCode,
r.raw_material_name AS rawMaterialName,
r.raw_material_code AS rawMaterialCode
FROM wms_product_bom b
LEFT JOIN wms_product p ON b.product_id = p.product_id
LEFT JOIN wms_raw_material r ON b.raw_material_id = r.raw_material_id
LEFT JOIN wms_product p ON b.product_id = p.product_id AND p.del_flag = 0
LEFT JOIN wms_raw_material r ON b.raw_material_id = r.raw_material_id AND r.del_flag = 0
${ew.customSqlSegment}
</select>