committed by
Gitee
1 changed files with 83 additions and 81 deletions
@ -1,81 +1,83 @@ |
|||
package com.ruoyi.common.core.page; |
|||
|
|||
import com.ruoyi.common.utils.StringUtils; |
|||
|
|||
/** |
|||
* 分页数据 |
|||
* |
|||
* @author ruoyi |
|||
*/ |
|||
public class PageDomain |
|||
{ |
|||
/** 当前记录起始索引 */ |
|||
private Integer pageNum; |
|||
|
|||
/** 每页显示记录数 */ |
|||
private Integer pageSize; |
|||
|
|||
/** 排序列 */ |
|||
private String orderByColumn; |
|||
|
|||
/** 排序的方向desc或者asc */ |
|||
private String isAsc = "asc"; |
|||
|
|||
public String getOrderBy() |
|||
{ |
|||
if (StringUtils.isEmpty(orderByColumn)) |
|||
{ |
|||
return ""; |
|||
} |
|||
return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc; |
|||
} |
|||
|
|||
public Integer getPageNum() |
|||
{ |
|||
return pageNum; |
|||
} |
|||
|
|||
public void setPageNum(Integer pageNum) |
|||
{ |
|||
this.pageNum = pageNum; |
|||
} |
|||
|
|||
public Integer getPageSize() |
|||
{ |
|||
return pageSize; |
|||
} |
|||
|
|||
public void setPageSize(Integer pageSize) |
|||
{ |
|||
this.pageSize = pageSize; |
|||
} |
|||
|
|||
public String getOrderByColumn() |
|||
{ |
|||
return orderByColumn; |
|||
} |
|||
|
|||
public void setOrderByColumn(String orderByColumn) |
|||
{ |
|||
this.orderByColumn = orderByColumn; |
|||
} |
|||
|
|||
public String getIsAsc() |
|||
{ |
|||
return isAsc; |
|||
} |
|||
|
|||
public void setIsAsc(String isAsc) |
|||
{ |
|||
// 兼容前端排序类型
|
|||
if ("ascending".equals(isAsc)) |
|||
{ |
|||
isAsc = "asc"; |
|||
} |
|||
else if ("descending".equals(isAsc)) |
|||
{ |
|||
isAsc = "desc"; |
|||
} |
|||
this.isAsc = isAsc; |
|||
} |
|||
} |
|||
package com.ruoyi.common.core.page; |
|||
|
|||
import com.ruoyi.common.utils.StringUtils; |
|||
|
|||
/** |
|||
* 分页数据 |
|||
* |
|||
* @author ruoyi |
|||
*/ |
|||
public class PageDomain |
|||
{ |
|||
/** 当前记录起始索引 */ |
|||
private Integer pageNum; |
|||
|
|||
/** 每页显示记录数 */ |
|||
private Integer pageSize; |
|||
|
|||
/** 排序列 */ |
|||
private String orderByColumn; |
|||
|
|||
/** 排序的方向desc或者asc */ |
|||
private String isAsc = "asc"; |
|||
|
|||
public String getOrderBy() |
|||
{ |
|||
if (StringUtils.isEmpty(orderByColumn)) |
|||
{ |
|||
return ""; |
|||
} |
|||
return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc; |
|||
} |
|||
|
|||
public Integer getPageNum() |
|||
{ |
|||
return pageNum; |
|||
} |
|||
|
|||
public void setPageNum(Integer pageNum) |
|||
{ |
|||
this.pageNum = pageNum; |
|||
} |
|||
|
|||
public Integer getPageSize() |
|||
{ |
|||
return pageSize; |
|||
} |
|||
|
|||
public void setPageSize(Integer pageSize) |
|||
{ |
|||
this.pageSize = pageSize; |
|||
} |
|||
|
|||
public String getOrderByColumn() |
|||
{ |
|||
return orderByColumn; |
|||
} |
|||
|
|||
public void setOrderByColumn(String orderByColumn) |
|||
{ |
|||
this.orderByColumn = orderByColumn; |
|||
} |
|||
|
|||
public String getIsAsc() |
|||
{ |
|||
return isAsc; |
|||
} |
|||
|
|||
public void setIsAsc(String isAsc) |
|||
{ |
|||
if (StringUtils.isNotEmpty(isAsc)) { |
|||
// 兼容前端排序类型
|
|||
if ("ascending".equals(isAsc)) |
|||
{ |
|||
isAsc = "asc"; |
|||
} |
|||
else if ("descending".equals(isAsc)) |
|||
{ |
|||
isAsc = "desc"; |
|||
} |
|||
this.isAsc = isAsc; |
|||
} |
|||
} |
|||
} |
|||
|
Loading…
Reference in new issue