当前位置 : 主页 > 编程语言 > java >

Pager类

来源:互联网 收集:自由互联 发布时间:2022-07-20
import java.util.List; import java.util.Map; @SuppressWarnings("unchecked") public class Pager { // 排序方式 public enum OrderType{ asc, desc } public static final Integer MAX_PAGE_SIZE = 500;// 每页最大记录数限制 private Integ
import java.util.List;

import java.util.Map;



@SuppressWarnings("unchecked")

public class Pager {



// 排序方式

public enum OrderType{

asc, desc

}



public static final Integer MAX_PAGE_SIZE = 500;// 每页最大记录数限制


private Integer pageNumber = 1;// 当前页码

private Integer pageSize = 20;// 每页记录数

private Integer totalCount = 0;// 总记录数

private Integer pageCount = 0;// 总页数

private String property;// 查找属性名称

//private List<Map<String,String>> propertyMap;// 查找多重属性map[KEY:property_name,VALUE:property_value]

private Map<String,String> propertyMap;// 查找多重属性map[KEY:property_name,VALUE:property_value]

public static final String PROPERTY_NAME_KEY = "prop_name";// 多重属性名称

public static final String PROPERTY_KEYWORD_VALUE = "prop_keyword";// 多重属性关键词内容

private String keyword;// 查找关键字

private String orderBy = "createdate";// 排序字段

private OrderType orderType = OrderType.desc;// 排序方式

private List list;// 数据List


public Integer getPageNumber() {

return pageNumber;

}


public void setPageNumber(Integer pageNumber) {

if (pageNumber < 1) {

pageNumber = 1;

}

this.pageNumber = pageNumber;

}


public Integer getPageSize() {

return pageSize;

}


public void setPageSize(Integer pageSize) {

if (pageSize < 1) {

pageSize = 1;

} else if(pageSize > MAX_PAGE_SIZE) {

pageSize = MAX_PAGE_SIZE;

}

this.pageSize = pageSize;

}



public Integer getTotalCount() {

return totalCount;

}


public void setTotalCount(Integer totalCount) {

this.totalCount = totalCount;

}


public Integer getPageCount() {

pageCount = totalCount / pageSize;

if (totalCount % pageSize > 0) {

pageCount ++;

}

return pageCount;

}


public void setPageCount(Integer pageCount) {

this.pageCount = pageCount;

}


public String getProperty() {

return property;

}


public void setProperty(String property) {

this.property = property;

}


public String getKeyword() {

return keyword;

}


public void setKeyword(String keyword) {

this.keyword = keyword;

}



public String getOrderBy() {

return orderBy;

}


public void setOrderBy(String orderBy) {

this.orderBy = orderBy;

}



public OrderType getOrderType() {

return orderType;

}


public void setOrderType(OrderType orderType) {

this.orderType = orderType;

}


public List getList() {

return list;

}


public void setList(List list) {

this.list = list;

}


public Map<String, String> getPropertyMap() {

return propertyMap;

}


public void setPropertyMap(Map<String, String> propertyMap) {

this.propertyMap = propertyMap;

}




// public List<Map<String, String>> getPropertyMap() {

// return propertyMap;

// }

//

// public void setPropertyMap(List<Map<String, String>> propertyMap) {

// this.propertyMap = propertyMap;

// }




}
上一篇:BaseServiceImpl类
下一篇:没有了
网友评论