left join dc_base_warehouse as t2 on t1.warehouse_code = t2.warehouse_code
where t1.warehouse_code in @warehouse_codes
GROUP BY t1.bailun_sku,t2.area_id
) as t6 on t1.bailun_sku = t6.bailun_sku and t_db.area_id = t6.area_id
) as t6 on t1.bailun_sku = t6.bailun_sku and t_db.area_id = t6.area_id
where t1.warehouse_code in @warehouse_codes
and ifnull(t6.usable_stock,0)<=(case when t2.buyer_name in ('张莹霞','张莹霞1') and @platform='ebay' then 2 else 0 end )
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 )