Commit 84658090 by 泽锋 李

优化周转表,实时库存表查询速度

parent bcf56693
......@@ -336,7 +336,7 @@ t6.history_sevenday_sales_amazon,t6.history_fourteenday_sales_amazon,t6.history_
dbw.area_name,
dbw.hq_type,
ifnull(t15.count,0) as 'not_trans_count',
-- ifnull(t15.count,0) as 'not_trans_count',
t4.quantity_purchase * t3.unit_price as 'realtime_amount_purchase',
t4.quantity_transfer * t3.unit_price as 'realtime_amount_transfer',
......@@ -372,7 +372,7 @@ left join dc_auto_config_sku_warehouse as t7 on t1.bailun_sku = t7.bailun_sku an
left join dc_auto_sales as t8 on t1.bailun_sku=t8.bailun_sku and t1.warehouse_code = t8.warehouse_code
left join dc_base_lastweek_data as t9 on t1.bailun_sku=t9.bailun_sku and t1.warehouse_code = t9.warehouse_code
left join dc_base_stock_extend as t10 on t1.bailun_sku=t10.bailun_sku and t1.warehouse_code = t10.warehouse_code
left join not_trans_view as t15 on t1.bailun_sku=t15.bailun_sku and t1.warehouse_code = t15.warehouse_code
-- left join not_trans_view as t15 on t1.bailun_sku=t15.bailun_sku and t1.warehouse_code = t15.warehouse_code
";
......
......@@ -67,7 +67,7 @@ t4.brand as 'brand',
t7.first_inbound_date,
t3.area_name,
ifnull(t15.count,0) as 'not_trans_count',
-- ifnull(t15.count,0) as 'not_trans_count',
t13.quantity_land_purchase as 'quantity_land_purchase',
t13.quantity_ocean_purchase as 'quantity_ocean_purchase',
......@@ -96,7 +96,7 @@ left join dc_base_tort as t8 on dat.bailun_sku = t8.bailun_sku
left join dc_return_goods_not_push as t12 on dat.bailun_sku = t12.bailun_sku and dat.warehouse_code = t12.warehouse_code
left join dc_mid_transit as t13 on dat.bailun_sku = t13.bailun_sku and dat.warehouse_code = t13.warehouse_code
-- left join dc_auto_sales_forecast_config as t14 on dat.dc_auto_sales_forecast_config_id = t14.id
left join not_trans_view as t15 on dat.bailun_sku = t15.bailun_sku and dat.warehouse_code = t15.warehouse_code
-- left join not_trans_view as t15 on dat.bailun_sku = t15.bailun_sku and dat.warehouse_code = t15.warehouse_code
where 1=1 ";
}
......@@ -302,18 +302,7 @@ from dc_auto_turnover as dat
sqlCount += " and t15.count>=@not_trans_count_min ";
parameters.Add("not_trans_count_min", m.not_trans_count_min);
}
if (m.not_trans_count_max != null)
{
sql += " and t15.count<=@not_trans_count_max ";
sqlCount += " and t15.count<=@not_trans_count_max ";
parameters.Add("not_trans_count_max", m.not_trans_count_max);
}
if (m.quantity_out_stock_min != null)
{
sql += " and dat.quantity_out_stock>=@quantity_out_stock_min ";
sqlCount += " and dat.quantity_out_stock>=@quantity_out_stock_min ";
parameters.Add("quantity_out_stock_min", m.quantity_out_stock_min);
}
if (m.quantity_out_stock_max != null)
{
sql += " and dat.quantity_out_stock>=@quantity_out_stock_max ";
......
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