自己手写分页

Integer pageNum = partsConInfo.getPageNum();
Integer pageSize = partsConInfo.getPageSize();
Integer fromIndex = pageNum * pageSize - pageSize;
Integer toIndex = fromIndex + pageSize;
partsConInfo.setFromIndex(fromIndex); //第几页开始
partsConInfo.setToIndex(toIndex); //第几页结束

select * from (
        select tmp.*,rownum rowsid from (
        select trim(t$orno) orno,trim(T$BPID) bpid ,trim(T$RKDT) rkdt ,trim(T$SCDH) scdh ,trim(T$ITEM) item ,trim(T$CORN) corn,trim(T$CKDT) ckdt  from Ttdsct461400
        <where>
            <if test="condition.bpidFrom != null and condition.bpidFrom != '' and condition.bpidTo != null and condition.bpidTo != '' ">
                and t$bpid &gt;= #{condition.bpidFrom} and t$bpid &lt;= #{condition.bpidTo}
            </if>
            <if test="condition.rkdtFrom != null and condition.rkdtFrom != '' and condition.rkdtTo != null and condition.rkdtTo != '' ">
                and t$rkdt &gt;= #{condition.rkdtFrom} and t$rkdt &lt;= #{condition.rkdtTo}
            </if>
            <if test="condition.itemFrom != null and condition.itemFrom != '' and condition.itemTo != null and condition.itemTo != '' ">
                and t$item &gt;= #{condition.itemFrom} and t$item &lt;= #{condition.itemTo}
            </if>
            <if test="condition.scdhFrom != null and condition.scdhFrom != '' and condition.scdhTo != null and condition.scdhTo != '' ">
                and t$scdh &gt;= #{condition.scdhFrom} and t$scdh &lt;= #{condition.scdhTo}
            </if>
        </where>
        ) tmp where rownum &lt;= #{condition.toIndex})
        where rowsid > #{condition.fromIndex}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值