|
|
|
@ -4,47 +4,85 @@ import java.util.ArrayList;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* UmsRoleExample 类用于构建查询条件,支持动态添加查询条件和排序。
|
|
|
|
|
*/
|
|
|
|
|
public class UmsRoleExample {
|
|
|
|
|
protected String orderByClause;
|
|
|
|
|
protected String orderByClause; // 存储排序子句
|
|
|
|
|
|
|
|
|
|
protected boolean distinct;
|
|
|
|
|
protected boolean distinct; // 是否去重
|
|
|
|
|
|
|
|
|
|
protected List<Criteria> oredCriteria;
|
|
|
|
|
protected List<Criteria> oredCriteria; // 存储多个查询条件
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 构造函数,初始化oredCriteria为一个空的ArrayList。
|
|
|
|
|
*/
|
|
|
|
|
public UmsRoleExample() {
|
|
|
|
|
oredCriteria = new ArrayList<>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 设置排序子句。
|
|
|
|
|
* @param orderByClause 排序子句
|
|
|
|
|
*/
|
|
|
|
|
public void setOrderByClause(String orderByClause) {
|
|
|
|
|
this.orderByClause = orderByClause;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取排序子句。
|
|
|
|
|
* @return 排序子句
|
|
|
|
|
*/
|
|
|
|
|
public String getOrderByClause() {
|
|
|
|
|
return orderByClause;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 设置是否去重。
|
|
|
|
|
* @param distinct 是否去重
|
|
|
|
|
*/
|
|
|
|
|
public void setDistinct(boolean distinct) {
|
|
|
|
|
this.distinct = distinct;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取是否去重。
|
|
|
|
|
* @return 是否去重
|
|
|
|
|
*/
|
|
|
|
|
public boolean isDistinct() {
|
|
|
|
|
return distinct;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取所有查询条件。
|
|
|
|
|
* @return 查询条件列表
|
|
|
|
|
*/
|
|
|
|
|
public List<Criteria> getOredCriteria() {
|
|
|
|
|
return oredCriteria;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 添加一个新的查询条件到oredCriteria列表中。
|
|
|
|
|
* @param criteria 新的查询条件
|
|
|
|
|
*/
|
|
|
|
|
public void or(Criteria criteria) {
|
|
|
|
|
oredCriteria.add(criteria);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 创建一个新的Criteria对象并添加到oredCriteria列表中。
|
|
|
|
|
* @return 新创建的Criteria对象
|
|
|
|
|
*/
|
|
|
|
|
public Criteria or() {
|
|
|
|
|
Criteria criteria = createCriteriaInternal();
|
|
|
|
|
oredCriteria.add(criteria);
|
|
|
|
|
return criteria;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 创建一个Criteria对象,如果oredCriteria为空则添加到oredCriteria列表中。
|
|
|
|
|
* @return 新创建的Criteria对象
|
|
|
|
|
*/
|
|
|
|
|
public Criteria createCriteria() {
|
|
|
|
|
Criteria criteria = createCriteriaInternal();
|
|
|
|
|
if (oredCriteria.size() == 0) {
|
|
|
|
@ -53,11 +91,18 @@ public class UmsRoleExample {
|
|
|
|
|
return criteria;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 内部方法,用于创建一个新的Criteria对象。
|
|
|
|
|
* @return 新创建的Criteria对象
|
|
|
|
|
*/
|
|
|
|
|
protected Criteria createCriteriaInternal() {
|
|
|
|
|
Criteria criteria = new Criteria();
|
|
|
|
|
return criteria;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 清除所有查询条件、排序子句和去重标志。
|
|
|
|
|
*/
|
|
|
|
|
public void clear() {
|
|
|
|
|
oredCriteria.clear();
|
|
|
|
|
orderByClause = null;
|
|
|
|
@ -65,136 +110,164 @@ public class UmsRoleExample {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected abstract static class GeneratedCriteria {
|
|
|
|
|
// 存储查询条件的列表
|
|
|
|
|
protected List<Criterion> criteria;
|
|
|
|
|
|
|
|
|
|
// 构造函数,初始化criteria为一个空的ArrayList
|
|
|
|
|
protected GeneratedCriteria() {
|
|
|
|
|
super();
|
|
|
|
|
criteria = new ArrayList<>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 判断是否有查询条件
|
|
|
|
|
public boolean isValid() {
|
|
|
|
|
return criteria.size() > 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取所有的查询条件
|
|
|
|
|
public List<Criterion> getAllCriteria() {
|
|
|
|
|
return criteria;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取所有的查询条件(与getAllCriteria方法功能相同)
|
|
|
|
|
public List<Criterion> getCriteria() {
|
|
|
|
|
return criteria;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 添加一个简单的查询条件
|
|
|
|
|
protected void addCriterion(String condition) {
|
|
|
|
|
if (condition == null) {
|
|
|
|
|
throw new RuntimeException("Value for condition cannot be null");
|
|
|
|
|
throw new RuntimeException("Value for condition cannot be null"); // 如果条件为空,抛出异常
|
|
|
|
|
}
|
|
|
|
|
criteria.add(new Criterion(condition));
|
|
|
|
|
criteria.add(new Criterion(condition)); // 将条件添加到criteria列表中
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 添加一个带值的查询条件
|
|
|
|
|
protected void addCriterion(String condition, Object value, String property) {
|
|
|
|
|
if (value == null) {
|
|
|
|
|
throw new RuntimeException("Value for " + property + " cannot be null");
|
|
|
|
|
throw new RuntimeException("Value for " + property + " cannot be null"); // 如果值为空,抛出异常
|
|
|
|
|
}
|
|
|
|
|
criteria.add(new Criterion(condition, value));
|
|
|
|
|
criteria.add(new Criterion(condition, value)); // 将条件和值添加到criteria列表中
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 添加一个带两个值的查询条件(用于BETWEEN操作)
|
|
|
|
|
protected void addCriterion(String condition, Object value1, Object value2, String property) {
|
|
|
|
|
if (value1 == null || value2 == null) {
|
|
|
|
|
throw new RuntimeException("Between values for " + property + " cannot be null");
|
|
|
|
|
throw new RuntimeException("Between values for " + property + " cannot be null"); // 如果任意一个值为空,抛出异常
|
|
|
|
|
}
|
|
|
|
|
criteria.add(new Criterion(condition, value1, value2));
|
|
|
|
|
criteria.add(new Criterion(condition, value1, value2)); // 将条件和两个值添加到criteria列表中
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 添加id为空的查询条件
|
|
|
|
|
public Criteria andIdIsNull() {
|
|
|
|
|
addCriterion("id is null");
|
|
|
|
|
return (Criteria) this;
|
|
|
|
|
return (Criteria) this; // 返回当前对象以支持链式调用
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 添加id不为空的查询条件
|
|
|
|
|
public Criteria andIdIsNotNull() {
|
|
|
|
|
addCriterion("id is not null");
|
|
|
|
|
return (Criteria) this;
|
|
|
|
|
return (Criteria) this; // 返回当前对象以支持链式调用
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 添加id等于指定值的查询条件
|
|
|
|
|
public Criteria andIdEqualTo(Long value) {
|
|
|
|
|
addCriterion("id =", value, "id");
|
|
|
|
|
return (Criteria) this;
|
|
|
|
|
return (Criteria) this; // 返回当前对象以支持链式调用
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 添加id不等于指定值的查询条件
|
|
|
|
|
public Criteria andIdNotEqualTo(Long value) {
|
|
|
|
|
addCriterion("id <>", value, "id");
|
|
|
|
|
return (Criteria) this;
|
|
|
|
|
return (Criteria) this; // 返回当前对象以支持链式调用
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 添加id大于指定值的查询条件
|
|
|
|
|
public Criteria andIdGreaterThan(Long value) {
|
|
|
|
|
addCriterion("id >", value, "id");
|
|
|
|
|
return (Criteria) this;
|
|
|
|
|
return (Criteria) this; // 返回当前对象以支持链式调用
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 添加一个条件,要求id大于或等于指定的值
|
|
|
|
|
public Criteria andIdGreaterThanOrEqualTo(Long value) {
|
|
|
|
|
addCriterion("id >=", value, "id");
|
|
|
|
|
return (Criteria) this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 添加一个条件,要求id小于指定的值
|
|
|
|
|
public Criteria andIdLessThan(Long value) {
|
|
|
|
|
addCriterion("id <", value, "id");
|
|
|
|
|
return (Criteria) this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 添加一个条件,要求id小于或等于指定的值
|
|
|
|
|
public Criteria andIdLessThanOrEqualTo(Long value) {
|
|
|
|
|
addCriterion("id <=", value, "id");
|
|
|
|
|
return (Criteria) this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 添加一个条件,要求id在指定的列表中
|
|
|
|
|
public Criteria andIdIn(List<Long> values) {
|
|
|
|
|
addCriterion("id in", values, "id");
|
|
|
|
|
return (Criteria) this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 添加一个条件,要求id不在指定的列表中
|
|
|
|
|
public Criteria andIdNotIn(List<Long> values) {
|
|
|
|
|
addCriterion("id not in", values, "id");
|
|
|
|
|
return (Criteria) this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 添加一个条件,要求id在指定的两个值之间(包含边界)
|
|
|
|
|
public Criteria andIdBetween(Long value1, Long value2) {
|
|
|
|
|
addCriterion("id between", value1, value2, "id");
|
|
|
|
|
return (Criteria) this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 添加一个条件,要求id不在指定的两个值之间(不包含边界)
|
|
|
|
|
public Criteria andIdNotBetween(Long value1, Long value2) {
|
|
|
|
|
addCriterion("id not between", value1, value2, "id");
|
|
|
|
|
return (Criteria) this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 添加一个条件,要求name字段为空
|
|
|
|
|
public Criteria andNameIsNull() {
|
|
|
|
|
addCriterion("name is null");
|
|
|
|
|
return (Criteria) this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 添加一个条件,要求name字段不为空
|
|
|
|
|
public Criteria andNameIsNotNull() {
|
|
|
|
|
addCriterion("name is not null");
|
|
|
|
|
return (Criteria) this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 添加一个条件,要求name字段等于指定的值
|
|
|
|
|
public Criteria andNameEqualTo(String value) {
|
|
|
|
|
addCriterion("name =", value, "name");
|
|
|
|
|
return (Criteria) this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 添加一个条件,要求name字段不等于指定的值
|
|
|
|
|
public Criteria andNameNotEqualTo(String value) {
|
|
|
|
|
addCriterion("name <>", value, "name");
|
|
|
|
|
return (Criteria) this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 添加一个条件,要求name字段大于指定的值
|
|
|
|
|
public Criteria andNameGreaterThan(String value) {
|
|
|
|
|
addCriterion("name >", value, "name");
|
|
|
|
|
return (Criteria) this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 添加一个条件,要求name字段大于或等于指定的值
|
|
|
|
|
public Criteria andNameGreaterThanOrEqualTo(String value) {
|
|
|
|
|
addCriterion("name >=", value, "name");
|
|
|
|
|
return (Criteria) this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Criteria andNameLessThan(String value) {
|
|
|
|
|
addCriterion("name <", value, "name");
|
|
|
|
|
return (Criteria) this;
|
|
|
|
|