sqlsales=$"select sum(cost_first*bailun_sku_quantity_ordered) as cost_first from dc_base_oms_sku where create_time>='{start.ToString("yyyy-MM-dd HH:mm:ss")}' and create_time<'{end.ToString("yyyy-MM-dd HH:mm:ss")}' and bailun_order_status!='Canceled' and cost_first>0 and has_scalp=0 and has_delete=0 and has_innersale=0 and company_id=1";
sqlsales=$@"select sum(amount) amount from (
select sum(t1.quantity_shipped* t2.cost_first) amount from dc_base_oms_pick t1
join dc_base_oms_sku t2 on t1.bailun_order_id = t2.bailun_order_id and t1.bailun_sku = t2.bailun_sku and t2.has_delete = 0 and t2.has_scalp = 0 and t2.has_innersale = 0
where t1.shipping_time >= '{start.ToString("yyyy-MM-dd HH:mm:ss")}' and t1.shipping_time < '{end.ToString("yyyy-MM-dd HH:mm:ss")}' and t1.shipping_status = 'TotalShipping'
union all
select sum(cost_first) amount from dc_base_oms_order t1 where t1.company_id = 1 and t1.platform_type = 'FBA' and t1.bailun_order_status != 'Canceled' and t1.create_time >= '{start.ToString("yyyy-MM-dd HH:mm:ss")}' and t1.create_time < '{end.ToString("yyyy-MM-dd HH:mm:ss")}' and t1.has_scalp = 0 and t1.has_innersale = 0 and t1.bailun_interception_status in ('None', 'Failed')
sql=$@"select t1.material_code as bailun_sku,t1.warehouse_id as warehouse_code,t1.warehouse_name as warehouse_name,sum(t1.stock) as count,sum(t1.stock*t1.new_price) amount from dc_semi_stock_report t1
sql=$@"select t1.material_code as bailun_sku,t1.warehouse_id as warehouse_code,t1.warehouse_name as warehouse_name,sum(t1.stock) as count,sum(t1.stock*t1.new_price) amount from dc_semi_stock_report t1
where t1.stock_type=3 and t1.create_time>='{start.ToString("yyyy-MM-dd HH:mm:ss")}' and t1.create_time<'{end.ToString("yyyy-MM-dd HH:mm:ss")}' group by t1.material_code,t1.warehouse_id;";
where t1.is_zichang=0 and t1.stock_type=3 and t1.create_time>='{start.ToString("yyyy-MM-dd HH:mm:ss")}' and t1.create_time<'{end.ToString("yyyy-MM-dd HH:mm:ss")}' group by t1.material_code,t1.warehouse_id;";
sql=$@"select t1.material_code as bailun_sku,t1.warehouse_id as warehouse_code,t1.warehouse_name as warehouse_name,sum(t1.stock) as count,sum(t1.stock*t1.new_price) amount from dc_semi_stock_report t1
sql=$@"select t1.material_code as bailun_sku,t1.warehouse_id as warehouse_code,t1.warehouse_name as warehouse_name,sum(t1.stock) as count,sum(t1.stock*t1.new_price) amount from dc_semi_stock_report t1
where t1.stock_type=5 and t1.create_time>='{start.ToString("yyyy-MM-dd HH:mm:ss")}' and t1.create_time<'{end.ToString("yyyy-MM-dd HH:mm:ss")}' group by t1.material_code,t1.warehouse_id;";
where t1.is_zichang=0 and t1.stock_type=5 and t1.create_time>='{start.ToString("yyyy-MM-dd HH:mm:ss")}' and t1.create_time<'{end.ToString("yyyy-MM-dd HH:mm:ss")}' group by t1.material_code,t1.warehouse_id;";