@@ -507,10 +507,9 @@ and ( t1.quantity_purchase<=0 and (ifnull(t4.sum_unshipped_quantity,0) - ifnull(
...
@@ -507,10 +507,9 @@ and ( t1.quantity_purchase<=0 and (ifnull(t4.sum_unshipped_quantity,0) - ifnull(
and (ifnull(t4.sum_unshipped_quantity,0) - ifnull(t3.sum_usable_stock,0))>0 -- 有缺货
and (ifnull(t4.sum_unshipped_quantity,0) - ifnull(t3.sum_usable_stock,0))>0 -- 有缺货
and ( case
and ( case
when @platform='ebay' then ( t2.buyer_name not in ('张莹霞','张莹霞1','赵美聪','甄杰靖','赵美聪','赵美聪1','秦振荣','李华娟','赵美聪-独立站') or t2.`status`=1 or ( t2.buyer_name in ('黄镜洁') and t2.product_type_desc in ('精准普货','推荐普货','精准普货','精准服装') ) )
when @platform='ebay' then ( t2.buyer_name not in ('张莹霞','张莹霞1','赵美聪','甄杰靖','赵美聪','赵美聪1','秦振荣','李华娟','赵美聪-独立站') or t2.`status`=1 or ( t2.buyer_name in ('黄镜洁') and t2.product_type_desc in ('精准普货','推荐普货','精准普货','精准服装') ) )
when @platform!='aliexpress' then ( t2.buyer_name not in ('张莹霞','张莹霞1','赵美聪','甄杰靖','黄镜洁','赵美聪','赵美聪1','秦振荣','李华娟','赵美聪-独立站') or t2.`status`=1 )
else ( t2.buyer_name not in ('张莹霞','张莹霞1','赵美聪','甄杰靖','黄镜洁','赵美聪','赵美聪1','秦振荣','李华娟','赵美聪-独立站') or t2.`status`=1 )
else ( t2.`status`=1 or t7.bailun_sku is null)
end
end
) -- 速卖通的必须要停止监控才推送
)
and ( ifnull(t4.sum_quantity_purchase,0)<=0 or t2.buyer_name in ('张莹霞','张莹霞1','赵美聪','甄杰靖','黄镜洁','赵美聪','赵美聪1','秦振荣','李华娟','赵美聪-独立站')
and ( ifnull(t4.sum_quantity_purchase,0)<=0 or t2.buyer_name in ('张莹霞','张莹霞1','赵美聪','甄杰靖','黄镜洁','赵美聪','赵美聪1','秦振荣','李华娟','赵美聪-独立站')
) -- 无在途 或者 自产 (自产的有在途也要推)
) -- 无在途 或者 自产 (自产的有在途也要推)
and not exists ( select * from dc_auto_shortage_push_not_config where dc_auto_shortage_push_not_config.warehouse_code=t1.warehouse_code and dc_auto_shortage_push_not_config.bailun_sku=t1.bailun_sku )
and not exists ( select * from dc_auto_shortage_push_not_config where dc_auto_shortage_push_not_config.warehouse_code=t1.warehouse_code and dc_auto_shortage_push_not_config.bailun_sku=t1.bailun_sku )
...
@@ -565,9 +564,9 @@ t1.usable_stock<=0 and t1.bailun_sku!=''
...
@@ -565,9 +564,9 @@ t1.usable_stock<=0 and t1.bailun_sku!=''
and ( t1.warehouse_code in ('GZBLWH','BLGZ03') or ( t1.warehouse_code in ('YWWH01') and ( t3.`status`=1 or t6.`status`=1 ) ) ) -- 义务仓 只要停止监控 或者停售就推送
and ( t1.warehouse_code in ('GZBLWH','BLGZ03') or ( t1.warehouse_code in ('YWWH01') and ( t3.`status`=1 or t6.`status`=1 ) ) ) -- 义务仓 只要停止监控 或者停售就推送
and t1.bailun_sku not in ('942904501')
and t1.bailun_sku not in ('942904501')
and ( case
and ( case
when @platform='ebay' then ( t3.buyer_name not in ('张莹霞','张莹霞1','赵美聪','甄杰靖','赵美聪','赵美聪1','秦振荣','李华娟','赵美聪-独立站') or t3.`status`=1 or ( t3.buyer_name in ('黄镜洁') and t3.product_type_desc in ('精准普货','推荐普货','精准普货','精准服装') ) )
when @platform!='aliexpress' then ( t3.buyer_name not in ('张莹霞','张莹霞1','赵美聪','甄杰靖','黄镜洁','赵美聪','赵美聪1','秦振荣','李华娟','赵美聪-独立站') or t3.`status`=1 )
else ( t3.`status`=1 or t7.bailun_sku is null)
when @platform='ebay' then ( t3.buyer_name not in ('张莹霞','张莹霞1','赵美聪','甄杰靖','赵美聪','赵美聪1','秦振荣','李华娟','赵美聪-独立站') or t3.`status`=1 or ( t3.buyer_name in ('黄镜洁') and t3.product_type_desc in ('精准普货','推荐普货','精准普货','精准服装') ) )
else ( t3.buyer_name not in ('张莹霞','张莹霞1','赵美聪','甄杰靖','黄镜洁','赵美聪','赵美聪1','秦振荣','李华娟','赵美聪-独立站') or t3.`status`=1 )
end
end
) -- 速卖通的必须要停止监控才推送
)
and IFNULL(t4.sum_usable_stock,0)<=0 -- 无库存
and IFNULL(t4.sum_usable_stock,0)<=0 -- 无库存
and ( @platform='ebay' or ifnull(t5.sum_quantity_purchase,0)<=0 or t3.buyer_name in ('张莹霞','张莹霞1','赵美聪','甄杰靖','黄镜洁','赵美聪','赵美聪1','秦振荣','李华娟','赵美聪-独立站')
and ( @platform='ebay' or ifnull(t5.sum_quantity_purchase,0)<=0 or t3.buyer_name in ('张莹霞','张莹霞1','赵美聪','甄杰靖','黄镜洁','赵美聪','赵美聪1','秦振荣','李华娟','赵美聪-独立站')