Only the first Mybatis query (select) method immediately after the PageHelper.startPage
method will be paged.
When using Spring, you can config PageHelper by mybatis-config.xml
or Spring<bean>
.
Select one of them, do not configure PageHelper in two ways at the same time.
Since the nested result mode causes the resultSet to be folded, the total number of results for the paged query will decrease after folding. So It cannot guarantee the number of paged results correctly.