SpringBoot集成Mybatis分页插件PageHelper
2019-04-01 20:20
405 查看
1.注入依赖
<dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper-spring-boot-starter</artifactId> <version>1.2.9</version> </dependency>
2. 配置 application.yml
#pagehelper分页配置 pagehelper: helperDialect: mysql reasonable: true supportMethodsArguments: true params: count=countSql
3.Controller层使用
public interface ArticleMapper { @Select("select * from tb_article") public List<Article> getArticleById (); } public String pageArticle(@RequestParam(defaultValue = "1")Integer pageNum, @RequestParam(defaultValue = "10")Integer pageSize,Model model ){ PageHelper.startPage(pageNum,pageSize); List<Article> article = articleService.getArticleIndex(); PageInfo<Article> alist = new PageInfo<Article>(article); model.addAttribute("alist",article); }
相关文章推荐
- SpringBoot集成MyBatis的分页插件PageHelper
- springboot集成mybatis的分页插件pageHelper
- spring-boot 集成mybatis的分页插件PageHelper版本问题
- Spring,SpringBoot 集成 MyBatis 的分页插件 PageHelper
- spring-boot 集成mybatis的分页插件PageHelper和Generator (番外)
- SpringBoot集成MyBatis的分页插件PageHelper(回头草)
- springboot如何集成mybatis的pagehelper分页插件
- mybatis 分页插件pagehelper集成及使用
- SpringBoot集成PageHelper时出现“在系统中发现了多个分页插件,请检查系统配置!”
- spring-boot 集成mybatis的分页插件PageHelper和Generator
- SpringBoot集成MyBatis的分页插件PageHelper(回头草)
- springboot2.0.5集成mybatis(PageHelper分页插件、generator插件使用)
- [置顶] MyBatis基于Spring-boot集成通用Mapper以及pagehelper分页插件(含源码下载)
- springboot 集成pageHelper插件分页
- Spring Boot系列六 Spring boot集成mybatis、分页插件pagehelper
- springboot 集成myBatis PageHelper 分页插件
- spring-boot 集成mybatis的分页插件PageHelper和Generator (番外)
- SpringBoot2.0学习之集成MyBatis PageHelper分页插件
- mybatis框架---分页插件PageHelper的使用方法
- Mybatis分页插件PageHelper简单使用