java oracle的2种分页方法
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/
java oracle的2种分页方法的更多相关文章
- phalcon几种分页方法
phalcon几种分页方法 一: use Phalcon\Paginator\Adapter\Model as PaginatorModel; // Current page to show // I ...
- PostgreSQL两种分页方法查询时间比较
数据库中存了3000W条数据,两种分页查询测试时间 第一种 SELECT * FROM test_table WHERE i_id> limit 100; Time: 0.016s 第二种 SE ...
- java 中的几种 "通用方法“
前言 Java中,除了基本的数值类型,其他所有数据类型(包括数组)都是对象. 而Object这个类是所有类的超类,它提供的方法,自然能够使用于它的所有子类(所有非基本数值类型). 本文介绍了Objec ...
- sql server两种分页方法
方法一: --分页方法一 OrderID,CustomerID, EmployeeID,OrderDate,ShippedDate,ShipName,ShipAddress,Freight from ...
- java多线程有几种实现方法,都是什么?同步有几种实现方法,都是什么?
多线程有两种实现方法,分别是继承Thread类与实现Runnable接口 同步的实现方面有两种,分别是synchronized,wait与notify 先看一下java线程运行时各个阶段的运行状态 j ...
- Java List /ArrayList 三种遍历方法
java list三种遍历方法性能比较http://www.cnblogs.com/riskyer/p/3320357.html JAVA LIST 遍历http://blog.csdn.net/lo ...
- Java反射的两种使用方法
1.创建User.java package com.tao.test; public class User { private String name; private int id; public ...
- 2017.10.25 Java List /ArrayList 三种遍历方法
java list三种遍历方法性能比较 学习java语言list遍历的三种方法,顺便测试各种遍历方法的性能,测试方法为在ArrayList中插入记录,然后遍历ArrayList,测试代码如下: pac ...
- java多线程有几种实现方法,都是什么?
转自:http://www.cnblogs.com/liujichang/p/3150387.html 多线程有两种实现方法,分别是继承Thread类与实现Runnable接口 同步的实现方法有两种, ...
随机推荐
- linux 创建虚拟机常见错误
无法打开内核设备global vmx86 重启虚拟机所有服务 无法创建虚拟机 需要使用管理员身份运行vm即可
- HTML学习--基础知识
WEB a) 什么是WEB WEB,是基于Internet上的一种应用程序(网页应用程序),WEB页面,简称WEB页(网页),就是保存在服务器端上的一个具体的页面 b) WEB ...
- 如何用navicat导入数据?
介绍了如何使用navicat导入数据到数据库 0背景介绍 这里用的软件版本号是11.2.7 1选择要导入的数据库,右击选择导入向导 2 选择导入数据文件的类型 根据要导入数据文件的类型,选择对应的导入 ...
- 导出Excel的2个方法
导出到Excel的两种方法 第一种: 1.首先创建Excle模板,另存为 “xml”文件.使用记事本等编辑软件打开文件的代码.然后另存为视图文件“Export.cshtml”; 2.控制器操作 pub ...
- Dubbo -- 四种loadBalance负载均衡算法
Dubbo中的一个关键接口LoadBalance,dubbo是按照其中的规则来调用多台provider的服务的. 先看一下接口的实现类图: 从上图中我们可以看到dubbo提供了四种算法来实现负载均衡. ...
- 【雅思】【绿宝书错词本】List37~48
List 37 ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ List 38 ❤ ❤ ❤ ❤ ❤ ❤ ❤ ❤ ❤ ❤ ❤ ❤ ❤ ❤ ❤ List 39 ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ...
- SQL+C#:一次多语言混合编程的经验总结
1.用JAVA做,采取轮询策略: 2.用sql语言+C#混合编程,采取触发策略
- linux后台运行、关闭、查看后台任务常用命令
一.& 加在一个命令的最后,可以把这个命令放到后台执行,如: [root@bqh-01 ~]# watch -n 3 "sh 1.sh" #每3s在后台执行一次1.sh脚 ...
- Python标准库-datatime和time
Python标准库-datatime和time 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.标准库datatime 1>.datatime模块 #!/usr/bin/e ...
- 批处理引擎MapReduce内部原理
批处理引擎MapReduce内部原理 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.MapReduce作业生命周期 MapReduce作业作为一种分布式应用程序,可直接运行在H ...