清理备件导入+仓库数据-乌干达-7.3KM项目.txt 986 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # 注意乌干达111项目有两个仓库600ed97e159c0d0e23ad26bc和600ed9ae159c0d0e23ad26c1,
  2. # 注意:有两个仓库都要删除的,备件信息删除语句只能在最后一个仓库里面执行
  3. set @remark = 'MASAKA项目仓库';
  4. set @storeId = '6019187a159c0d3b57647fdd';
  5. #清除bom数据
  6. DELETE
  7. FROM
  8. t_sb_model_spare_bom
  9. WHERE
  10. spare_id IN ( SELECT id FROM t_spare_part_info WHERE remark = @remark );
  11. #清楚出入库和领用数据
  12. DELETE
  13. FROM
  14. t_out_store_form
  15. WHERE
  16. store_id in( @storeId);
  17. DELETE
  18. FROM
  19. t_out_store_detail
  20. WHERE
  21. store_id in( @storeId);
  22. DELETE
  23. FROM
  24. t_in_store_form
  25. WHERE
  26. store_id in( @storeId);
  27. DELETE
  28. FROM
  29. t_in_store_detail
  30. WHERE
  31. store_id in( @storeId);
  32. DELETE
  33. FROM
  34. t_spare_pick_form
  35. WHERE
  36. store_id in( @storeId);
  37. DELETE
  38. FROM
  39. t_spare_pick_form
  40. WHERE
  41. store_id in( @storeId);
  42. # 清除仓库库存数据
  43. DELETE
  44. FROM
  45. t_spare_store
  46. WHERE
  47. store_id in( @storeId);
  48. # 清除备件数据
  49. DELETE
  50. FROM
  51. t_spare_part_info
  52. WHERE
  53. remark = @remark