diff --git a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/base/service/impl/CrudServiceImpl.java b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/base/service/impl/CrudServiceImpl.java index 51c99ca..701c472 100644 --- a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/base/service/impl/CrudServiceImpl.java +++ b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/base/service/impl/CrudServiceImpl.java @@ -239,6 +239,21 @@ public abstract class CrudServiceImpl, T extends BaseEnt return page; } + @Override + public Page findPageNotCount(Page page) { + page.pageHelperBegin(false); + try{ + List list = this.findList(page.getQueryWrapper()); + PageInfo pageInfo = new PageInfo<>(list); + List es = transformTs2Ms(pageInfo.getList()); + page.instance(pageInfo, es); + } finally { + page.pageHelperEnd(); + } + return page; + } + + // ======================== 对象转化 ======================== /** diff --git a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/base/service/interfaces/CrudServiceInterface.java b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/base/service/interfaces/CrudServiceInterface.java index 4635e70..7be3ed6 100644 --- a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/base/service/interfaces/CrudServiceInterface.java +++ b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/base/service/interfaces/CrudServiceInterface.java @@ -192,6 +192,13 @@ public interface CrudServiceInterface */ Page findPage(Page page); + /** + * 查询分页数据 不查询 count + * + * @return Page + */ + Page findPageNotCount(Page page); + } diff --git a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/persistence/Page.java b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/persistence/Page.java index 399a5e6..14fcff8 100644 --- a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/persistence/Page.java +++ b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/persistence/Page.java @@ -74,7 +74,14 @@ public class Page 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); } /**