库存预警

This commit is contained in:
zjf committed 2025-02-20 16:29:16 +08:00
1 parent de1ed3ae7e
commit 207b92865b
1 file changed
+3 -3
@@ -43,14 +43,14 @@
spu.product_name,
spu.barcode,
CASE
WHEN (stock.base_stock + stock.current_stock) > stock.inventory_upper_limit THEN 'UPPER_LIMIT'
ELSE 'LOWER_LIMIT'
WHEN (stock.base_stock + stock.current_stock) > stock.inventory_upper_limit THEN '2'
ELSE '1'
END AS warn_type
FROM sm_erp_stock stock
LEFT JOIN sm_erp_spu spu ON stock.spu_id = spu.id
<where>
<!-- 库存预警条件 -->
(stock.base_stock + stock.current_stock) NOT BETWEEN stock.inventory_lower_limit AND stock.inventory_upper_limit
(stock.base_stock + stock.current_stock) &lt; stock.inventory_lower_limit or (stock.base_stock + stock.current_stock) > stock.inventory_upper_limit
<!-- 动态查询条件 -->
<if test="param.productCode != null and param.productCode != ''">