QueryRuleEnum.java
1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package com.skua.common.util.superSearch;
import com.skua.core.util.ConvertUtils;
/**
* Query 规则 常量
*/
public enum QueryRuleEnum {
GT(">","大于"),
GE(">=","大于等于"),
LT("<","小于"),
LE("<=","小于等于"),
EQ("=","等于"),
NE("!=","不等于"),
IN("IN","包含"),
LIKE("LIKE","全模糊"),
LEFT_LIKE("LEFT_LIKE","左模糊"),
RIGHT_LIKE("RIGHT_LIKE","右模糊"),
SQL_RULES("EXTEND_SQL","自定义SQL片段");
private String value;
private String msg;
QueryRuleEnum(String value, String msg){
this.value = value;
this.msg = msg;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public static QueryRuleEnum getByValue(String value){
if(ConvertUtils.isEmpty(value)) {
return null;
}
for(QueryRuleEnum val :values()){
if (val.getValue().equals(value)){
return val;
}
}
return null;
}
}