| | |
| | | CASE |
| | | WHEN (IFNULL(t2.qualitity, 0) - IFNULL(t2.locked_quantity, 0)) >= IFNULL(T1.quantity, 0) THEN 1 |
| | | ELSE 0 |
| | | END as has_sufficient_stock |
| | | END as has_sufficient_stock, |
| | | CASE |
| | | WHEN t2.id IS NOT NULL THEN 1 |
| | | ELSE 0 |
| | | END as has_stock_inventory |
| | | FROM |
| | | sales_ledger_product T1 |
| | | LEFT JOIN stock_inventory t2 ON T1.product_model_id = t2.product_model_id |
| | |
| | | AND slp.product_category = #{req.productCategory} |
| | | </if> |
| | | <!-- 按产品大类分组聚合 --> |
| | | GROUP BY slp.product_category |
| | | GROUP BY slp.product_category,slp.specification_model,sl.supplier_name |
| | | <!-- 按产品大类排序 --> |
| | | ORDER BY slp.product_category |
| | | </select> |
| | |
| | | FROM product_tree); |
| | | |
| | | </select> |
| | | </mapper> |
| | | </mapper> |