where t2.`status`=2 and t1.bailun_sku = t2.bailun_sku and quantity_final_advise=1 and quantity_init_advise=1 and ( t2.buyer_name not in ('赵美聪','甄杰靖','张莹霞','张莹霞1') or t1.warehouse_code!='GZBLWH' ) and main_id=@main_id ",new{main_id=mainID},commandTimeout:0);
//张莹霞1 and 广州01 去掉缺货数
// _connection.Execute(@" update dc_auto_purchase_advise_detailed as t1,
//where t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code and t1.bailun_sku=t3.bailun_sku
//and t1.quantity_init_advise>=0 and ( t3.buyer_name in ('张莹霞1') and t1.warehouse_code='GZBLWH' ) and t1.main_id=@main_id ", new { main_id = mainID }, commandTimeout: 0);
// _connection.Execute(@" update dc_auto_purchase_advise_detailed as t1,
//where t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code and t1.bailun_sku=t3.bailun_sku
//and t1.quantity_init_advise>=0 and ( t3.buyer_name in ('张莹霞1') and t1.warehouse_code='GZBLWH' ) and t1.main_id=@main_id ", new { main_id = mainID }, commandTimeout: 0);
//全量出的时候,才需要这一步
if(is_clear_data)
...
...
@@ -669,22 +670,23 @@ where t2.`status`=2 and t1.bailun_sku = t2.bailun_sku and quantity_final_advise=
left join dc_base_warehouse as t2 on t1.warehouse_code =t2.warehouse_code
where t2.hq_type='fba仓'
-- and t2.area_id=7
and quantity_init_advise<0 and t1.bailun_sku in @bailun_skus ",new{
sqlWhere.Append(" AND t2.suppliers_name = @suppliername ");
}
sqlQuery.Append("SELECT t1.plan_nos,t1.bailun_sku, date_format(t1.push_date, '%Y-%m-%d') AS create_order_date,t1.warehouse_code,t3.warehouse_name,t2.sku_title_cn,'' AS supplier_sku,");