Parcourir la source

Merge remote-tracking branch 'origin/master'

徐滕 il y a 3 jours
Parent
commit
aa20f0d092

+ 15 - 0
docs/sql/addsql/20261120.sql

@@ -0,0 +1,15 @@
+-- 材料价格列表排序调整同步修改索引
+
+
+ALTER TABLE `material_price_record`
+DROP INDEX `idx_mpr_query`,
+DROP INDEX `idx_mpr_province`,
+DROP INDEX `idx_mpr_date`,
+DROP INDEX `idx_mpr_option`,
+DROP INDEX `idx_mpr_list`,
+DROP INDEX `idx_mpr_province_list`,
+ADD INDEX `idx_mpr_list_id_name` (`del_flag`, `price_date`, `tax_included`, `id`, `material_name`),
+ALGORITHM=INPLACE, LOCK=NONE;
+
+
+

+ 3 - 2
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/materialPrice/service/MaterialPriceRecordService.java

@@ -57,14 +57,15 @@ public class MaterialPriceRecordService extends ServiceImpl<MaterialPriceRecordM
     private RedisUtils redisUtils;
 
     /**
-     * 分页查询。排序固定为「数据日期倒序 + 采集时间倒序」,最新的数据排在最前。
+     * 分页查询。排序为「数据日期倒序 → 是否含税 」
+     * 同一天内含税在前、不含税其次、未声明最后。
      *
      * 无任何筛选条件时总数走缓存:这种查询每次都要统计全表 60 多万行,
      * 而数据一天只变几次,没必要每翻一页都统计一遍。
      */
     public IPage<MaterialPriceRecord> pageQuery(Page<MaterialPriceRecord> page, MaterialPriceQueryDTO query) {
         QueryWrapper<MaterialPriceRecord> wrapper = buildWrapper(query, true);
-        wrapper.orderByDesc("price_date").orderByDesc("scraped_at");
+        wrapper.orderByDesc("price_date").orderByDesc("tax_included").orderByDesc("id");
         if (!isFiltered(query)) {
             page.setSearchCount(false);
             IPage<MaterialPriceRecord> result = this.page(page, wrapper);