zhangherong
2025-06-26 e403747d53db86c9de3986e9b281d35279446567
art: 枚举代码优化
已修改2个文件
41 ■■■■ 文件已修改
src/main/java/org/jeecg/common/system/query/MatchTypeEnum.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/common/system/query/QueryRuleEnum.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/common/system/query/MatchTypeEnum.java
@@ -1,5 +1,6 @@
package org.jeecg.common.system.query;
import lombok.Getter;
import org.jeecg.common.util.oConvertUtils;
/**
@@ -7,6 +8,7 @@
 *
 * @Author Sunjianlei
 */
@Getter
public enum MatchTypeEnum {
    /**查询链接规则 AND*/
@@ -20,23 +22,12 @@
        this.value = value;
    }
    public String getValue() {
        return value;
    }
    public static MatchTypeEnum getByValue(Object value) {
        if (oConvertUtils.isEmpty(value)) {
            return null;
        }
        return getByValue(value.toString());
    }
    public static MatchTypeEnum getByValue(String value) {
        if (oConvertUtils.isEmpty(value)) {
            return null;
        }
        for (MatchTypeEnum val : values()) {
            if (val.getValue().toLowerCase().equals(value.toLowerCase())) {
            if (val.getValue().equalsIgnoreCase(value)) {
                return val;
            }
        }
src/main/java/org/jeecg/common/system/query/QueryRuleEnum.java
@@ -1,5 +1,6 @@
package org.jeecg.common.system.query;
import lombok.Getter;
import org.jeecg.common.util.oConvertUtils;
/**
@@ -7,6 +8,7 @@
 * @Author Scott
 * @Date 2019年02月14日
 */
@Getter
public enum QueryRuleEnum {
    /**查询规则 大于*/
@@ -47,30 +49,6 @@
        this.condition = condition;
        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 String getCondition() {
        return condition;
    }
    public void setCondition(String condition) {
        this.condition = condition;
    }
    public static QueryRuleEnum getByValue(String value){
        if(oConvertUtils.isEmpty(value)) {