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
目前在 PageInfo 存在一个 of 方法,这个方法在使用 PageHelper.startPage(0, 10) 时可以正常获取全部属性值,但是当使用 PageHelper.startPage(0, 10, false) 时会导致无法获取完整的属性值,有以下的功能请求:
PageInfo
of
PageHelper.startPage(0, 10)
PageHelper.startPage(0, 10, false)
total
long total = userMapper.selectCount(); if (total == 0) { return new ArrayList<User>(); } PageHelper.startPage(0, 10, false) List<User> list = userMapper.select(); PageInfo<User> pageInfo = PageInfo.of(list);
ISelect
PageHelper.startPage(0, 10, () -> userMapper.selectCount()); List<User> list = userMapper.select(); PageInfo<User> pageInfo = PageInfo.of(list);
我比较喜欢第一种方式,因为正常来讲,当数据为 0 的时候,就不必继续执行查询语句了。
The text was updated successfully, but these errors were encountered:
来个PR?
Sorry, something went wrong.
我也有这个场景的需求,如果没人认领,我来提个PR?
No branches or pull requests
功能建议
目前在
PageInfo
存在一个of
方法,这个方法在使用PageHelper.startPage(0, 10)
时可以正常获取全部属性值,但是当使用PageHelper.startPage(0, 10, false)
时会导致无法获取完整的属性值,有以下的功能请求:of
方法添加一个total
参数,传入总数然后返回完整的属性值of
方法添加一个ISelect
参数,可以将查询方法写在函数中,然后返回完整的属性值我比较喜欢第一种方式,因为正常来讲,当数据为 0 的时候,就不必继续执行查询语句了。
The text was updated successfully, but these errors were encountered: