sql=$"select sum(amount_sales*seller_order_exchange_rate) amount from dc_base_oms_order where platform_type='Ebay' and paid_time>='{day.ToString("yyyy-MM-dd")}' and paid_time<'{day.AddDays(1).ToString("yyyy-MM-dd")}' and company_id=1 and bailun_order_status!='Canceled' and has_scalp=0 and has_innersale=0";
sql=$"select sum(amount_sales*seller_order_exchange_rate) amount from dc_base_oms_order where platform_type='Ebay' and paid_time>='{day.ToString("yyyy-MM-dd")}' and paid_time<'{day.AddDays(1).ToString("yyyy-MM-dd")}' and company_id=1 and bailun_order_status!='Canceled' and has_scalp=0 and has_innersale=0 and bailun_interception_status in ('None','Failed')";
select t1.platform_type,sum(t1.cost_platform_fee*t1.seller_order_exchange_rate*t1.bailun_sku_quantity_ordered) cost_platform_fee,0 as cost_fba_fee
select t1.platform_type,sum(t1.cost_platform_fee*t1.seller_order_exchange_rate*t1.bailun_sku_quantity_ordered) cost_platform_fee,0 as cost_fba_fee
from dc_base_oms_sku t1 where t1.has_scalp=0 and t1.has_delete=0 and t1.has_innersale=0 and t1.bailun_order_status!='Canceled' and t1.has_innersale=0 and t1.company_id=1 and t1.platform_type!='Ebay' and t1.platform_type!='FBA' and t1.paid_time>='{day.ToString("yyyy-MM-dd")}' and t1.paid_time<'{day.AddDays(1).ToString("yyyy-MM-dd")}'
from dc_base_oms_sku t1 where t1.has_scalp=0 and t1.has_delete=0 and t1.has_innersale=0 and t1.bailun_order_status!='Canceled' and t1.has_innersale=0 and t1.company_id=1 and t1.platform_type!='Ebay' and t1.platform_type!='FBA' and t1.paid_time>='{day.ToString("yyyy-MM-dd")}' and t1.paid_time<'{day.AddDays(1).ToString("yyyy-MM-dd")}' and t1.bailun_interception_status in ('None','Failed') and (t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle')
group by platform_type
group by platform_type
union all
union all
select platform_type,sum((cost_platform_fee+cost_fba_fee)*seller_order_exchange_rate) cost_platform_fee,sum(cost_fba_fee*seller_order_exchange_rate) cost_fba_fee from dc_base_oms_order where platform_type='FBA' and create_time>='{day.ToString("yyyy-MM-dd")}' and create_time<'{day.AddDays(1).ToString("yyyy-MM-dd")}' and company_id=1 and bailun_order_status!='Canceled' and has_scalp=0 and has_innersale=0
select platform_type,sum((cost_platform_fee+cost_fba_fee)*seller_order_exchange_rate) cost_platform_fee,sum(cost_fba_fee*seller_order_exchange_rate) cost_fba_fee from dc_base_oms_order where platform_type='FBA' and create_time>='{day.ToString("yyyy-MM-dd")}' and create_time<'{day.AddDays(1).ToString("yyyy-MM-dd")}' and company_id=1 and bailun_order_status!='Canceled' and has_scalp=0 and has_innersale=0 and bailun_interception_status in ('None','Failed')