spring boot配置pagehelper插件
一、maven配置
<mybatis-spring.version>2.1.1</mybatis-spring.version>
<pagehelper-spring.version>1.2.3</pagehelper-spring.version>
<pagehelper.version>5.1.8</pagehelper.version>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>${mybatis-spring.version}</version>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>${pagehelper-spring.version}</version>
<exclusions>
<exclusion>
<artifactId>pagehelper</artifactId>
<groupId>com.github.pagehelper</groupId>
</exclusion>
<exclusion>
<artifactId>mybatis-spring</artifactId>
<groupId>org.mybatis</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>${pagehelper.version}</version>
</dependency>
二、配置文件配置
application.yml
pagehelper:
helperDialect: mysql
#开启优化,如果开启优化,在分页页码结果没有数据的时候,会显示有数据的页码数据
reasonable: true
#是否支持接口参数来传递分页参数,默认false
supportMethodsArguments: true
#pageSize=0 返回所有
pageSizeZero: false
params: count=countSql
三、使用
PageHelper.startPage(pageNo,pageSize);
userService.getUsers();
spring boot配置pagehelper插件的更多相关文章
- spring boot 使用 pageHelper插件
按照github上的教程集成到spring boot pom文件引用需要改一下,教程的pom文件引用: 工程中要用以下方式 <!--分页--> <dependency> < ...
- spring boot配置分页插件
在springboot中使用PageHelper插件有两种较为相似的方式,接下来我就将这两种方式进行总结. 方式一:使用原生的PageHelper 1.在pom.xml中引入依赖 <depend ...
- spring boot 整合pagehelper分页插件
Spring Boot 整合pagehelper分页插件 测试环境: spring boot 版本 2.0.0.M7 mybatis starter 版本 1.3.1 jdk 1.8 ------ ...
- Spring Boot 配置优先级顺序
一般在一个项目中,总是会有好多个环境.比如: 开发环境 -> 测试环境 -> 预发布环境 -> 生产环境 每个环境上的配置文件总是不一样的,甚至开发环境中每个开发者的环境可能也会有一 ...
- Spring Boot的Maven插件Spring Boot Maven plugin详解
Spring Boot的Maven插件(Spring Boot Maven plugin)能够以Maven的方式为应用提供Spring Boot的支持,即为Spring Boot应用提供了执行Mave ...
- spring boot配置druid连接池连接mysql
Spring Boot 集成教程 Spring Boot 介绍 Spring Boot 开发环境搭建(Eclipse) Spring Boot Hello World (restful接口)例子 sp ...
- spring boot集成mybatis-plus插件进行自定义sql方法开发时报nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
spring boot集成mybatis-plus插件进行自定义sql方法开发时报nested exception is org.apache.ibatis.binding.BindingExcept ...
- Spring Boot -- 配置切换指南
一般在一个项目中,总是会有好多个环境.比如: 开发环境 -> 测试环境 -> 预发布环境 -> 生产环境 每个环境上的配置文件总是不一样的,甚至开发环境中每个开发者的环境可能也会有一 ...
- spring boot 配置注入
spring boot配置注入有变量方式和类方式(参见:<spring boot 自定义配置属性的各种方式>),变量中又要注意静态变量的注入(参见:spring boot 给静态变量注入值 ...
- Spring boot配置多个Redis数据源操作实例
原文:https://www.jianshu.com/p/c79b65b253fa Spring boot配置多个Redis数据源操作实例 在SpringBoot是项目中整合了两个Redis的操作实例 ...
随机推荐
- golang之项目部署
介绍 Go 语言可以使用内置命令行工具 go build 编译生成可执行文件.自 Go1.5 版本开始实现自举后,交叉编译也很方便,只需使用 GOOS.GOARCH 环境变量指定目标平台和架构. 部署 ...
- wps文字表格邮件附件部分图片无法预览的问题(1)
使用邮箱客户端发送带word附件的邮件时,客户说部分图片无法查看.我方人员测试下,得到如下几点: 1.出问题的.docx文件下载后可以正常打开查看,但通过给自己邮箱转发邮件(包含附件),foxmail ...
- CSS3 过渡和动画
1.CSS过渡 含义:在没有过渡属性的时候,当一个元素的属性值发生变化时,浏览器就会将这个元素瞬间渲染成新属性值的样式.例如一个定位元素top:0,动态修改成top:100px,这个元素就瞬间跑到10 ...
- 中电金信技术实践|Redis哨兵原理及安装部署分享
导语:本文主要围绕redis Sentinel的基本概念.部署Redis Sentinel模式和其相关的API等内容进行介绍,并讲述哨兵与主从关系的区别,以及哨兵机制是怎么实现高可用的,希望可以与 ...
- csrf跨站请求伪造与校验策略
目录 一.csrf跨站请求伪造 概念引入 概念讲解 二.csrf校验策略 概念讲解 form表单操作csrf策略 ajax请求csrf策略 三.csrf相关装饰器 一.csrf跨站请求伪造 概念引入 ...
- MyBatisPlus中updateById与updateAllColumnById方法区别
实现 updateById方法在插入时,会根据实体类的每个属性进行非空判断,只有非空的属性所对应的字段才会出现在SQL语句中. updateAllColumnById方法在插入时,不管属性是否为空,属 ...
- Kerberos认证代码分析Can't get Kerberos realm
1. Can't get Kerberos realm 原因分析: 原始代码为: 1 2 org.apache.hadoop.security.UserGroupInformation.setConf ...
- 基于Three.js的大屏3D地图(一)
依赖安装 yarn add three yarn add @types/three yarn add d3-geo three库安装后在node_modules下其还包含核心three/src和插件t ...
- Qt编写可视化大屏电子看板系统32-模块10大屏地图
一.前言 大屏地图模块采用浏览器模块+echart组件,Qt自带了webkit或者webengine模块,其中在win上mingw编译器的Qt5.6以后的版本,没有了浏览器模块,这个就需要用第三方的浏 ...
- Qt音视频开发系列文章导航
文章 链接 1-vlc解码播放 https://qtchina.blog.csdn.net/article/details/107742836 2-vlc回调处理 https://qtchina.bl ...