Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --
- -- SET po_id = tmp.po_id,
- -- u8_ind_po_id = tmp.u8_ind_po_id,
- -- due_date = tmp.due_date
- SELECT
- sync_prj.id,
- sync_prj.po_id,
- sync_prj.u8_ind_po_id,
- case sync_prj.synthetic_status
- when 1 then '未开始'
- when 2 then '在研'
- when 3 then '入库'
- when 4 then '失败'
- when 5 then '取消'
- end `synthetic_status`,
- sync_prj.status,
- FROM_UNIXTIME(sync_prj.due_date) due_date,
- FROM_UNIXTIME(sync_prj.start_time) start_time,
- FROM_UNIXTIME(sync_prj.end_time) end_time,
- prd.material_article_no,
- -- sync_prj.chemical_name,
- sync_prj.product_id,
- manual_prj.id manual_prj_id,
- case manual_prj.synthetic_status
- when 1 then '未开始'
- when 2 then '在研'
- when 3 then '入库'
- when 4 then '失败'
- when 5 then '取消'
- end `manual_prj_synthetic_status`,
- manual_prj.status manual_prj_status,
- FROM_UNIXTIME(manual_prj.due_date) manual_prj_due_date,
- FROM_UNIXTIME(manual_prj.start_time) manual_prj_start_time,
- FROM_UNIXTIME(manual_prj.end_time) manual_prj_end_time
- FROM `bv_po_synthetic` sync_prj
- LEFT JOIN bv_product prd
- ON sync_prj.product_id = prd.id
- LEFT JOIN bv_po_synthetic manual_prj
- ON manual_prj.u8_ind_po_id = 0
- and manual_prj.product_id = sync_prj.product_id
- where sync_prj.u8_ind_po_id != 0
- and sync_prj.synthetic_status = 1
- and sync_prj.purchase_purpose = 7
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement