fix(query): 修复查询时未考虑 del_flag 导致返回已删除数据问题
- 在多个 Mapper 文件中,为 LEFT JOIN 的条件添加 del_flag = 0 判断 - 确保查询结果中不包含已删除的数据
This commit is contained in:
@@ -42,8 +42,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
wpt.plan_name AS planName,
|
||||
wpt.plan_code AS planCode
|
||||
FROM wms_schedule_plan_detail wspd
|
||||
left join wms_production_line wpl on wspd.line_id = wpl.line_id
|
||||
left join wms_production_task wpt on wspd.task_id = wpt.task_id
|
||||
left join wms_production_line wpl on wspd.line_id = wpl.line_id and wpl.del_flag = 0
|
||||
left join wms_production_task wpt on wspd.task_id = wpt.task_id and wpt.del_flag = 0
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
@@ -53,8 +53,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
wpt.plan_name AS planName,
|
||||
wpt.plan_code AS planCode
|
||||
FROM wms_schedule_plan_detail wspd
|
||||
left join wms_production_line wpl on wspd.line_id = wpl.line_id
|
||||
left join wms_production_task wpt on wspd.task_id = wpt.task_id
|
||||
left join wms_production_line wpl on wspd.line_id = wpl.line_id and wpl.del_flag = 0
|
||||
left join wms_production_task wpt on wspd.task_id = wpt.task_id and wpt.del_flag = 0
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user