Commit 17091ced by lizefeng

优化周转表无法按照SKU 仓库查询的异常

parent ba7191a1
......@@ -25,7 +25,7 @@ namespace AutoTurnOver.DB
DynamicParameters parameters = new DynamicParameters();
parameters.Add("time", DateTime.Now.AddDays(0 - day).ToString("yyyy-MM-dd 00:00:00"));
return _connection.Query<temp_sku_dto>(@"select t1.bailun_sku,t1.warehouse_code,t1.supplier_id from dc_base_purchase as t1
where t1.supplier_id>0
where t1.supplier_id>0 and buy_status=4
-- and EXISTS ( select * from dc_auto_turnover as t2 where t1.bailun_sku =t2.bailun_sku and t1.warehouse_code = t2.warehouse_code)
GROUP BY t1.bailun_sku,t1.warehouse_code,t1.supplier_id ");
//return _connection.Query<temp_sku_dto>("select t1.bailun_sku,t1.warehouse_code,t1.supplier_id from dc_base_purchase as t1 where t1.update_time>=@time group by t1.bailun_sku,t1.warehouse_code,t1.supplier_id ", parameters);
......
......@@ -307,15 +307,15 @@ where 1=1
}
if (!string.IsNullOrWhiteSpace(sku))
{
sql += " and t_base.bailun_sku in @bailun_skus ";
countSql += " and t_base.bailun_sku in @bailun_skus ";
sql += " and t1.bailun_sku in @bailun_skus ";
countSql += " and t1.bailun_sku in @bailun_skus ";
parameters.Add("bailun_skus", sku.Split(','));
}
if (!string.IsNullOrWhiteSpace(warehouse_code))
{
sql += " and t_base.warehouse_code=@warehouse_code ";
countSql += " and t_base.warehouse_code=@warehouse_code ";
sql += " and t1.warehouse_code=@warehouse_code ";
countSql += " and t1.warehouse_code=@warehouse_code ";
parameters.Add("warehouse_code", warehouse_code);
}
......
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