疯狂的狮子li
2021-12-27 dd37247e65374dd4ef7e8e8b9212d8f29023e301
ruoyi-common/src/main/java/com/ruoyi/common/core/page/PagePlus.java
@@ -10,8 +10,17 @@
import java.util.Collections;
import java.util.List;
/**
 * 分页 Page 增强对象
 *
 * @param <T> 数据库实体
 * @param <K> vo实体
 * @author Lion Li
 * @deprecated 3.6.0 删除 请使用 {@link com.ruoyi.common.core.domain.PageQuery#build()}
 */
@Data
@Accessors(chain = true)
@Deprecated
public class PagePlus<T,K> implements IPage<T> {
    /**
@@ -93,14 +102,6 @@
        this.isSearchCount = isSearchCount;
    }
    public boolean hasPrevious() {
        return this.current > 1L;
    }
    public boolean hasNext() {
        return this.current < this.getPages();
    }
    @Override
    public String countId() {
        return this.getCountId();
@@ -131,15 +132,27 @@
        return this.optimizeCountSql;
    }
    @Override
    public boolean isSearchCount() {
        return this.total >= 0L && this.isSearchCount;
    }
   @Override
   public long getPages() {
      // 解决 github issues/3208
      return IPage.super.getPages();
   }
    public PagePlus<T, K> setSearchCount(boolean isSearchCount) {
        this.isSearchCount = isSearchCount;
        return this;
    }
   public static <T,K> PagePlus<T,K> of(long current, long size) {
      return of(current, size, 0);
   }
   public static <T,K> PagePlus<T,K> of(long current, long size, long total) {
      return of(current, size, total, true);
   }
   public static <T,K> PagePlus<T,K> of(long current, long size, boolean searchCount) {
      return of(current, size, 0, searchCount);
   }
   public static <T,K> PagePlus<T,K> of(long current, long size, long total, boolean searchCount) {
      return new PagePlus<>(current, size, total, searchCount);
   }
}