查询分页不查询count

v1.4.1
Parker 4 years ago
parent 16144d346f
commit 5f2cd1e0d3

@ -239,6 +239,21 @@ public abstract class CrudServiceImpl<M extends BaseMapper<T>, T extends BaseEnt
return page;
}
@Override
public Page<T,E> findPageNotCount(Page<T,E> page) {
page.pageHelperBegin(false);
try{
List<T> list = this.findList(page.getQueryWrapper());
PageInfo<T> pageInfo = new PageInfo<>(list);
List<E> es = transformTs2Ms(pageInfo.getList());
page.instance(pageInfo, es);
} finally {
page.pageHelperEnd();
}
return page;
}
// ======================== 对象转化 ========================
/**

@ -192,6 +192,13 @@ public interface CrudServiceInterface<T extends BaseEntity,E extends ApiWrapper>
*/
Page<T,E> findPage(Page<T,E> page);
/**
* count
*
* @return Page<T>
*/
Page<T,E> findPageNotCount(Page<T,E> page);
}

@ -74,7 +74,14 @@ public class Page<T extends BaseEntity,E extends ApiWrapper> extends PageSeriali
*
*/
public void pageHelperBegin(){
PageHelper.startPage(this.pageNo,this.pageSize);
this.pageHelperBegin(true);
}
/**
* count
*/
public void pageHelperBegin(boolean countFlag){
PageHelper.startPage(this.pageNo,this.pageSize, countFlag);
}
/**

Loading…
Cancel
Save