|
@@ -61,7 +61,7 @@ public interface DeviceInventoryMapper extends BaseMapper<DeviceInventory> {
|
|
|
" COUNT(di.id) as product_count, " +
|
|
" COUNT(di.id) as product_count, " +
|
|
|
" MAX(di.last_restock_time) as last_restock_time, " +
|
|
" MAX(di.last_restock_time) as last_restock_time, " +
|
|
|
" SUM(CASE WHEN di.stock = 0 THEN 1 ELSE 0 END) as zero_stock_count, " +
|
|
" SUM(CASE WHEN di.stock = 0 THEN 1 ELSE 0 END) as zero_stock_count, " +
|
|
|
- " SUM(CASE WHEN di.stock <= di.warning_threshold AND di.stock > 0 THEN 1 ELSE 0 END) as low_stock_count, " +
|
|
|
|
|
|
|
+ " SUM(CASE WHEN di.stock < di.standard_stock AND di.standard_stock > 0 THEN 1 ELSE 0 END) as low_stock_count, " +
|
|
|
" SUM(CASE WHEN di.product_id IS NULL OR di.product_id = 0 THEN 1 ELSE 0 END) as unknown_product_count " +
|
|
" SUM(CASE WHEN di.product_id IS NULL OR di.product_id = 0 THEN 1 ELSE 0 END) as unknown_product_count " +
|
|
|
"FROM t_device d " +
|
|
"FROM t_device d " +
|
|
|
"LEFT JOIN t_shop s ON d.shop_id = s.id " +
|
|
"LEFT JOIN t_shop s ON d.shop_id = s.id " +
|