_connection.Execute(@"REPLACE INTO dc_base_forecast_history(`bailun_sku`,`warehouse_code`,`bailun_sku_warehouse_code`,`date`,`date_str`,`create_date`,`sales`,`turnover_days`,`quantity_safe_inventory`,`supplier_delivery`,`transfer_config_delivery`,`transfer_bale_config_delivery`,`abroad_inbound_config_delivery`,`inspection_config_delivery`,`inspection_delivery`,`transfer_delivery`,`daily_weighted_sales`,`transfer_bale_delivery`,`abroad_inbound_delivery`,`quantity_final_advise`,`usable_stock`,`quantity_transfer`,`quantity_purchase`)
_connection.Execute(@"REPLACE INTO dc_base_forecast_history(`bailun_sku`,`warehouse_code`,`bailun_sku_warehouse_code`,`date`,`date_str`,`create_date`,`sales`,`turnover_days`,`quantity_safe_inventory`,`supplier_delivery`,`transfer_config_delivery`,`transfer_bale_config_delivery`,`abroad_inbound_config_delivery`,`inspection_config_delivery`,`inspection_delivery`,`transfer_delivery`,`daily_weighted_sales`,`transfer_bale_delivery`,`abroad_inbound_delivery`,`quantity_final_advise`,`usable_stock`,`quantity_transfer`,`quantity_purchase`,`turnover_sales`)
(
(
select
select
t1.bailun_sku,
t1.bailun_sku,
...
@@ -1068,7 +1068,8 @@ t1.abroad_inbound_delivery as 'abroad_inbound_delivery',
...
@@ -1068,7 +1068,8 @@ t1.abroad_inbound_delivery as 'abroad_inbound_delivery',
t1.quantity_final_advise as 'quantity_final_advise',
t1.quantity_final_advise as 'quantity_final_advise',
t2.usable_stock as 'usable_stock',
t2.usable_stock as 'usable_stock',
t3.quantity_transfer as 'quantity_transfer',
t3.quantity_transfer as 'quantity_transfer',
t3.quantity_purchase as 'quantity_purchase'
t3.quantity_purchase as 'quantity_purchase',
t1.turnover_sales as 'turnover_sales'
from dc_auto_turnover as t1
from dc_auto_turnover as t1
left join dc_base_stock as t2 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code =t2.warehouse_code
left join dc_base_stock as t2 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code =t2.warehouse_code
left join dc_mid_transit as t3 on t1.bailun_sku = t3.bailun_sku and t1.warehouse_code =t3.warehouse_code
left join dc_mid_transit as t3 on t1.bailun_sku = t3.bailun_sku and t1.warehouse_code =t3.warehouse_code
...
@@ -1076,7 +1077,7 @@ where t1.gmt_modified>=@btime and t1.gmt_modified<=@etime
...
@@ -1076,7 +1077,7 @@ where t1.gmt_modified>=@btime and t1.gmt_modified<=@etime
_connection.Execute(@"REPLACE INTO dc_base_forecast_history_ocean(`bailun_sku`,`warehouse_code`,`bailun_sku_warehouse_code`,`date`,`date_str`,`create_date`,`sales`,`turnover_days`,`quantity_safe_inventory`,`supplier_delivery`,`transfer_config_delivery`,`transfer_bale_config_delivery`,`abroad_inbound_config_delivery`,`inspection_config_delivery`,`inspection_delivery`,`transfer_delivery`,`daily_weighted_sales`,`transfer_bale_delivery`,`abroad_inbound_delivery`,`quantity_final_advise`,`usable_stock`,`quantity_transfer`,`quantity_purchase`)
_connection.Execute(@"REPLACE INTO dc_base_forecast_history_ocean(`bailun_sku`,`warehouse_code`,`bailun_sku_warehouse_code`,`date`,`date_str`,`create_date`,`sales`,`turnover_days`,`quantity_safe_inventory`,`supplier_delivery`,`transfer_config_delivery`,`transfer_bale_config_delivery`,`abroad_inbound_config_delivery`,`inspection_config_delivery`,`inspection_delivery`,`transfer_delivery`,`daily_weighted_sales`,`transfer_bale_delivery`,`abroad_inbound_delivery`,`quantity_final_advise`,`usable_stock`,`quantity_transfer`,`quantity_purchase`,`turnover_sales`)
(
(
select
select
t1.bailun_sku,
t1.bailun_sku,
...
@@ -1101,7 +1102,8 @@ t1.abroad_inbound_delivery as 'abroad_inbound_delivery',
...
@@ -1101,7 +1102,8 @@ t1.abroad_inbound_delivery as 'abroad_inbound_delivery',
t1.quantity_final_advise as 'quantity_final_advise',
t1.quantity_final_advise as 'quantity_final_advise',
t2.usable_stock as 'usable_stock',
t2.usable_stock as 'usable_stock',
t3.quantity_transfer as 'quantity_transfer',
t3.quantity_transfer as 'quantity_transfer',
t3.quantity_purchase as 'quantity_purchase'
t3.quantity_purchase as 'quantity_purchase',
t1.turnover_sales as 'turnover_sales'
from dc_auto_turnover_ocean as t1
from dc_auto_turnover_ocean as t1
left join dc_base_stock as t2 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code =t2.warehouse_code
left join dc_base_stock as t2 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code =t2.warehouse_code
left join dc_mid_transit as t3 on t1.bailun_sku = t3.bailun_sku and t1.warehouse_code =t3.warehouse_code
left join dc_mid_transit as t3 on t1.bailun_sku = t3.bailun_sku and t1.warehouse_code =t3.warehouse_code
...
@@ -1109,7 +1111,7 @@ where t1.gmt_modified>=@btime and t1.gmt_modified<=@etime
...
@@ -1109,7 +1111,7 @@ where t1.gmt_modified>=@btime and t1.gmt_modified<=@etime
_connection.Execute(@"REPLACE INTO dc_base_forecast_history_air (`bailun_sku`,`warehouse_code`,`bailun_sku_warehouse_code`,`date`,`date_str`,`create_date`,`sales`,`turnover_days`,`quantity_safe_inventory`,`supplier_delivery`,`transfer_config_delivery`,`transfer_bale_config_delivery`,`abroad_inbound_config_delivery`,`inspection_config_delivery`,`inspection_delivery`,`transfer_delivery`,`daily_weighted_sales`,`transfer_bale_delivery`,`abroad_inbound_delivery`,`quantity_final_advise`,`usable_stock`,`quantity_transfer`,`quantity_purchase`)
_connection.Execute(@"REPLACE INTO dc_base_forecast_history_air (`bailun_sku`,`warehouse_code`,`bailun_sku_warehouse_code`,`date`,`date_str`,`create_date`,`sales`,`turnover_days`,`quantity_safe_inventory`,`supplier_delivery`,`transfer_config_delivery`,`transfer_bale_config_delivery`,`abroad_inbound_config_delivery`,`inspection_config_delivery`,`inspection_delivery`,`transfer_delivery`,`daily_weighted_sales`,`transfer_bale_delivery`,`abroad_inbound_delivery`,`quantity_final_advise`,`usable_stock`,`quantity_transfer`,`quantity_purchase`,`turnover_sales`)
(
(
select
select
t1.bailun_sku,
t1.bailun_sku,
...
@@ -1134,7 +1136,8 @@ t1.abroad_inbound_delivery as 'abroad_inbound_delivery',
...
@@ -1134,7 +1136,8 @@ t1.abroad_inbound_delivery as 'abroad_inbound_delivery',
t1.quantity_final_advise as 'quantity_final_advise',
t1.quantity_final_advise as 'quantity_final_advise',
t2.usable_stock as 'usable_stock',
t2.usable_stock as 'usable_stock',
t3.quantity_transfer as 'quantity_transfer',
t3.quantity_transfer as 'quantity_transfer',
t3.quantity_purchase as 'quantity_purchase'
t3.quantity_purchase as 'quantity_purchase',
t1.turnover_sales
from dc_auto_turnover_air as t1
from dc_auto_turnover_air as t1
left join dc_base_stock as t2 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code =t2.warehouse_code
left join dc_base_stock as t2 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code =t2.warehouse_code
left join dc_mid_transit as t3 on t1.bailun_sku = t3.bailun_sku and t1.warehouse_code =t3.warehouse_code
left join dc_mid_transit as t3 on t1.bailun_sku = t3.bailun_sku and t1.warehouse_code =t3.warehouse_code
...
@@ -1284,7 +1287,6 @@ where t1.gmt_modified>=@btime and t1.gmt_modified<=@etime
...
@@ -1284,7 +1287,6 @@ where t1.gmt_modified>=@btime and t1.gmt_modified<=@etime
@@ -1540,7 +1536,7 @@ where t1.gmt_modified>=@btime and t1.gmt_modified<=@etime
...
@@ -1540,7 +1536,7 @@ where t1.gmt_modified>=@btime and t1.gmt_modified<=@etime
val=modalData.freight_price
val=modalData.freight_price
});
});
vardc_base_forecast_history_ocean_data=_connection.QueryFirstOrDefault<dc_base_forecast_history>(" select * from dc_base_forecast_history_ocean where warehouse_code=@warehouse_code and bailun_sku=@bailun_sku and date_str<=@date_str order by `date` desc limit 1 ",new
vardc_base_forecast_history_ocean_data=_connection.QueryFirstOrDefault<dc_base_forecast_history>(" select * from dc_base_forecast_history_ocean where warehouse_code=@warehouse_code and bailun_sku=@bailun_sku and `date`<=@date_str order by `date` desc limit 1 ",new
{
{
warehouse_code=result.warehouse_code,
warehouse_code=result.warehouse_code,
bailun_sku=result.bailun_sku,
bailun_sku=result.bailun_sku,
...
@@ -1549,12 +1545,11 @@ where t1.gmt_modified>=@btime and t1.gmt_modified<=@etime
...
@@ -1549,12 +1545,11 @@ where t1.gmt_modified>=@btime and t1.gmt_modified<=@etime
@@ -1571,7 +1566,7 @@ where t1.gmt_modified>=@btime and t1.gmt_modified<=@etime
...
@@ -1571,7 +1566,7 @@ where t1.gmt_modified>=@btime and t1.gmt_modified<=@etime
val=modalData.freight_price_ocean
val=modalData.freight_price_ocean
});
});
vardc_base_forecast_history_air_data=_connection.QueryFirstOrDefault<dc_base_forecast_history>(" select * from dc_base_forecast_history_air where warehouse_code=@warehouse_code and bailun_sku=@bailun_sku and date_str<=@date_str order by `date` desc limit 1 ",new
vardc_base_forecast_history_air_data=_connection.QueryFirstOrDefault<dc_base_forecast_history>(" select * from dc_base_forecast_history_air where warehouse_code=@warehouse_code and bailun_sku=@bailun_sku and `date`<=@date_str order by `date` desc limit 1 ",new
{
{
warehouse_code=result.warehouse_code,
warehouse_code=result.warehouse_code,
bailun_sku=result.bailun_sku,
bailun_sku=result.bailun_sku,
...
@@ -1580,12 +1575,11 @@ where t1.gmt_modified>=@btime and t1.gmt_modified<=@etime
...
@@ -1580,12 +1575,11 @@ where t1.gmt_modified>=@btime and t1.gmt_modified<=@etime