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使用的更多相关文章
随机推荐
- 阿里云IPSec的一些问题
1.阿里云IPSec无法进行多段连接单个IPSec连接 解决方案 在阿里云端需要如下操作 1.单个VPN网关下创建多个IPSec连接 连接属性一致 使用兴趣流模式.打开nat转换. 2段对2段 ...
- 第一次写,python爬虫图片,操作excel。
第一次写博客,其实老早就注册博客园了,有写博客的想法,就是没有行动,总是学了忘,忘了丢,最后啥都没有,电脑里零零散散,东找找,西看看,今天认识到写博客的重要性. 最近闲着看了潭州教育的在线直播课程,颇 ...
- OKHttp 之--------http/https协议处理方法 (Finn_ZengYuan博客)
如果遇到okttp需要使用https协议,那么就需要在支持ssl,不说了,撸码搞起: 加入下面代码即可搞定:主要就是设置 builder.sslSocketFactory(sslParams.sSLS ...
- OSPF配置知识总结3(多区域配置)
OSPF配置知识总结3(多区域配置) 1.相关解释: 要解决网络规模大了以后的问题:网络的扩展性,降低路由器负载,实现路由的更快收敛 OSPF多区域的区域类型分为Area 0(骨干区域), 以及非Ar ...
- 第一个helloworld程序
; hello.asm section .data msg db "hello, world",13,10,0 section .bss section .text global ...
- 从零搭建hadoop集群之CentOS7配置网卡为静态IP
CentOS7默认网卡设备文件存放于 /etc/sysconfig/network-scripts/ CentOS7的网卡设备名称是 ifcfg-ens33 vim /etc/sysconfi ...
- vue页面点击按钮增加和删除标签
1.在data()里定义一个空数组: conditions:[], 2.给数组一个容器,并且遍历数组 <div v-for="item in conditions">& ...
- 一、MySQL 函数
1.MySQL 字符串函数 函数 描述 实例 结果展示 说明 REPLACE(s,s1,s2) 将字符串s2代替字符串s中的字符串s1 SELECT REPLACE(ccc.contract_no,& ...
- centos7 启动报错 Failed to mount /sysroot
centos7 启动报错 Failed to mount /sysroot 场景: centos7系统异常关闭后,启动后进入不了图形化界面 解决方法: 1. 定位报错原因 进入单用户模式后执行下面 ...
- javascript【应用】debounce和throttle
debounce防抖 在事件被触发n秒后再执行回调,如果在这n秒内又被触发,则重新计时:典型的案例就是输入搜索:输入结束后n秒才进行搜索请求,n秒内又输入的内容,就重新计时. <div id=& ...