Commit c6986294 by 泽锋 李

dc_base_oms_sku 切换为 dc_base_oms_sku_30

parent 86b2819c
...@@ -140,7 +140,7 @@ sum(t1.cost_product * t1.bailun_sku_quantity_ordered) as 'cost_product', ...@@ -140,7 +140,7 @@ sum(t1.cost_product * t1.bailun_sku_quantity_ordered) as 'cost_product',
sum(t1.cost_first * t1.bailun_sku_quantity_ordered) as 'cost_first', sum(t1.cost_first * t1.bailun_sku_quantity_ordered) as 'cost_first',
sum(t1.profit_total * t1.bailun_sku_quantity_ordered) as 'profit_total' sum(t1.profit_total * t1.bailun_sku_quantity_ordered) as 'profit_total'
from dc_base_oms_sku as t1 from dc_base_oms_sku_30 as t1
left join dc_base_sku as t2 on t1.bailun_sku = t2.bailun_sku left join dc_base_sku as t2 on t1.bailun_sku = t2.bailun_sku
where t1.paid_time>=@b_this_time and t1.paid_time<=@e_this_time where t1.paid_time>=@b_this_time and t1.paid_time<=@e_this_time
and t1.bailun_order_status != 'Canceled' and t1.bailun_order_status != 'Canceled'
...@@ -253,7 +253,7 @@ GROUP BY t2.product_type,t2.product_type_desc", new ...@@ -253,7 +253,7 @@ GROUP BY t2.product_type,t2.product_type_desc", new
var group_datas = _connection.Query<oms_order_platfrom_group_dto>(@"select var group_datas = _connection.Query<oms_order_platfrom_group_dto>(@"select
t1.platform_type, t1.platform_type,
sum(t1.amount_sales * t1.seller_order_exchange_rate * t1.bailun_sku_quantity_ordered) as 'amount_sales' sum(t1.amount_sales * t1.seller_order_exchange_rate * t1.bailun_sku_quantity_ordered) as 'amount_sales'
from dc_base_oms_sku as t1 from dc_base_oms_sku_30 as t1
where t1.paid_time>=@b_this_time and t1.paid_time<=@e_this_time where t1.paid_time>=@b_this_time and t1.paid_time<=@e_this_time
and t1.bailun_order_status != 'Canceled' and t1.bailun_order_status != 'Canceled'
and t1.has_fba_s = 0 and t1.has_fba_s = 0
......
...@@ -1362,7 +1362,7 @@ where ( t5.`status`=0 or t5.`status` is null ) and t1.quantity_begin_advise>0 an ...@@ -1362,7 +1362,7 @@ where ( t5.`status`=0 or t5.`status` is null ) and t1.quantity_begin_advise>0 an
public static List<string> ShortageSkuList(List<string> platform_types, List<string> buyer_names) public static List<string> ShortageSkuList(List<string> platform_types, List<string> buyer_names)
{ {
var datas = _connection.Query<shortage_sku_list_dto>(@" var datas = _connection.Query<shortage_sku_list_dto>(@"
select t1.bailun_sku,t2.buyer_name from dc_base_oms_sku as t1 select t1.bailun_sku,t2.buyer_name from dc_base_oms_sku_30 as t1
left join dc_base_sku as t2 on t1.bailun_sku = t2.bailun_sku left join dc_base_sku as t2 on t1.bailun_sku = t2.bailun_sku
where 1=1 where 1=1
and t1.company_id=1 and t1.company_id=1
......
...@@ -1668,7 +1668,7 @@ truncate table china_warehouse_stock_temp; ", commandTimeout: 0); ...@@ -1668,7 +1668,7 @@ truncate table china_warehouse_stock_temp; ", commandTimeout: 0);
t1.`bailun_sku_quantity_pushed`, t1.`bailun_sku_quantity_pushed`,
( CASE WHEN ( `t1`.`warehouse_code` IN ( 'QYBLZZ', 'GZBLWH' ) ) THEN 'QYBLZZ-GZBLWH' ELSE `t1`.`warehouse_code` END ) as 'warehouse_code_extend', ( CASE WHEN ( `t1`.`warehouse_code` IN ( 'QYBLZZ', 'GZBLWH' ) ) THEN 'QYBLZZ-GZBLWH' ELSE `t1`.`warehouse_code` END ) as 'warehouse_code_extend',
t1.`shipping_deadline_real` t1.`shipping_deadline_real`
from dc_base_oms_sku as t1 from dc_base_oms_sku_30 as t1
left join dc_base_warehouse as t_db on t1.warehouse_code = t_db.warehouse_code left join dc_base_warehouse as t_db on t1.warehouse_code = t_db.warehouse_code
left join dc_base_sku as t6 on t1.bailun_sku = t6.bailun_sku left join dc_base_sku as t6 on t1.bailun_sku = t6.bailun_sku
where t1.company_id=1 and t1.has_innersale=0 and t1.create_time>'2019-03-01 12:00:00' and t1.bailun_picking_status!='TotalPicked' and t1.bailun_order_status = 'Handling' and t1.has_delete=0 and t1.has_scalp=0 and t1.has_buyer_remark = 0 where t1.company_id=1 and t1.has_innersale=0 and t1.create_time>'2019-03-01 12:00:00' and t1.bailun_picking_status!='TotalPicked' and t1.bailun_order_status = 'Handling' and t1.has_delete=0 and t1.has_scalp=0 and t1.has_buyer_remark = 0
...@@ -2056,7 +2056,7 @@ INSERT into dc_base_oms_sku_7_temp ( ...@@ -2056,7 +2056,7 @@ INSERT into dc_base_oms_sku_7_temp (
t1.`has_fba_s`, t1.`has_fba_s`,
t1.`bailun_sku_quantity_pushed`, t1.`bailun_sku_quantity_pushed`,
( CASE WHEN ( `t1`.`warehouse_code` IN ( 'QYBLZZ', 'GZBLWH' ) ) THEN 'QYBLZZ-GZBLWH' ELSE `t1`.`warehouse_code` END ) as 'warehouse_code_extend' ( CASE WHEN ( `t1`.`warehouse_code` IN ( 'QYBLZZ', 'GZBLWH' ) ) THEN 'QYBLZZ-GZBLWH' ELSE `t1`.`warehouse_code` END ) as 'warehouse_code_extend'
from dc_base_oms_sku as t1 from dc_base_oms_sku_30 as t1
left join dc_base_warehouse as t_db on t1.warehouse_code = t_db.warehouse_code left join dc_base_warehouse as t_db on t1.warehouse_code = t_db.warehouse_code
left join dc_base_sku as t6 on t1.bailun_sku = t6.bailun_sku left join dc_base_sku as t6 on t1.bailun_sku = t6.bailun_sku
where t1.company_id=1 and t1.has_innersale=0 and t1.create_time>@time and t1.has_delete=0 and t1.has_scalp=0 and t1.has_buyer_remark = 0 where t1.company_id=1 and t1.has_innersale=0 and t1.create_time>@time and t1.has_delete=0 and t1.has_scalp=0 and t1.has_buyer_remark = 0
...@@ -2091,7 +2091,7 @@ Truncate table dc_base_lastweek_data_temp; ...@@ -2091,7 +2091,7 @@ Truncate table dc_base_lastweek_data_temp;
var datas = _connection.Query<dc_base_lastweek_data_temp>(@"select t1.bailun_sku,t1.warehouse_code, var datas = _connection.Query<dc_base_lastweek_data_temp>(@"select t1.bailun_sku,t1.warehouse_code,
sum(t1.bailun_sku_quantity_ordered) as 'sales', sum(t1.bailun_sku_quantity_ordered) as 'sales',
sum(t1.bailun_sku_quantity_ordered * t1.amount_sales * t1.order_to_usd_exchange_rate) as 'sales_amount' sum(t1.bailun_sku_quantity_ordered * t1.amount_sales * t1.order_to_usd_exchange_rate) as 'sales_amount'
from dc_base_oms_sku t1 from dc_base_oms_sku_30 t1
join dc_base_oms_order t2 on t1.bailun_order_id=t2.bailun_order_id and t2.has_scalp=0 and t2.has_innersale=0 join dc_base_oms_order t2 on t1.bailun_order_id=t2.bailun_order_id and t2.has_scalp=0 and t2.has_innersale=0
left join dc_base_oms_pick t3 on t1.bailun_order_id=t3.bailun_order_id and t1.bailun_sku=t3.bailun_sku and t3.has_delete=0 left join dc_base_oms_pick t3 on t1.bailun_order_id=t3.bailun_order_id and t1.bailun_sku=t3.bailun_sku and t3.has_delete=0
left join dc_base_sku t4 on t1.bailun_sku=t4.bailun_sku left join dc_base_sku t4 on t1.bailun_sku=t4.bailun_sku
...@@ -3153,7 +3153,7 @@ t2.hq_type, ...@@ -3153,7 +3153,7 @@ t2.hq_type,
sum(t1.bailun_sku_quantity_ordered) as 'sales', sum(t1.bailun_sku_quantity_ordered) as 'sales',
sum(t1.bailun_sku_quantity_ordered * t1.amount_sales * t1.seller_order_exchange_rate) as 'sales_amount', sum(t1.bailun_sku_quantity_ordered * t1.amount_sales * t1.seller_order_exchange_rate) as 'sales_amount',
sum(t1.cost_product * t1.bailun_sku_quantity_ordered ) as 'cost_amount' sum(t1.cost_product * t1.bailun_sku_quantity_ordered ) as 'cost_amount'
from dc_base_oms_sku as t1 from dc_base_oms_sku_30 as t1
left join dc_base_warehouse as t2 on t1.warehouse_code = t2.warehouse_code left join dc_base_warehouse as t2 on t1.warehouse_code = t2.warehouse_code
left join dc_base_stock t3 on t1.bailun_sku = t3.bailun_sku and t1.warehouse_code = t3.warehouse_code left join dc_base_stock t3 on t1.bailun_sku = t3.bailun_sku and t1.warehouse_code = t3.warehouse_code
left join dc_base_sku as t4 on t1.bailun_sku = t4.bailun_sku left join dc_base_sku as t4 on t1.bailun_sku = t4.bailun_sku
...@@ -3868,7 +3868,7 @@ paid_time as 'date', ...@@ -3868,7 +3868,7 @@ paid_time as 'date',
1 as 'year_growth_rate', 1 as 'year_growth_rate',
now() as 'create_date', now() as 'create_date',
now() as 'update_date' now() as 'update_date'
from dc_base_oms_sku as t1 from dc_base_oms_sku_30 as t1
left join dc_base_warehouse as t2 on t1.warehouse_code =t2.warehouse_code left join dc_base_warehouse as t2 on t1.warehouse_code =t2.warehouse_code
where t1.bailun_order_status != 'Canceled' where t1.bailun_order_status != 'Canceled'
and t1.has_delete = 0 and t1.has_delete = 0
......
...@@ -33,7 +33,7 @@ namespace AutoTurnOver.DB ...@@ -33,7 +33,7 @@ namespace AutoTurnOver.DB
while (true) while (true)
{ {
var now = DateTime.Now; var now = DateTime.Now;
var sql = " select * from dc_base_oms_sku where gmt_create>=@btime "; var sql = " select * from dc_base_oms_sku_30 where gmt_create>=@btime ";
DynamicParameters parameters = new DynamicParameters(); DynamicParameters parameters = new DynamicParameters();
parameters.Add("btime", btime.ToString("yyyy-MM-dd 00:00:00")); parameters.Add("btime", btime.ToString("yyyy-MM-dd 00:00:00"));
if (etime != null) if (etime != null)
...@@ -474,7 +474,7 @@ namespace AutoTurnOver.DB ...@@ -474,7 +474,7 @@ namespace AutoTurnOver.DB
while (true) while (true)
{ {
var now = DateTime.Now; var now = DateTime.Now;
var sql = " select * from dc_base_oms_sku where gmt_create>=@btime "; var sql = " select * from dc_base_oms_sku_30 where gmt_create>=@btime ";
DynamicParameters parameters = new DynamicParameters(); DynamicParameters parameters = new DynamicParameters();
parameters.Add("btime", btime.ToString("yyyy-MM-dd 00:00:00")); parameters.Add("btime", btime.ToString("yyyy-MM-dd 00:00:00"));
if (etime != null) if (etime != null)
...@@ -779,8 +779,8 @@ namespace AutoTurnOver.DB ...@@ -779,8 +779,8 @@ namespace AutoTurnOver.DB
{ {
var now = DateTime.Now; var now = DateTime.Now;
var sql = @" select t1.*,(case when t1.platform_type='ebay' then t3.warehouse_code else t2.warehouse_code end) as 'warehouse_code' from dc_base_crm_refund as t1 var sql = @" select t1.*,(case when t1.platform_type='ebay' then t3.warehouse_code else t2.warehouse_code end) as 'warehouse_code' from dc_base_crm_refund as t1
left join dc_base_oms_sku as t2 on t1.origin_order_id = t2.origin_order_id and t1.bailun_sku = t2.bailun_sku left join dc_base_oms_sku_30 as t2 on t1.origin_order_id = t2.origin_order_id and t1.bailun_sku = t2.bailun_sku
left join dc_base_oms_sku as t3 on t1.origin_order_id = t3.transaction_id and t1.bailun_sku = t3.bailun_sku left join dc_base_oms_sku_30 as t3 on t1.origin_order_id = t3.transaction_id and t1.bailun_sku = t3.bailun_sku
where t1.gmt_create>=@btime and t1.gmt_create<=@etime "; where t1.gmt_create>=@btime and t1.gmt_create<=@etime ";
DynamicParameters parameters = new DynamicParameters(); DynamicParameters parameters = new DynamicParameters();
parameters.Add("btime", btime.ToString("yyyy-MM-dd 00:00:00")); parameters.Add("btime", btime.ToString("yyyy-MM-dd 00:00:00"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment