code-learning/mybatis/28-mybatis-插件体系(二)之 PageHelper.md

18 lines
1.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 精尽 MyBatis 源码分析 —— 插件体系(二)之 PageHelper
[Mybatis-PageHelper](https://github.com/pagehelper/Mybatis-PageHelper) ,基于 MyBatis 插件体系,实现了**分页**功能。感兴趣的胖友,可以看看它的源码。艿艿暂时不是特别感兴趣,因为:
1. 团队目前主要以手写 SQL 为主,或者自动生成 SQL 为辅。
2. [MyBatis-Plus](https://github.com/baomidou/mybatis-plus) 也提供了分页插件,并且据艿艿了解到,可能更加广泛。它的分页插件的拦截器是 `com.baomidou.mybatisplus.plugins.PaginationInterceptor` ,具体可参见文档 [《MyBatis-Plus 文档 —— 分页插件》](http://mp.baomidou.com/guide/page.html) 。
当然,考虑到胖友可能比较感兴趣,艿艿还是翻了翻目前网络上的文章,目前写的比较好的是:
- 祖大俊
《Mybatis3.4.x技术内幕二十PageHelper分页插件源码及原理剖析》
- 因为写的比较早,所以对应的 [Mybatis-PageHelper](https://github.com/pagehelper/Mybatis-PageHelper) 的代码比较早,所以和目前的代码,已经对应不上了。
- 【**相对推荐**】一直不懂 [《【Mybatis源码分析】12-插件PageHelper机制》](https://blog.csdn.net/shenchaohao12321/article/details/80168655)