varsql=$@"select t1.seller_account,t1.origin_order_id,t1.logistics_warehouse_code,t1.logistics_method_code from dc_base_oms_order t1
join dc_ebay_report_uk_config t2 on t2.type>1 and t1.logistics_method_code=t2.config_value
//var sql = $@"select t1.seller_account,t1.origin_order_id,t1.logistics_warehouse_code,t1.logistics_method_code from dc_base_oms_order t1
// join dc_ebay_report_uk_config t2 on t2.type>1 and t1.logistics_method_code=t2.config_value
// join dc_ebay_report_uk_config t3 on t3.type=1 and t1.seller_account=t3.config_value
// where t1.platform_type='Ebay' and t1.website='uk' and t1.bailun_payment_status!='Canceled'
// and t1.paid_time>='{start.ToString("yyyy-MM-dd")}' and t1.paid_time<'{end.AddDays(1).ToString("yyyy-MM-dd")}'";
varsql=$@"select * from (select distinct t1.seller_account,t1.origin_order_id,t1.logistics_warehouse_code,t1.logistics_method_code,t2.logistics_order_id from dc_base_oms_order t1
join dc_base_oms_pick t2 on t1.bailun_order_id=t2.bailun_order_id and t2.logistics_order_id is not null
join dc_ebay_report_uk_config t3 on t3.type=1 and t1.seller_account=t3.config_value
join dc_ebay_report_uk_config t4 on t2.logistics_order_id = t4.config_value
where t1.platform_type='Ebay' and t1.website='uk' and t1.bailun_payment_status!='Canceled'
and t1.paid_time>='{start.ToString("yyyy-MM-dd")}' and t1.paid_time<'{end.AddDays(1).ToString("yyyy-MM-dd")}'";
and t1.paid_time>='{start.ToString("yyyy-MM-dd")}' and t1.paid_time<'{end.AddDays(1).ToString("yyyy-MM-dd")}' ) t1";