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. RDP Error: The Identity Of The Remote Computer Cannot Be Verified

    As i always need to remote to 20 servers at the same time, so i use a tool called Remote Desktop Con ...

  2. python with方法

    在实际的编码过程中,有时有一些任务,需要事先做一些设置,事后做一些清理,这时就需要python with出场了,with能够对这样的需求进行一个比较优雅的处理,最常用的例子就是对访问文件的处理. 一般 ...

  3. python中将已有链接的视频进行下载

    使用python爬取视频网站时,会得到一系列的视频链接,比如MP4文件.得到视频文件之后需要对视频进行下载,本文写出下载视频文件的函数. 首先导入requests库,安装库使用pip install ...

  4. 什么是openshift

    Openshift是一个开源的容器云平台,底层基于当前容器的事实标准编排系统Kubernetes和docker引擎,企业可以基于此平台搭建内部Paas平台,贯穿CI/CD流程,提高企业IT效率,拥抱D ...

  5. 协议——SPI

    SPI(Serial Peripheral interface)是由摩托罗拉公司定义的一种串行外围设备接口,是一种高速.全双工.同步的通信总线,只需要四根信号线即可,节约引脚,同时有利于PCB的布局. ...

  6. GOF 的23种JAVA常用设计模式总结 02 UML中的类图与类图之间的关系

    统一建模语言UML 统一建模语言(Unified Modeling Language,UML)是用来设计软件蓝图的可视化建模语言,1997 年被国际对象管理组织(OMG)采纳为面向对象的建模语言的国际 ...

  7. 系統启动直接进BIOS

  8. springboot笔记08——整合swagger2

    Swagger是什么? Swagger是一个RESTFUL 接口的文档在线自动生成和功能测试的框架.利用swagger2的注解可以快速的在项目中构建Api接口文档,并且提供了测试API的功能. Spr ...

  9. 微服务与SpringCloud简介

    A.官网 https://spring.io/projects/spring-cloud B.简介 Spring Cloud是一个基于Spring Boot实现的云应用开发工具,它为基于JVM的云应用 ...

  10. js 一些有意思的小Demo