varsql=$@"select t1.origin_order_id,t1.bailun_order_id,t1.website,t1.platform_type,t1.seller_name,t1.bailun_account_id,t1.platform_sku_quantity_ordered,t1.platform_sku_unit_price,t1.platform_sku,t1.order_currency,t1.item_id,seller_order_exchange_rate from dc_base_oms_platform_sku t1 where t1.bailun_order_status != 'Canceled' and t1.has_delete = 0 and t1.has_cancle = 0 and t1.create_time_site >= '{start.ToString("yyyy-MM-dd")}' and t1.create_time_site < '{end.AddDays(1).ToString("yyyy-MM-dd")}'";
varsql=$@"select t1.origin_order_id,t1.bailun_order_id,t1.website,t1.platform_type,t1.seller_name,t1.bailun_account_id,t1.platform_sku_quantity_ordered,t1.platform_sku_unit_price,t1.platform_sku,t1.order_currency,t1.item_id,seller_order_exchange_rate from dc_base_oms_platform_sku t1 where t1.bailun_order_status != 'Canceled' and t1.has_delete = 0 and t1.has_cancle = 0 ";
if(!string.IsNullOrEmpty(platform))
if(!string.IsNullOrEmpty(platform))
{
{
sql+=" and t1.platform_type='"+platform+"'";
sql+=" and t1.platform_type='"+platform+"'";
}
}
if(orderIds!=null&&orderIds.Count>0)
{
sql+=" and t1.origin_order_id in ('"+string.Join("','",orderIds)+"')";
}
if(start.HasValue)
{
sql+=$" and t1.create_time_site >= '{start.Value.ToString("yyyy-MM-dd")}'";
}
if(end.HasValue)
{
sql+=$" and t1.create_time_site < '{end.Value.AddDays(1).ToString("yyyy-MM-dd")}'";