package cn.com.goldenwater.dcproj.util; import cn.com.goldenwater.core.param.BaseParam; import io.swagger.annotations.ApiParam; /** * Created by guangyyh on 2018/8/28. */ public class SystemPageParam extends BaseParam { // 页码 @ApiParam(name = "pageNum", value = "页码", defaultValue = "1") private int pageNum = 1; // 每页记录数 @ApiParam(name = "pageSize", value = "每页记录数", defaultValue = "10") private int pageSize = 10; // 排序语句(例如:id desc, create_time desc) @ApiParam(name = "orderBy", value = "排序语句(例如:id desc, create_time desc)") private String orderBy; // 是否包含分页信息(对标PageHelper的count属性,如果为true则返回对象中的data为PageInfo对象,如果为false则是数据数组[]) @ApiParam(name = "count", value = "是否查询总数(默认不)", defaultValue = "false") private boolean count = false; // 上页最后一条记录标识 @ApiParam(name = "offset", value = "偏移量:上页最后一条记录标识") private String offset; private int from; private int to; private String province; private String orgId; public String getOrgId() { return orgId; } public void setOrgId(String orgId) { this.orgId = orgId; } public String getProvince() { return province; } public void setProvince(String province) { this.province = province; } public int getPageNum() { return pageNum; } public void setPageNum(int pageNum) { this.pageNum = pageNum; } public int getPageSize() { return pageSize; } public void setPageSize(int pageSize) { this.pageSize = pageSize; } public String getOrderBy() { return orderBy; } public void setOrderBy(String orderBy) { this.orderBy = orderBy; } public boolean getCount() { return count; } public void setCount(boolean containPageInfo) { this.count = count; } public String getOffset() { return offset; } public void setOffset(String offset) { this.offset = offset; } public int getFrom() { if (pageNum > 0 && pageSize > 0) { from = (pageNum - 1) * pageSize; } else { from = 0; } return from; } public void setFrom(int from) { this.from = from; } public int getTo() { if (pageNum > 0 && pageSize > 0) { to = pageNum * pageSize; } else { to = 0; } return to; } public void setTo(int to) { this.to = to; } }