feat: can fulfillment sku order filter

This commit is contained in:
Timi
2026-11-08 01:39:42 +08:00
parent e5a065fbaf
commit 7d8172e063
3 changed files with 36 additions and 0 deletions
@@ -23,6 +23,15 @@
o.`deleted_at` IS NULL
<if test="storeId != null and storeId != ''">AND o.`store_id` = #{storeId}</if>
<if test="customerId != null and customerId != ''">AND o.`customer_id` = #{customerId}</if>
<if test="fulfillableSkuId != null and fulfillableSkuId != ''">
AND o.`status` &lt;&gt; 'CANCELLED'
AND EXISTS (
SELECT 1 FROM `gao_sales_order_item` i
WHERE i.`sales_order_id` = o.`id` AND i.`deleted_at` IS NULL
AND i.`sku_id` = #{fulfillableSkuId}
AND COALESCE(i.`fulfilled_base_quantity`, 0) + COALESCE(i.`reserved_base_quantity`, 0) &lt; COALESCE(i.`base_quantity`, 0)
)
</if>
<if test="packageConfigId != null and packageConfigId != ''">
AND EXISTS (
SELECT 1 FROM `gao_customer_package` cp