p.delivery_time,p.eceipt_status,p.payment_status,p.tax_rate,p.create_by,p.create_time,p.update_by,p.update_time,p.del_flag,w.has_storage_num,sum(w.notify_arrive_num) as notify_has_arrived_num
from purchase_order_child as p left join warehouse_storage_order_detail as w on p.purchase_order_code = w.related_order_code and p.material_code = w.material_no
w.has_storage_num,sum(w.notify_arrive_num) as notify_has_arrived_num
from purchase_order_child as p left join warehouse_storage_order_detail as w
on p.purchase_order_code = w.related_order_code
and p.material_code = w.material_no and p.supplier_code = w.supplier_code
where p.purchase_order_code = #{purchaseOrderCode} GROUP BY supplier_code,material_code
where p.purchase_order_code = #{purchaseOrderCode} GROUP BY supplier_code,material_code