|
|
|
@ -1,54 +1,98 @@
|
|
|
|
|
package com.utils;
|
|
|
|
|
|
|
|
|
|
public class JQPageInfo{
|
|
|
|
|
/**
|
|
|
|
|
* JQPageInfo 类用于封装分页查询所需的参数信息,常与前端使用 jQuery 相关插件(如 jqGrid)
|
|
|
|
|
* 进行分页交互时使用,方便在前后端之间传递分页和排序信息。
|
|
|
|
|
*/
|
|
|
|
|
public class JQPageInfo {
|
|
|
|
|
// 当前页码,通常从 1 开始,代表用户当前查看的页面
|
|
|
|
|
private Integer page;
|
|
|
|
|
|
|
|
|
|
// 每页显示的记录数量,用于控制每页展示的数据量
|
|
|
|
|
private Integer limit;
|
|
|
|
|
|
|
|
|
|
// 排序字段,指定按照数据库表中的哪个字段进行排序操作
|
|
|
|
|
private String sidx;
|
|
|
|
|
|
|
|
|
|
// 排序顺序,一般取值为 "asc"(升序)或 "desc"(降序)
|
|
|
|
|
private String order;
|
|
|
|
|
|
|
|
|
|
private Integer offset;
|
|
|
|
|
// 偏移量,用于数据库查询时定位从哪条记录开始获取数据,通常由 (page - 1) * limit 计算得出
|
|
|
|
|
private Integer offset;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取当前页码
|
|
|
|
|
* @return 当前页码
|
|
|
|
|
*/
|
|
|
|
|
public Integer getPage() {
|
|
|
|
|
return page;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 设置当前页码
|
|
|
|
|
* @param page 要设置的页码
|
|
|
|
|
*/
|
|
|
|
|
public void setPage(Integer page) {
|
|
|
|
|
this.page = page;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取每页显示的记录数量
|
|
|
|
|
* @return 每页显示的记录数量
|
|
|
|
|
*/
|
|
|
|
|
public Integer getLimit() {
|
|
|
|
|
return limit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 设置每页显示的记录数量
|
|
|
|
|
* @param limit 要设置的每页记录数
|
|
|
|
|
*/
|
|
|
|
|
public void setLimit(Integer limit) {
|
|
|
|
|
this.limit = limit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取排序字段
|
|
|
|
|
* @return 排序字段
|
|
|
|
|
*/
|
|
|
|
|
public String getSidx() {
|
|
|
|
|
return sidx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 设置排序字段
|
|
|
|
|
* @param sidx 要设置的排序字段
|
|
|
|
|
*/
|
|
|
|
|
public void setSidx(String sidx) {
|
|
|
|
|
this.sidx = sidx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取排序顺序
|
|
|
|
|
* @return 排序顺序("asc" 或 "desc")
|
|
|
|
|
*/
|
|
|
|
|
public String getOrder() {
|
|
|
|
|
return order;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 设置排序顺序
|
|
|
|
|
* @param order 要设置的排序顺序
|
|
|
|
|
*/
|
|
|
|
|
public void setOrder(String order) {
|
|
|
|
|
this.order = order;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取偏移量
|
|
|
|
|
* @return 偏移量
|
|
|
|
|
*/
|
|
|
|
|
public Integer getOffset() {
|
|
|
|
|
return offset;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 设置偏移量
|
|
|
|
|
* @param offset 要设置的偏移量
|
|
|
|
|
*/
|
|
|
|
|
public void setOffset(Integer offset) {
|
|
|
|
|
this.offset = offset;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|