|
@@ -18,7 +18,8 @@
|
|
|
swd.update_time,
|
|
|
swd.victoriatourist_json,
|
|
|
swd.purchase_detail_id,
|
|
|
- if(sw.business_type =2,(SELECT ptd.product_sn from bytesailing_mes.production_task_detail ptd where ptd.id=sw.business_id),'') as productSn,
|
|
|
+ if(sw.business_type =2,(SELECT ptd.product_sn from bytesailing_mes.production_task_detail ptd where ptd.id=sw.business_id),
|
|
|
+ (SELECT ptd.product_sn from bytesailing_mes.production_task_detail ptd where ptd.id=swd.production_task_detail_id)) as productSn,
|
|
|
IF( sw.business_type = 2,( SELECT sc.customer_id FROM bytesailing_jxst.sales_contract sc
|
|
|
LEFT JOIN bytesailing_mes.work_order wo ON wo.source_id = sc.id AND wo.del_flag = 0
|
|
|
LEFT JOIN bytesailing_mes.production_plan pp ON pp.work_order_id = wo.id AND pp.del_flag = 0
|