Skip to content
New issue

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

请问支持这样传参分页么 #21

Closed
fumanduo2 opened this issue Feb 19, 2017 · 1 comment
Closed

请问支持这样传参分页么 #21

fumanduo2 opened this issue Feb 19, 2017 · 1 comment

Comments

@fumanduo2
Copy link

fumanduo2 commented Feb 19, 2017

public PageInfo<T> byPage(Integer pageNo, Integer pageSize, List<T> llist) 
{
        pageNo = pageNo == null ? 1 : pageNo;
        pageSize = pageSize == null ? 10 : pageSize;
        PageHelper.startPage(pageNo, pageSize);
        List<T> list = llist ;

        return new PageInfo<T>(list);
}
@abel533
Copy link
Collaborator

abel533 commented Feb 19, 2017

不能这么写,你这都有 list 了,已经执行过查询了,这时 PageHelper.startPage(pageNo, pageSize); 没用了,反而会导致后面的查询被分页。

这个方法必须紧挨在查询前面。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants