PageHeplper使用
1、引入POM
1 <dependency>
2 <groupId>com.github.pagehelper</groupId>
3 <artifactId>pagehelper</artifactId>
4 <version>5.2.0</version>
5 </dependency>
2、Mybatis添加PageHepler配置
@Bean
public PageInterceptor pageInterceptor(){
PageInterceptor pageInterceptor = new PageInterceptor();
Properties properties=new Properties();
properties.setProperty("helperDialect","mysql");
properties.setProperty("helperDialect","mysql");
properties.setProperty("reasonable","true");
properties.setProperty("supportMethodsArguments","true");
properties.setProperty("params","count=countSql");
pageInterceptor.setProperties(properties);
return pageInterceptor;
}
3、代码中使用
public PageInfo<OauthClientDetail> listByPage(Integer page, Integer limit){
PageHelper.startPage(page,limit);
List<OauthClientDetail> oauthClientDetails = oauthClientDetailsMapper.listByPage();
return PageInfo.of(oauthClientDetails);
、}
PageHeplper使用的更多相关文章
随机推荐
- 解决sqlplus中方向键和退格键乱码问题
centos7 1.安装rlwrap软件包 yum install rlwrap -y 2.编辑环境变量 su - oracle vim ~/.bash_profile alias sqlplus=' ...
- WebRTC 的音频弱网对抗之 NACK
基础知识 音频的 NACK 机制在 WebRTC 中默认是关闭的. rtcp feedbacknack开启就可以了 WebRTC 的音频数据传输中,尽管对低延时有着很高的要求,但也实现了 NACK,以 ...
- CUDA kernel使用printf调试,一定要加cudaDeviceSynchronize
#include <stdio.h> __global__ void print() { printf("Hello from (%d, %d)\n", blockId ...
- vue高级进阶( 一 ) 组件精髓概述
前言 这个系列可能会分为几部分: 基础以及高级用法总结 一些比较有代表性的实战 源码解析(一定是用最粗俗,不对,是最通俗的语言讲解,这个我可以保证) 总之一定对得起高级进阶这几个字... 组件分类 v ...
- 吴恩达老师机器学习课程chapter07——聚类
吴恩达老师机器学习课程chapter07--聚类 本文是非计算机专业新手的自学笔记,高手勿喷. 本文仅作速查备忘之用,对应吴恩达(AndrewNg)老师的机器学期课程第十三章. 缺少重要推演,只能作为 ...
- C++之split字符串分割
在C++中没有直接对应的split函数,字符串分割可借助以下方法实现: 1.借助strtok函数 函数原型:char * strtok (char *str, char * delim); 函数功能: ...
- Unit mysqld.service could not be found.
具体命令 service mysqld status systemctl status mysqld 结果 Unit mysqld.service could not be found. 查看mysq ...
- Spring-XML文件与注解
(一)基于XML的使用 (二)基于注解和XML的混合使用
- Linux如何设置用户登录超时(/etc/profile)
1. 针对所有用户 # vi /etc/profile ... export TMOUT=900 # 设置闲置时间为15分钟,单位为秒;如果没有此行则直接添加进去 ... vi /etc/profil ...
- 【C学习笔记】day2-4 将三个数按从大到小输出
#include <stdio.h> int main() { int max, min, mid; int a = 324, b = 435, c = 43; if (a > b) ...