12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- # 注意乌干达111项目有两个仓库600ed97e159c0d0e23ad26bc和600ed9ae159c0d0e23ad26c1,
- # 注意:有两个仓库都要删除的,备件信息删除语句只能在最后一个仓库里面执行
- set @remark = 'MASAKA项目仓库';
- set @storeId = '6019187a159c0d3b57647fdd';
- #清除bom数据
- DELETE
- FROM
- t_sb_model_spare_bom
- WHERE
- spare_id IN ( SELECT id FROM t_spare_part_info WHERE remark = @remark );
- #清楚出入库和领用数据
- DELETE
- FROM
- t_out_store_form
- WHERE
- store_id in( @storeId);
- DELETE
- FROM
- t_out_store_detail
- WHERE
- store_id in( @storeId);
- DELETE
- FROM
- t_in_store_form
- WHERE
- store_id in( @storeId);
- DELETE
- FROM
- t_in_store_detail
- WHERE
- store_id in( @storeId);
- DELETE
- FROM
- t_spare_pick_form
- WHERE
- store_id in( @storeId);
- DELETE
- FROM
- t_spare_pick_form
- WHERE
- store_id in( @storeId);
- # 清除仓库库存数据
- DELETE
- FROM
- t_spare_store
- WHERE
- store_id in( @storeId);
- # 清除备件数据
- DELETE
- FROM
- t_spare_part_info
- WHERE
- remark = @remark
|