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种分页方法的更多相关文章

  1. phalcon几种分页方法

    phalcon几种分页方法 一: use Phalcon\Paginator\Adapter\Model as PaginatorModel; // Current page to show // I ...

  2. PostgreSQL两种分页方法查询时间比较

    数据库中存了3000W条数据,两种分页查询测试时间 第一种 SELECT * FROM test_table WHERE i_id> limit 100; Time: 0.016s 第二种 SE ...

  3. java 中的几种 "通用方法“

    前言 Java中,除了基本的数值类型,其他所有数据类型(包括数组)都是对象. 而Object这个类是所有类的超类,它提供的方法,自然能够使用于它的所有子类(所有非基本数值类型). 本文介绍了Objec ...

  4. sql server两种分页方法

    方法一: --分页方法一 OrderID,CustomerID, EmployeeID,OrderDate,ShippedDate,ShipName,ShipAddress,Freight from ...

  5. java多线程有几种实现方法,都是什么?同步有几种实现方法,都是什么?

    多线程有两种实现方法,分别是继承Thread类与实现Runnable接口 同步的实现方面有两种,分别是synchronized,wait与notify 先看一下java线程运行时各个阶段的运行状态 j ...

  6. Java List /ArrayList 三种遍历方法

    java list三种遍历方法性能比较http://www.cnblogs.com/riskyer/p/3320357.html JAVA LIST 遍历http://blog.csdn.net/lo ...

  7. Java反射的两种使用方法

    1.创建User.java package com.tao.test; public class User { private String name; private int id; public ...

  8. 2017.10.25 Java List /ArrayList 三种遍历方法

    java list三种遍历方法性能比较 学习java语言list遍历的三种方法,顺便测试各种遍历方法的性能,测试方法为在ArrayList中插入记录,然后遍历ArrayList,测试代码如下: pac ...

  9. java多线程有几种实现方法,都是什么?

    转自:http://www.cnblogs.com/liujichang/p/3150387.html 多线程有两种实现方法,分别是继承Thread类与实现Runnable接口 同步的实现方法有两种, ...

随机推荐

  1. Linux学习-文件基础权限

    文件基本权限 drwxr-xr-x 第一个字符表示文件类型 d:表示是一个目录.-:表示这是一个普通的文件.l: 表示这是一个符号链接文件,实际上它指向另一个文件.b.c:分别表示区块设备和其他的外围 ...

  2. linux根据进程名终止进程

    2017年09月25日 19:44:32 aladdin_sun 阅读数 5235   linux根据进程名终止进程 实验环境 操作系统:CentOS Linux release 7.3.1611 ( ...

  3. Python 运算符 各类运算符总结

    运算符详解2.1.算术运算符2.2.比较(关系)运算符2.3.赋值运算符2.4.逻辑运算符2.5.位运算符2.6.成员运算符2.7.身份运算符三.重要运算符说明3.1.join和符号”+“区别3.2. ...

  4. spring session cpu占用过高

      集成spring session很简单,只需几行代码即可. @Configuration @EnableRedisHttpSession public class SessionConfig { ...

  5. Android--Facebook Login with LoginButton

    1.Layout文件添加Facebook的LoginBurtton <com.facebook.widget.LoginButton android:id="@+id/authButt ...

  6. pdfplumber模块初始用

    import pdfplumber import re def pdf_read(): pdf=pdfplumber.open('文件路径'")#文件路径,读取文件 page0=pdf.pa ...

  7. Elasticsearch-6.7.0系列(八)开启kibana监控

    修改ES配置: 修改elasticsearch.yml,添加如下xpack配置: xpack.security.enabled: true xpack.ml.enabled: true xpack.l ...

  8. twbsPagination.js分页插件

    分页插件在使用时注意,如果页面中存在其他异步加载的数据,在运行分页方法第一次后,页面上的分页样式与分页中的data数据就是第一次的数据,如果异步加载重新在页面上录入数据,并希望分页继续在新的数据上实现 ...

  9. SpringBoot 多数据库支持:

    SpringBoot 多数据库支持: springboot2.0+mybatis多数据源集成 https://www.cnblogs.com/cdblogs/p/9275883.html Spring ...

  10. 每周分享五个 PyCharm 使用技巧(四)

    文章首发于 微信公众号:Python编程时光 PyCharm 是大多数 Python 开发者的首选 IDE,每天我们都在上面敲着熟悉的代码,写出一个又一个奇妙的功能. 一个每天都在使用的工具,如果能掌 ...