sql=$@"select t1.material_code as bailun_sku,t1.warehouse_id as warehouse_code,t1.warehouse_name as warehouse_name,t1.stock as count,(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")}'";
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;";
sql=$@"select t1.material_code as bailun_sku,t1.warehouse_id as warehouse_code,t1.warehouse_name as warehouse_name,t1.stock as count,(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")}'";
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;";
sql=$@"select sum(quantity_purchase) as count,sum(quantity_purchase*unit_price) as amount,bailun_sku,warehouse_from_code as warehouse_code,warehouse_from_name as warehouse_name from dc_semi_purchase_info where create_time>='{start.ToString("yyyy-MM-dd HH:mm:ss")}' and create_time<'{end.ToString("yyyy-MM-dd HH:mm:ss")}' and `status`>-1
sql=$@"select sum(sku_quantity) as count,sum(sku_quantity*sku_unit_price) as amount,sku as bailun_sku,warehouse_id as warehouse_code,warehouse_name from dc_semi_order where state!=1 and create_date>='{start.ToString("yyyy-MM-dd HH:mm:ss")}' and create_date<'{end.ToString("yyyy-MM-dd HH:mm:ss")}' group by sku,warehouse_id";
sql=$@"select t1.sku_code as bailun_sku,t1.warehouse_id as warehouse_code,t1.warehouse_name as warehouse_name,t1.log_quantity as count,(t1.log_quantity*t2.price) amount from dc_semi_stock_log t1
left join (select t1.sku_code,t1.price from dc_semi_supplier_offer_log t1
inner join (select sku_code,max(update_time) update_time from dc_semi_supplier_offer_log where sku_code in (select sku_code from dc_semi_stock_log where update_time>='{start.ToString("yyyy-MM-dd HH:mm:ss")}' and update_time<'{end.ToString("yyyy-MM-dd HH:mm:ss")}' and log_type_id=2) group by sku_code,update_time) t2 on t1.sku_code=t2.sku_code and t1.update_time=t2.update_time) t2 on t1.sku_code=t2.sku_code
where t1.update_time>='{start.ToString("yyyy-MM-dd HH:mm:ss")}' and t1.update_time<'{end.ToString("yyyy-MM-dd HH:mm:ss")}' and log_type_id=2";
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;";
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;";
sql=$@"select t1.warehouse_id as warehouse_code,t1.warehouse_name as warehouse_name,t1.sku_code as bailun_sku,t1.final_stock as usable_stock,(t1.final_stock*t2.price) as stockAmount from dc_semi_stock_log t1 join dc_semi_supplier_offer_log t2 on t1.sku_code=t2.sku_code where t1.sku_code='{item.bailun_sku}' and t1.warehouse_id='{item.warehouse_code}' order by t2.update_time desc";
sql=$@"select t1.warehouse_id warehouse_code,t1.warehouse_name,t1.sku_code bailun_sku,t1.stock_quantity usable_stock,(t1.stock_quantity*t1.price) as stockAmount from dc_semi_daily_stock t1 where t1.day='{start.AddDays(-1).ToString("yyyy-MM-dd")}' and t1.sku_code='{item.bailun_sku}' and t1.warehouse_id='{item.warehouse_code}'";