• 博客园logo
  • 会员
  • 周边
  • 众包
  • 新闻
  • 博问
  • 闪存
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
Y-wee
博客园    首页    新随笔    联系   管理     

layui分页查询页面实体类

layui分页查询页面实体类

/*
 * - Author: oneyuanma
 * - License: GNU Lesser General Public License (GPL)
 */
package com.gec.oasys.pojo;

/**
 * 分页参数分装
 *
 * @author 张世烩
 * @date   2017/7/21
 *
 *
 */
public class PageDto {
	private int page;//当前页
	private int limit;//每页显示总记录数
	private int start;//每页的开始记录数
    protected long totalCount = -1L;
    protected long totalSize = 0;

	public int getPage() {
		return page;
	}
	public void setPage(int page) {
		this.page = page;
	}

    public int getLimit() {
        return limit;
    }

    public void setLimit(int limit) {
        this.limit = limit;
    }

    public int getStart() {
		this.start = (page-1)*limit;
		return start;
	}
    public long getTotalCount() {
        return this.totalCount;
    }

    public void setTotalCount(long totalCount) {
        this.totalCount = totalCount;
    }
    public long getTotalSize() {
        if (this.totalCount < 0L) {
            return -1L;
        }

        long count = this.totalCount / this.limit;
        if (this.totalCount % this.limit > 0L) {
            count += 1L;
        }
        return count;
    }

}

记得快乐
posted @ 2020-11-12 16:29  Y-wee  阅读(176)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3