Giter Site home page Giter Site logo

Comments (5)

abel533 avatar abel533 commented on August 22, 2024

输出的 SQL 什么样?确定是物理分页的?

from mybatis-pagehelper.

haozileung avatar haozileung commented on August 22, 2024

@abel533
sql是select * from users limit 10

from mybatis-pagehelper.

abel533 avatar abel533 commented on August 22, 2024

AbstractHelperDialect 中的 afterCount 方法断点,找找原因!

from mybatis-pagehelper.

haozileung avatar haozileung commented on August 22, 2024

@abel533
调试发现是要设置rowBoundsWithCount=true,才有total数据。

PageParams.getPage方法设置了rowBoundsWithCount

可是文档内是讲

rowBoundsWithCount:默认值为false,该参数对使用 RowBounds 作为分页参数时有效。 当该参数设置为true时,使用 RowBounds 分页会进行 count 查询(使用 PageRowBounds 时一定会进行 count 查询,不受该参数影响)。

所以?

from mybatis-pagehelper.

abel533 avatar abel533 commented on August 22, 2024

文档错误。。这个实际上只在 AbstractRowBoundsDialect 的实现中是这样。。

文档已经修改。需要设置 rowBoundsWithCount。

from mybatis-pagehelper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.