发料单删除校验接口
<!-- 查看当前发料单是否已被盘点消耗引用-->
<select id="quotaCheck" resultType="InventoryConsumption">
SELECT DISTINCT
wic.*
FROM
wz_issue wi
LEFT JOIN wz_inventory_consumption wic ON wi.issue_date<= wic.inventory_date
AND wi.receive_warehouse_id = wic.inventory_warehouse_id
AND wi.receive_construction_team_id = wic.construction_team_id
AND wic.del_flag = 0
WHERE
wi.id in (${ids})
</select>
这里应该把wz_inventory_consumption 作为主表,左连接wz_issue表,因为wz_issue表中一定会有某条发料单,但wz_inventory_consumption 不一定有盘点消耗单,这样就是查出来wic.*为空,但wi.*不是空。
另外一个办法就是,不做如上修改,在SQL的WHERE中加上 wic.id is not null,把空数据去掉