varsql=$@"select t1.warehouse_code,t2.warehouse_name,t1.bailun_sku,t1.usable_stock,(t1.usable_stock*t3.unit_price) as stockAmount from dc_base_stock t1 left join dc_base_warehouse t2 on t1.warehouse_code=t2.warehouse_code left join dc_base_sku t3 on t1.bailun_sku=t3.bailun_sku ";
sql=$@"select warehouse_code,bailun_sku,usable_stock,(usable_stock*unit_price) as stockAmount from dc_daily_stock where record_time='{start.AddDays(-1).ToString("yyyy-MM-dd")}'";
sql=$@"select t1.warehouse_code,t1.warehouse_name,t1.bailun_sku,sum(t1.count) count,sum(t1.count*t2.unit_price) amount from dc_base_purchase t1
varsql=$@"select t1.warehouse_code,t3.warehouse_name,t1.bailun_sku,sum(t1.count) count,sum(t1.count*t2.unit_price) amount from dc_base_purchase t1
left join dc_base_sku t2 on t1.bailun_sku=t2.bailun_sku
left join dc_base_warehouse t3 on t1.warehouse_code = t3.warehouse_code
where t1.has_delete=0 and t1.status!=-1 and t1.create_time>='{start.ToString("yyyy-MM-dd HH:mm:ss")}' and t1.create_time<'{end.ToString("yyyy-MM-dd HH:mm:ss")}'
sql=$@"select t1.warehouse_code,t1.warehouse_name,t1.bailun_sku,sum(t1.bailun_sku_quantity_ordered) count,sum(t1.bailun_sku_quantity_ordered*t2.unit_price) amount from dc_base_oms_sku t1
sql=$@"select t1.warehouse_code,t3.warehouse_name,t1.bailun_sku,sum(t1.bailun_sku_quantity_ordered) count,sum(t1.bailun_sku_quantity_ordered*t2.unit_price) amount from dc_base_oms_sku t1
left join dc_base_sku t2 on t1.bailun_sku=t2.bailun_sku
left join dc_base_warehouse t3 on t1.warehouse_code = t3.warehouse_code
where t1.has_delete=0 and t1.has_scalp=0 and t1.bailun_payment_status!='Canceled' and t1.paid_time>='{start.ToString("yyyy-MM-dd HH:mm:ss")}' and t1.paid_time<'{end.ToString("yyyy-MM-dd HH:mm:ss")}' and t1.bailun_order_status!='Canceled' and t1.warehouse_code!=''
select warehouse_code,warehouse_name,bailun_sku,count from dc_base_transfer_inbound t1 where t1.deleted=0 and t1.count>0 and t1.create_time>='{start.ToString("yyyy-MM-dd HH:mm:ss")}' and t1.create_time<'{end.ToString("yyyy-MM-dd HH:mm:ss")}'
) tb
left join dc_base_sku t4 on tb.bailun_sku=t4.bailun_sku
group by tb.warehouse_code,tb.bailun_sku";
group by tb.warehouse_code,tb.bailun_sku) t1
left join dc_base_warehouse t2 on t1.warehouse_code=t2.warehouse_code";
sql=$@"select t1.warehouse_code,t1.warehouse_name,t1.bailun_sku,sum(t1.quantity_shipped) count,sum(t1.quantity_shipped*t2.unit_price) amount from dc_base_oms_pick t1
sql=$@"select t1.warehouse_code,t3.warehouse_name,t1.bailun_sku,sum(t1.quantity_shipped) count,sum(t1.quantity_shipped*t2.unit_price) amount from dc_base_oms_pick t1
left join dc_base_sku t2 on t1.bailun_sku=t2.bailun_sku
left join dc_base_warehouse t3 on t1.warehouse_code=t3.warehouse_code
where t1.has_delete=0 and t1.shipping_status='TotalShipping' and t1.shipping_time>='{start.ToString("yyyy-MM-dd HH:mm:ss")}' and t1.shipping_time<'{end.ToString("yyyy-MM-dd HH:mm:ss")}'
sql=$@"select t1.warehouse_code,t2.warehouse_name,t1.bailun_sku,t1.usable_stock,(t1.usable_stock*t3.unit_price) as stockAmount from dc_base_stock t1 left join dc_base_warehouse t2 on t1.warehouse_code=t2.warehouse_code left join dc_base_sku t3 on t1.bailun_sku=t3.bailun_sku where t1.bailun_sku='{item.bailun_sku}' and t1.warehouse_code='{item.warehouse_code}'";
sql=$@"select t1.warehouse_code,t1.bailun_sku,t1.usable_stock,(t1.usable_stock*t1.unit_price) as stockAmount from dc_daily_stock t1 where t1.record_time='{start.AddDays(-1).ToString("yyyy-MM-dd")}' and t1.bailun_sku='{item.bailun_sku}' and t1.warehouse_code='{item.warehouse_code}'";