發(fā)料單刪除校驗接口
<!-- 查看當前發(fā)料單是否已被盤點消耗引用-->
<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表中一定會有某條發(fā)料單丛版,但wz_inventory_consumption?不一定有盤點消耗單巩掺,這樣就是查出來wic.*為空,但wi.*不是空页畦。
另外一個辦法就是胖替,不做如上修改,在SQL的WHERE中加上 wic.id is not null,把空數(shù)據(jù)去掉