fix javadoc warning
This commit is contained in:
@@ -10,56 +10,115 @@ import java.util.LinkedHashMap;
|
||||
/**
|
||||
* 抽象页面查询参数
|
||||
*
|
||||
* @param <T> 查询示例类型
|
||||
* @author 夜雨
|
||||
* @version 2023-06-02 14:47
|
||||
*/
|
||||
public class Page<T> extends BasePage {
|
||||
|
||||
/** 精确匹配示例 */
|
||||
protected T equalsExample;
|
||||
|
||||
/** 模糊匹配示例 */
|
||||
protected T likesExample;
|
||||
|
||||
/** 排序字段映射 */
|
||||
protected LinkedHashMap<String, BaseMapper.OrderType> orderMap;
|
||||
|
||||
/**
|
||||
* 创建分页参数
|
||||
*/
|
||||
public Page() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建分页参数
|
||||
*
|
||||
* @param index 页码
|
||||
* @param size 每页数量
|
||||
*/
|
||||
public Page(int index, int size) {
|
||||
super(index, size);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取偏移量
|
||||
*
|
||||
* @return 偏移量
|
||||
*/
|
||||
public long getOffset() {
|
||||
return (long) index * size;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取限制数量
|
||||
*
|
||||
* @return 限制数量
|
||||
*/
|
||||
public long getLimit() {
|
||||
return size;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取精确匹配示例
|
||||
*
|
||||
* @return 精确匹配示例
|
||||
*/
|
||||
public T getEqualsExample() {
|
||||
return equalsExample;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置精确匹配示例
|
||||
*
|
||||
* @param equalsExample 精确匹配示例
|
||||
*/
|
||||
public void setEqualsExample(T equalsExample) {
|
||||
this.equalsExample = equalsExample;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模糊匹配示例
|
||||
*
|
||||
* @return 模糊匹配示例
|
||||
*/
|
||||
public T getLikesExample() {
|
||||
return likesExample;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置模糊匹配示例
|
||||
*
|
||||
* @param likesExample 模糊匹配示例
|
||||
*/
|
||||
public void setLikesExample(T likesExample) {
|
||||
this.likesExample = likesExample;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取排序映射
|
||||
*
|
||||
* @return 排序映射
|
||||
*/
|
||||
public LinkedHashMap<String, BaseMapper.OrderType> getOrderMap() {
|
||||
return orderMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置排序映射
|
||||
*
|
||||
* @param orderMap 排序映射
|
||||
*/
|
||||
public void setOrderMap(LinkedHashMap<String, BaseMapper.OrderType> orderMap) {
|
||||
this.orderMap = orderMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加排序字段
|
||||
*
|
||||
* @param field 字段名
|
||||
* @param orderType 排序方式
|
||||
*/
|
||||
public void addOrder(String field, BaseMapper.OrderType orderType) {
|
||||
orderMap = TimiJava.defaultIfNull(orderMap, new LinkedHashMap<>());
|
||||
orderMap.put(Text.camelCase2underscore(field), orderType);
|
||||
|
||||
Reference in New Issue
Block a user