feat(goods): 添加商品数量统计接口并优化商品查询
- 新增 getGoodsNumVO 接口,用于获取不同状态的商品数量统计 - 在 GoodsSearchParams 中添加 goodsStatus 字段,用于筛选商品状态 - 修改 queryByParams 方法,支持按商品状态进行筛选 - 新增 GoodsNumVO 类,用于返回商品数量统计结果 -优化商品查询性能,通过聚合查询一次性获取所有状态的商品数量
This commit is contained in:
14
DB/index.sql
Normal file
14
DB/index.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
-- 针对WHERE条件、排序和分组的组合索引
|
||||
CREATE INDEX idx_order_delete_flag_create_time_id_sn ON li_order (delete_flag, create_time DESC, id DESC, sn);
|
||||
|
||||
-- 针对WHERE条件和连接条件的组合索引
|
||||
CREATE INDEX idx_order_status_delete_flag_sn ON li_order (order_status, delete_flag, sn);
|
||||
|
||||
-- 针对连接条件的索引
|
||||
CREATE INDEX idx_order_item_order_sn ON li_order_item (order_sn);
|
||||
|
||||
-- 针对过滤条件、排序字段的组合索引
|
||||
CREATE INDEX idx_li_member_disabled_create_time ON li_member (disabled, create_time DESC);
|
||||
|
||||
-- 针对过滤条件、排序字段的组合索引
|
||||
CREATE INDEX idx_li_goods_delete_flag_create_time ON li_goods (delete_flag, create_time DESC);
|
||||
Reference in New Issue
Block a user