首页 > 代码库 > mybatis分页插件Mybatis_PageHelper 简单案例
mybatis分页插件Mybatis_PageHelper 简单案例
源码地址(官网,文档)
使用条件:
支持mybatis 3.1.0+
sql 解析工具(jsqlparser.jar)
下载 Mybatis_PageHelper 版本随意,反正我用的5.0.0
maven:
<dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper</artifactId> <version>5.0.0</version> </dependency>
xml:
<plugin interceptor="com.github.pagehelper.PageInterceptor"> <!-- 支持通过Mapper接口参数来传递分页参数 --> <property name="supportMethodsArguments" value="true"/> <property name="rowBoundsWithCount" value="true"/> </plugin>
java:
session.selectList(qdi, map,new RowBounds(startItem, size));
就是这么简单。
更多功能,请查看
mybatis分页插件Mybatis_PageHelper 简单案例
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。