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
and EXISTS ( select * from dc_auto_turnover as t2 where t1.bailun_sku =t2.bailun_sku and t1.warehouse_code = t2.warehouse_code)
-- 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);
}
...
...
@@ -138,7 +138,11 @@ ORDER BY t1.update_time desc LIMIT @seed_count
return_connection.Query<dc_base_purchase_inbound_dto>(@"select * from dc_base_purchase_inbound where purchase_id in @purchase_ids and bailun_sku = @bailun_sku
conn.Execute(" update dc_auto_purchase_advise_detailed set quantity_actual=quantity_init_advise where quantity_actual<=0 and main_id=@mainID ",new{mainID=lastPurchaseAdvise.id},transaction);
conn.Execute(" update dc_auto_purchase_advise_detailed set quantity_actual=quantity_init_advise where quantity_actual<=0 and id in @ids ",new{ids=datas.Select(s=>s.id).ToList()},transaction);