_connection.Execute(" delete from sales_day_config where bailun_sku=@bailun_sku and warehouse_code=@warehouse_code ",new{bailun_sku=bailun_sku,warehouse_code=warehouse_code});
vardefault_head_transport_config=_connection.QueryFirstOrDefault<dc_base_head_transport_config>(" select * from dc_base_head_transport_config where bailun_sku=@bailun_sku and warehouse_code=@warehouse_code ",new
varbase_datas=_connection.Query<dc_report_sales_trend_year>(" select * from dc_report_sales_trend_year where product_type=@product_type and `date`>=@btime and `date`<=@etime ",new{
product_type=product_type,
varbase_datas=_connection.Query<dc_report_sales_trend_year>(" select * from dc_report_sales_trend_year where `date`>=@btime and `date`<=@etime and warehouse_type!='耗材仓' ",new{
ifnull(t2.product_type_desc,'未知') as 'product_type_desc',
sum(t1.bailun_sku_quantity_ordered) as 'sales',
t1.receipt_country as 'country_code',
t2.area_name as 'country_code',
t2.hq_type as 'warehouse_type',
date_format(paid_time, '%Y-%m') as 'date_str',
paid_time as 'date',
1 as 'year_growth_rate',
now() as 'create_date',
now() as 'update_date'
from dc_base_oms_sku as t1
left join dc_base_sku as t2 on t1.bailun_sku =t2.bailun_sku
left join dc_base_warehouse as t2 on t1.warehouse_code =t2.warehouse_code
where t1.bailun_order_status != 'Canceled'
and t1.has_delete = 0
and t1.has_scalp = 0
and t1.has_buyer_remark = 0
and t1.has_platsku_remark = 0
and t1.paid_time>='2019-01-01' and t1.paid_time<'2020-01-01'
GROUP BY t2.product_type,t2.product_type_desc,t1.receipt_country,date_format(paid_time, '%Y-%m')
and t1.paid_time>=@btime -- and t1.paid_time<'2020-01-10'
GROUP BY t2.hq_type,t2.area_name,date_format(paid_time, '%Y-%m')
",new{btime},commandTimeout:0).ToList();
foreach(varitemindatas)
{
varoldData=_connection.QuerySingleOrDefault<dc_report_sales_trend_year>(" select * from dc_report_sales_trend_year where date_str=@date_str and product_type_desc=@product_type_desc and country_code=@country_code ",new{
varoldData=_connection.QuerySingleOrDefault<dc_report_sales_trend_year>(" select * from dc_report_sales_trend_year where date_str=@date_str and warehouse_type=@warehouse_type and country_code=@country_code ",new
{
country_code=item.country_code,
product_type_desc=item.product_type_desc,
warehouse_type=item.warehouse_type,
date_str=item.date_str
});
...
...
@@ -3863,7 +3864,7 @@ where t1.bailun_order_status != 'Canceled'
varturnover_date=MyMySqlConnection._connection_read_only.QueryFirstOrDefault<DateTime>(" select gmt_modified from dc_auto_turnover where bailun_sku=@bailun_sku and warehouse_code=@warehouse_code ",new