zoukankan      html  css  js  c++  java
  • springboot整合PageHelper

    1.pom文件中引入Pagehelper分页插件

    <!-- 分页插件 -->
    <dependency>
        <groupId>com.github.pagehelper</groupId>
        <artifactId>pagehelper-spring-boot-starter</artifactId>
        <version>1.2.5</version>
    </dependency>

    2.配置分页插件

    打开application.yml,添加如下几行配置信息

    #分页插件
    
    pagehelper:
      helper-dialect: mysql
      params: count=countSql
      reasonable: true
      support-methods-arguments: true

    3. 分页样例

    public ReturnBean<List<T>> selectList(Map para) {
        Long count = getMapper().selectListCount(para);
        PageHelper.startPage(Integer.valueOf(para.get(SysConstant.PAGE).toString()),Integer.valueOf(para.get(SysConstant.LIMIT).toString()));
        List<T> list = getMapper().selectList(para);
        PageInfo<T> pageInfo = new PageInfo<T>(list);
        return ReturnBean.list(pageInfo.getList(),count);
    }

    结束

  • 相关阅读:
    VueRouter-404错误配置
    VueRouter-组件复用
    VueRouter-动态路由
    vue-router基本使用
    Vue小作业--图书管理
    Vue的过滤器
    vue的生命周期
    vue中插槽
    vue自定义组件v-model
    Vue组件中自定义事件
  • 原文地址:https://www.cnblogs.com/wanlipenghtml/p/11348272.html
Copyright © 2011-2022 走看看