We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
int offset = 0; boolean isLast = false; while (!isLast) { PageHelper.offsetPage(offset, LIMIT); PageInfo<Gjc> pageInfo = new PageInfo<>(gjcMapper.getGjcs()); for (Gjc gjc : pageInfo.getList()) { redisService.set(GJC.concat(gjc.getGjc()), String.valueOf(gjc.getBh())); } isLast = pageInfo.isIsLastPage(); offset = offset + LIMIT; }
代码如上 gjcMapper.getGjcs() 数据库一条数据都没有,取回的时候 isLast = pageInfo.isIsLastPage(); 的标志位始终为false
gjcMapper.getGjcs()
The text was updated successfully, but these errors were encountered:
查看了源码 是PageInfo 这个类里面下面的方法 加了一个判断pages == 0就好了,帮忙看下,谢谢
private void judgePageBoudary() { isFirstPage = pageNum == 1; isLastPage = pageNum == pages || pages == 0; hasPreviousPage = pageNum > 1; hasNextPage = pageNum < pages; }
Sorry, something went wrong.
分页取数据时,如果数据一条都没有返回, pageInfo.isIsLastPage(); 返回false #50
7a4c6eb
今天会发布一个5.0.2-beta版本,如果方便可以帮忙测试这个版本。
@abel533 好的
No branches or pull requests
代码如上
gjcMapper.getGjcs()
数据库一条数据都没有,取回的时候
isLast = pageInfo.isIsLastPage(); 的标志位始终为false
The text was updated successfully, but these errors were encountered: