Commit cb576c4d by 泽锋 李

优化查询

parent d4800ed2
...@@ -570,7 +570,7 @@ ifnull(t2.purchasecode,'') as 'purchase_id', ...@@ -570,7 +570,7 @@ ifnull(t2.purchasecode,'') as 'purchase_id',
from dc_base_transfer_info_skus as t1 from dc_base_transfer_info_skus as t1
left join dc_base_transfer_info as t2 on t1.dataid =t2.dataid left join dc_base_transfer_info as t2 on t1.dataid =t2.dataid
left join dc_base_warehouse as t3 on t2.targetwareno = t3.warehouse_code left join dc_base_warehouse as t3 on t2.targetwareno = t3.warehouse_code
left join ( select * from dc_lms_order_transfer_current_node GROUP BY data_id,sku ) as t8 on t2.dataid = t8.data_id and t1.sku = t8.sku left join ( select data_id,sku,expectarrivaltime from dc_lms_order_transfer_current_node GROUP BY data_id,sku ) as t8 on t2.dataid = t8.data_id and t1.sku = t8.sku
left join dc_base_lms_channel as t9 on t2.channelname = t9.`name` left join dc_base_lms_channel as t9 on t2.channelname = t9.`name`
where t2.isdeleted=0 and t2.stateid not in (5,11,12) where t2.isdeleted=0 and t2.stateid not in (5,11,12)
and t1.deliverycount > t1.storagecount and t1.deliverycount > t1.storagecount
......
...@@ -4234,7 +4234,7 @@ ifnull(t2.purchasecode,'') as 'purchase_id' ...@@ -4234,7 +4234,7 @@ ifnull(t2.purchasecode,'') as 'purchase_id'
from dc_base_transfer_info_skus as t1 from dc_base_transfer_info_skus as t1
left join dc_base_transfer_info as t2 on t1.dataid =t2.dataid left join dc_base_transfer_info as t2 on t1.dataid =t2.dataid
left join dc_base_warehouse as t3 on t2.targetwareno = t3.warehouse_code left join dc_base_warehouse as t3 on t2.targetwareno = t3.warehouse_code
left join ( select * from dc_lms_order_transfer_current_node GROUP BY data_id,sku ) as t8 on t2.dataid = t8.data_id and t1.sku = t8.sku left join ( select data_id,sku,expectarrivaltime from dc_lms_order_transfer_current_node GROUP BY data_id,sku ) as t8 on t2.dataid = t8.data_id and t1.sku = t8.sku
where t2.isdeleted=0 and t2.stateid not in (5,11,12) where t2.isdeleted=0 and t2.stateid not in (5,11,12)
and t1.deliverycount > t1.storagecount and t1.deliverycount > t1.storagecount
and t2.isexception = 0 and t2.isexception = 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment