java oracle的2种分页方法
2024-09-21 06:05:36
java oracle的2种分页方法
一物理分页:
<!-- 分页查询所有的博客信息 -->
<select id="findBlogs" resultType="java.util.HashMap" parameterType="Params">
SELECT * FROM(
SELECT ROWNUM WN,RN.* FROM (
SELECT
id,
title,
create_time as createTime,
musictor,
musictitle
FROM
krry_blog
ORDER BY create_time desc
)RN
)WN
WHERE WN <= #{pageSize} AND WN > #{pageNo}
</select>
二逻辑分页,利用pagehelper插件
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>4.0.0</version>
</dependency>
https://blog.csdn.net//u013142781/article/details/50410243
三逻辑分页,利用mybatis-paginator
<dependency>
<groupId>com.github.miemiedev</groupId>
<artifactId>mybatis-paginator</artifactId>
<version>1.2.10</version>
</dependency>
xml
<select id="queryListBlur" flushCache="true" resultType="WxReplyPO">
select
reply_id,
reply_classify,
reply_type,
reply_keyword,
reply_text,
reply_image,
is_enable,
is_delete,
match_mode,
create_time,
update_time
from ta_wx_reply_c
WHERE 1=1
<if test="isEnable != null">
AND is_enable = #{isEnable}
</if>
<if test="isDelete != null">
AND is_delete = #{isDelete}
</if>
<if test="replyClassify != null and replyClassify.trim() != ''">
AND reply_classify = #{replyClassify}
</if>
<if test="replyType != null and replyType.trim() != ''">
AND reply_type = #{replyType}
</if>
<if test="replyKeyword != null and replyKeyword.trim() != ''">
AND reply_keyword LIKE concat(#{replyKeyword},'%')
</if>
<if test="matchMode != null and matchMode.trim() != ''">
AND match_mode = #{matchMode}
</if>
<choose>
<when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order}
</when>
<otherwise>
order by reply_id desc
</otherwise>
</choose>
<!--<if test="offset != null and limit != null">-->
<!--limit #{offset}, #{limit}-->
<!--</if>-->
</select>
IWxReplyService
List<WxReplyPO> queryListBlur(Map<String, Object> map, PageBounds pageBounds);
IWxReplyServiceImpl
@Override
public List<WxReplyPO> queryListBlur(Map<String, Object> map, PageBounds pageBounds) {
return taWxReplyCDao.queryListBlur(map, pageBounds);
}
controller
wxReplyService.queryListBlur(attentionPO,
new PageBounds(
Integer.valueOf(request.getPageNo()), //页码
Integer.valueOf(request.getPageSize()), //条数
Order.formString("attention_dept_date.desc")) //排序
);
https://blog.csdn.net/szwangdf/article/details/27859847/
最新文章
- YII 的源码分析(-)
- Subsonic简单的语法整理
- linux学习中遇到的各种故障与解决方法
- 重装Ubuntu系统并配置开发环境
- js的体会
- NYOJ--21--bfs--三个水杯
- python进行md5加密
- Intellij Idea15 快捷键设置大全
- Python Day 8
- swagger2的接口文档
- 超越LLMNR /NBNS欺骗 - 利用Active Directory集成的DNS
- ASP.NET MVC 3 Performance – on par with MVC 2
- java网络编程之Socket编程
- geek网工作室主页------我的第一个小项目
- [Java多线程]-ThreadLocal源码及原理的深入分析
- WCF学习记录(一)
- JSP、Java和Servlet获取当前工程的路径
- 基于C#的UDP协议的异步实现
- nfs 文件共享 服务
- python匿名函数 与 内置函数
热门文章
- 超简单的react和typescript和引入scss项目搭建流程
- python 之 Django框架(模板系统、过滤器、simple_tag、inclusion_tag、Tags、母版、组件)
- maven打包spring boot项目及跳过test文件
- go 学习笔记(4) import
- Mycat分布式数据库架构解决方案--Server.xml详解
- 禁止迅雷极速版被强制升级为迅雷x
- springboot超级详细的日志配置(基于logback)
- MySQL5.7.16安装及配置
- Oracle 创建数据表
- 关于vue-svg-icon的使用方式