lxw
2022-12-01 6988f626a4b2b627a87f5ee3832b1a7013be709d
数据库管理查询
1个文件已修改
14 ■■■■■ 已修改文件
src/main/java/com/whyc/service/FileParamService.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/FileParamService.java
@@ -3,6 +3,7 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.whyc.dto.*;
@@ -203,7 +204,18 @@
                }
            }
        }
        PageInfo pageInfo=new PageInfo(flagList);
        //创建Page类
        Page page = new Page(pageCurr, pageSize);
        //为Page类中的total属性赋值
        int total = flagList.size();
        page.setTotal(total);
       //计算当前需要显示的数据下标起始值
        int startIndex = (pageCurr - 1) * pageSize;
        int endIndex = Math.min(startIndex + pageSize,total);
        //从链表中截取需要显示的子链表,并加入到Page
        page.addAll(flagList.subList(startIndex,endIndex));
        //以Page创建PageInfo
        PageInfo pageInfo = new PageInfo<>(page);
        return new Response().setII(1,flagList.size()>0,pageInfo,"筛选数据库信息");
    }