Advertisement
Pandaaaa906

Untitled

Jan 6th, 2023
1,333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 1.28 KB | None | 0 0
  1. --
  2. -- SET po_id = tmp.po_id,
  3. -- u8_ind_po_id = tmp.u8_ind_po_id,
  4. -- due_date = tmp.due_date
  5.  
  6.  
  7. SELECT
  8.  
  9. sync_prj.id,
  10. sync_prj.po_id,
  11. sync_prj.u8_ind_po_id,
  12. case sync_prj.synthetic_status
  13. when 1 then '未开始'
  14. when 2 then '在研'
  15. when 3 then '入库'
  16. when 4 then '失败'
  17. when 5 then '取消'
  18. end `synthetic_status`,
  19. sync_prj.status,
  20. FROM_UNIXTIME(sync_prj.due_date) due_date,
  21. FROM_UNIXTIME(sync_prj.start_time) start_time,
  22. FROM_UNIXTIME(sync_prj.end_time) end_time,
  23. prd.material_article_no,
  24. -- sync_prj.chemical_name,
  25. sync_prj.product_id,
  26. manual_prj.id manual_prj_id,
  27. case manual_prj.synthetic_status
  28. when 1 then '未开始'
  29. when 2 then '在研'
  30. when 3 then '入库'
  31. when 4 then '失败'
  32. when 5 then '取消'
  33. end `manual_prj_synthetic_status`,
  34. manual_prj.status manual_prj_status,
  35. FROM_UNIXTIME(manual_prj.due_date) manual_prj_due_date,
  36. FROM_UNIXTIME(manual_prj.start_time) manual_prj_start_time,
  37. FROM_UNIXTIME(manual_prj.end_time) manual_prj_end_time
  38.  
  39. FROM `bv_po_synthetic` sync_prj
  40.  
  41. LEFT JOIN bv_product prd
  42. ON sync_prj.product_id = prd.id
  43.  
  44. LEFT JOIN bv_po_synthetic manual_prj
  45. ON manual_prj.u8_ind_po_id = 0
  46. and manual_prj.product_id = sync_prj.product_id
  47.  
  48. where sync_prj.u8_ind_po_id != 0
  49. and sync_prj.synthetic_status = 1
  50. and sync_prj.purchase_purpose = 7
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement