package cn.estsh.i3plus.pojo.base.enumutil;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Objects;

/**
 * @Description : 模块表单枚举类
 * @Reference :
 * @Author : alwaysfrin
 * @CreateDate : 2018-12-25 21:08
 * @Modify:
 **/
public class BlockFormEnumUtil {

    /**
     * 原数据类型
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum FORM_TABLE_TYPE {
        TABLE(1, "TABLE", "表"),
        VIEW(2, "VIEW", "视图"),
        PROCEDURE(3, "PROCEDURE", "存储过程");

        private int value;
        private String code;
        private String description;

        private FORM_TABLE_TYPE(int value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String valueOfCode(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].code;
                }
            }
            return tmp;
        }

        public static int codeOfValue(String code) {
            int tmp = 1;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.toLowerCase().equals(code.toLowerCase())) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }

        public static String valueOfDescription(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }

        public static FORM_TABLE_TYPE valueOf(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    return values()[i];
                }
            }
            return null;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    /**
     * 原数据状态
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum FORM_TABLE_STATUS {
        SYNCHRONOUS_UNDONE(1, "未完成", "未同步"),
        SYNCHRONOUS_COMPLETE(2, "已完成", "已同步");

        private int value;
        private String code;
        private String description;

        private FORM_TABLE_STATUS(int value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String valueOfCode(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].code;
                }
            }
            return tmp;
        }

        public static int codeOfValue(String code) {
            int tmp = 1;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code.toLowerCase())) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }

        public static String valueOfDescription(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }

        public static FORM_TABLE_STATUS valueOf(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    return values()[i];
                }
            }
            return null;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    /**
     * 行信息
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum TABLE_ROW_PICK {
        SINGLE(1, "single", "单选"),
        MULTI(2, "multi", "多选");

        private int value;
        private String code;
        private String description;

        private TABLE_ROW_PICK(int value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String valueOfCode(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].code;
                }
            }
            return tmp;
        }

        public static int codeOfValue(String code) {
            int tmp = 1;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }

        public static String valueOfDescription(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }

        public static TABLE_ROW_PICK valueOf(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    return values()[i];
                }
            }
            return null;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    /**
     * 显示行号信息
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum TABLE_ROW_NUMBER {
        SHOW(1, "show", "显示"),
        HIDE(2, "hide", "隐藏");

        private int value;
        private String code;
        private String description;

        private TABLE_ROW_NUMBER(int value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String valueOfCode(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].code;
                }
            }
            return tmp;
        }

        public static int codeOfValue(String code) {
            int tmp = 1;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }

        public static String valueOfDescription(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }

        public static TABLE_ROW_NUMBER valueOf(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    return values()[i];
                }
            }
            return null;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }
    /**
     * 元素属性显示状态信息
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum ELEMENT_SHOW_STATUS {
        ON(1, "ON", "开启"),
        OFF(2, "OFF", "关闭");

        private int value;
        private String code;
        private String description;

        private ELEMENT_SHOW_STATUS(int value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String valueOfCode(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].code;
                }
            }
            return tmp;
        }

        public static int codeOfValue(String code) {
            int tmp = 1;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }

        public static String valueOfDescription(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }

        public static ELEMENT_SHOW_STATUS valueOf(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    return values()[i];
                }
            }
            return null;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    /**
     * 元素新增信息
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum ELEMENT_ADD_STATUS {
        ON(1, "ON", "开启"),
        OFF(2, "OFF", "关闭");

        private int value;
        private String code;
        private String description;

        private ELEMENT_ADD_STATUS(int value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String valueOfCode(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].code;
                }
            }
            return tmp;
        }

        public static int codeOfValue(String code) {
            int tmp = 1;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }

        public static String valueOfDescription(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }

        public static ELEMENT_ADD_STATUS valueOf(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    return values()[i];
                }
            }
            return null;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    /**
     * 元素编辑信息
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum ELEMENT_EDIT_STATUS {
        ON(1, "ON", "开启"),
        OFF(2, "OFF", "关闭");

        private int value;
        private String code;
        private String description;

        private ELEMENT_EDIT_STATUS(int value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String valueOfCode(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].code;
                }
            }
            return tmp;
        }

        public static int codeOfValue(String code) {
            int tmp = 1;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }

        public static String valueOfDescription(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }

        public static ELEMENT_EDIT_STATUS valueOf(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    return values()[i];
                }
            }
            return null;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    /**
     * 元素类型
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum ELEMENT_TYPE {
        GRID(1, "TABLE", "表格"),
        TREE(2, "TREE", "树");

        private int value;
        private String code;
        private String description;

        private ELEMENT_TYPE(int value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String valueOfCode(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].code;
                }
            }
            return tmp;
        }

        public static int codeOfValue(String code) {
            int tmp = 1;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }

        public static String valueOfDescription(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }

        public static ELEMENT_TYPE valueOf(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    return values()[i];
                }
            }
            return null;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    /**
     * 元素删除信息
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum ELEMENT_DEL_STATUS {
        ON(1, "ON", "开启"),
        OFF(2, "OFF", "关闭");

        private int value;
        private String code;
        private String description;

        private ELEMENT_DEL_STATUS(int value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String valueOfCode(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].code;
                }
            }
            return tmp;
        }

        public static int codeOfValue(String code) {
            int tmp = 1;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }

        public static String valueOfDescription(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }

        public static ELEMENT_DEL_STATUS valueOf(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    return values()[i];
                }
            }
            return null;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    /**
     * 元素查询信息
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum ELEMENT_FIND_STATUS {
        ON(1, "ON", "开启"),
        OFF(2, "OFF", "关闭");

        private int value;
        private String code;
        private String description;

        private ELEMENT_FIND_STATUS(int value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String valueOfCode(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].code;
                }
            }
            return tmp;
        }

        public static int codeOfValue(String code) {
            int tmp = 1;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }

        public static String valueOfDescription(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }

        public static ELEMENT_FIND_STATUS valueOf(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    return values()[i];
                }
            }
            return null;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }


    /**
     * 元素软删状态
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum ELEMENT_DELETE_WEAK_STATUS {
        ON(1, "ON", "开启"),
        OFF(2, "OFF", "关闭");

        private int value;
        private String code;
        private String description;

        private ELEMENT_DELETE_WEAK_STATUS(int value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String valueOfCode(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].code;
                }
            }
            return tmp;
        }

        public static int codeOfValue(String code) {
            int tmp = 1;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }

        public static String valueOfDescription(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }

        public static ELEMENT_DELETE_WEAK_STATUS valueOf(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    return values()[i];
                }
            }
            return null;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }


    /**
     * 元素软删状态
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum ELEMENT_VALID_STATUS {
        ON(1, "ON", "开启"),
        OFF(2, "OFF", "关闭");

        private int value;
        private String code;
        private String description;

        private ELEMENT_VALID_STATUS(int value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String valueOfCode(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].code;
                }
            }
            return tmp;
        }

        public static int codeOfValue(String code) {
            int tmp = 1;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }

        public static String valueOfDescription(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }

        public static ELEMENT_VALID_STATUS valueOf(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    return values()[i];
                }
            }
            return null;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }



    /**
     * 元素组织隔离
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum ELEMENT_ORGANIZE_ISOLATION_STATUS {
        ON(1, "ON", "开启"),
        OFF(2, "OFF", "关闭");

        private int value;
        private String code;
        private String description;

        private ELEMENT_ORGANIZE_ISOLATION_STATUS(int value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String valueOfCode(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].code;
                }
            }
            return tmp;
        }

        public static int codeOfValue(String code) {
            int tmp = 1;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }

        public static String valueOfDescription(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }

        public static ELEMENT_ORGANIZE_ISOLATION_STATUS valueOf(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    return values()[i];
                }
            }
            return null;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }


    /**
     * 元素编辑信息
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum PROPERTY_EDIT_STATUS {
        ON(1, "ON", "开启"),
        OFF(2, "OFF", "关闭"),
        READONLY(3, "READONLY", "只读");

        private int value;
        private String code;
        private String description;

        private PROPERTY_EDIT_STATUS(int value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String valueOfCode(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].code;
                }
            }
            return tmp;
        }

        public static int codeOfValue(String code) {
            int tmp = 1;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }

        public static String valueOfDescription(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }

        public static PROPERTY_EDIT_STATUS valueOf(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    return values()[i];
                }
            }
            return null;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    /**
     * 属性字段排序规则
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum PROPERTY_ORDER_BY {
        ASC(1, "ASC", "升序"),
        DESC(2, "DESC", "降序");

        private int value;
        private String name;
        private String description;

        PROPERTY_ORDER_BY(int value, String name, String description) {
            this.value = value;
            this.name = name;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        public String getName() {
            return name;
        }

        public static String valueOf(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].getName();
                }
            }
            return tmp;
        }

        public static int descOf(String desc) {
            int tmp = 1;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].name.equals(desc)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }
    }

    /**
     * 虚拟类型信息
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum PROPERTY_VIRTUAL_OPERATE_TYPE {
        STRING_SPLICE(10, "SPLICE", "字符串拼接",String.class),
        NUM_ADD(20, "ADD", "加法计算",Double.class),
        NUM_LESS(30, "MIN", "减法计算",Double.class),
        NUM_MAKE(40, "MUL", "乘法计算",Double.class),
        NUM_DIVISION(50, "DIVISION", "除法计算",Double.class),
        JOIN_TABLE(60, "JOIN_TABLE", "连表查询",String.class);

        private int value;
        private String code;
        private String description;
        private Class clzFullName;

        private PROPERTY_VIRTUAL_OPERATE_TYPE(int value, String code, String description,Class clzFullName) {
            this.value = value;
            this.code = code;
            this.description = description;
            this.clzFullName = clzFullName;
        }

        public int getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public Class getClzFullName() {
            return clzFullName;
        }

        public void setClzFullName(Class clzFullName) {
            this.clzFullName = clzFullName;
        }

        public static String valueOfCode(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].code;
                }
            }
            return tmp;
        }

        public static int codeOfValue(String code) {
            int tmp = 1;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }

        public static String valueOfDescription(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }

        public static PROPERTY_VIRTUAL_OPERATE_TYPE valueOf(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    return values()[i];
                }
            }
            return null;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }

        public Object getPropertyVirtual(Object ... objs){
            if(this.getValue() == STRING_SPLICE.getValue()){
                return getPropertyVirtualString(objs);
            }else if(this.getValue() == NUM_ADD.getValue()){
                return getPropertyVirtualDoubleAdd(objs);
            }else if(this.getValue() == NUM_LESS.getValue()){
                return getPropertyVirtualDoubleLess(objs);
            }else if(this.getValue() == NUM_MAKE.getValue()){
                return getPropertyVirtualDoubleMake(objs);
            }else if(this.getValue() == NUM_DIVISION.getValue()){
                return getPropertyVirtualDoubleDivision(objs);
            }
            return objs;
        }

        private String getPropertyVirtualString(Object ... objs){
            if(objs != null && objs.length > 0){
                StringBuffer result = new StringBuffer();
                for (Object o : objs) {
                    result.append(o == null ? "" : o.toString());
                }
                return result.toString();
            }
            return null;
        }

        private Double getPropertyVirtualDoubleAdd(Object ... objs){
            if(objs != null && objs.length > 0){
                Double result = Double.valueOf(0);
                for (Object o : objs) {
                    try {
                        if(o != null){
                            result += Double.parseDouble(o.toString());
                        }
                    }catch (Exception e){
                        e.printStackTrace();
                    }
                }
                return result;
            }
            return null;
        }

        private Double getPropertyVirtualDoubleLess(Object ... objs){
            if(objs != null && objs.length > 0){
                Double result = Double.valueOf(0);
                for (Object o : objs) {
                    try {
                        if(o != null){
                            result -= Double.parseDouble(o.toString());
                        }
                    }catch (Exception e){
                        e.printStackTrace();
                    }
                }
                return result;
            }
            return null;
        }

        private Double getPropertyVirtualDoubleMake(Object ... objs){
            if(objs != null && objs.length > 0){
                Double result = Double.valueOf(0);
                for (Object o : objs) {
                    try {
                        if(o != null){
                            result *= Double.parseDouble(o.toString());
                        }
                    }catch (Exception e){
                        e.printStackTrace();
                    }
                }
                return result;
            }
            return null;
        }

        private Double getPropertyVirtualDoubleDivision(Object ... objs){
            if(objs != null && objs.length > 0){
                Double result = Double.valueOf(0);
                for (Object o : objs) {
                    try {
                        if(o != null){
                            result /= Double.parseDouble(o.toString());
                        }
                    }catch (Exception e){
                        e.printStackTrace();
                    }
                }
                return result;
            }
            return null;
        }
    }



    /**
     * 执行类型信息
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum EXECUTION_TYPE {
        SQL(10, "SQL", "SQL脚本"),
        CLASS_METHOD(20, "ClassMethod", "类方法"),
        SYSTEM_JAVA(30, "SystemClassMethod", "系统类方法"),
        SCRIPT(40, "Script", "脚本"),
        URL(50, "URL", "网址");

        private int value;
        private String code;
        private String description;

        private EXECUTION_TYPE(int value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String valueOfCode(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].code;
                }
            }
            return tmp;
        }

        public static int codeOfValue(String code) {
            int tmp = 1;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }

        public static String valueOfDescription(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }

        public static EXECUTION_TYPE valueOf(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    return values()[i];
                }
            }
            return null;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    /**
     * 拦截器类型信息
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum INTERCEPT_TYPE {
        ELEMENT_ADD(10, "ELEMENT_ADD", "元素新增"),
        ELEMENT_EDIT(20, "ELEMENT_EDIT", "元素修改"),
        ELEMENT_DEL(30, "ELEMENT_DEL", "元素删除"),
        ELEMENT_FIND(40, "ELEMENT_FIND", "元素查询"),
        CUSTOM_BUTTON(50, "CUSTOM_BUTTON", "自定义按钮");

        private int value;
        private String code;
        private String description;

        private INTERCEPT_TYPE(int value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String valueOfCode(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].code;
                }
            }
            return tmp;
        }

        public static int codeOfValue(String code) {
            int tmp = 1;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }

        public static String valueOfDescription(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }

        public static INTERCEPT_TYPE valueOf(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    return values()[i];
                }
            }
            return null;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    /**
     * 拦截器位置信息
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum INTERCEPT_POSITION {
        BEFORE_EXECUTION(10, "BEFORE", "执行前"),
        AFTER_SUCCESS(20, "AFTER_SUCCESS", "执行成功后"),
        AFTER_FAIL(30, "AFTER_FAIL", "执行失败后");

        private int value;
        private String code;
        private String description;

        private INTERCEPT_POSITION(int value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String valueOfCode(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].code;
                }
            }
            return tmp;
        }

        public static int codeOfValue(String code) {
            int tmp = 1;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }

        public static String valueOfDescription(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }

        public static INTERCEPT_POSITION valueOf(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    return values()[i];
                }
            }
            return null;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    /**
     * 拦截器业务结果处理信息
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum INTERCEPT_PROCESS_RESULT {
        CONTINUE_AFTER_SUCCESS(10, "CONTINUE_AFTER_SUCCESS", "成功后继续"),
        STOP_AFTER_SUCCESS(20, "STOP_AFTER_SUCCESS", "成功后停止"),
        CONTINUE_AFTER_FAIL(30, "CONTINUE_AFTER_FAIL", "失败后继续"),
        CONTINUE_AFTER_STOP(40, "CONTINUE_AFTER_STOP", "失败后停止");

        private int value;
        private String code;
        private String description;

        private INTERCEPT_PROCESS_RESULT(int value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String valueOfCode(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].code;
                }
            }
            return tmp;
        }

        public static int codeOfValue(String code) {
            int tmp = 1;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }

        public static String valueOfDescription(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }

        public static INTERCEPT_PROCESS_RESULT valueOf(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    return values()[i];
                }
            }
            return null;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    /**
     * 表单功能明细 触发信息
     * <per>
     * onclick      script     元素上发生鼠标点击时触发。
     * ondblclick   script     元素上发生鼠标双击时触发。
     * ondrag       script     元素被拖动时运行的脚本。
     * ondragend    script     在拖动操作末端运行的脚本。
     * ondragenter  script     当元素元素已被拖动到有效拖放区域时运行的脚本。
     * ondragleave  script     当元素离开有效拖放目标时运行的脚本。
     * ondragover   script     当元素在有效拖放目标上正在被拖动时运行的脚本。
     * ondragstart  script     在拖动操作开端运行的脚本。
     * ondrop       script     当被拖元素正在被拖放时运行的脚本。
     * onmousedown  script     当元素上按下鼠标按钮时触发。
     * onmousemove  script     当鼠标指针移动到元素上时触发。
     * onmouseout   script     当鼠标指针移出元素时触发。
     * onmouseover  script     当鼠标指针移动到元素上时触发。
     * onmouseup    script     当在元素上释放鼠标按钮时触发。
     * onmousewheel script     当鼠标滚轮正在被滚动时运行的脚本。
     * onscroll     script     当元素滚动条被滚动时运行的脚本。
     * </per>
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum TRIGGER_EVENT {
        CLICK(10, "CLICK", "单击");
//        DB_LCLICK(20, "DB_LCLICK", "双击"),
//        MOUSE_OUT(30, "MOUSE_OUT", "鼠标指针移出"),
//        MOUSE_OVER(40, "MOUSE_OVER", "鼠标指针移入");

        private int value;
        private String code;
        private String description;

        private TRIGGER_EVENT(int value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String valueOfCode(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].code;
                }
            }
            return tmp;
        }

        public static int codeOfValue(String code) {
            int tmp = 1;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }

        public static String valueOfDescription(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }

        public static TRIGGER_EVENT valueOf(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    return values()[i];
                }
            }
            return null;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    /**
     * 表单功能明细 触发效果信息
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum BUTTON_TRIGGER_EFFECT {
        DIALOG(10, "DIALOG", "弹出窗口"),
        NEW_WINDOW(20, "NEW_WINDOW", "新开窗口"),
        SQL(30, "SQL", "执行SQL"),
        CLASS_METHOD(40, "CLASS_METHOD", "执行类方法"),
        URL(50, "URL", "网址");

        private int value;
        private String name;
        private String description;

        BUTTON_TRIGGER_EFFECT(int value, String name, String description) {
            this.value = value;
            this.name = name;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        public String getName() {
            return name;
        }

        public static BUTTON_TRIGGER_EFFECT valueOf(int val) {
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    return values()[i];
                }
            }
            return null;
        }

        public static int descOf(String desc) {
            int tmp = 1;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].name.equals(desc)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }
    }

    /**
     * SQL 连接关系信息
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum SQL_REF_TYPE {
        GT(1, ">", "大于"),
        GT_EQUAL(2, ">=", "大于等于"),
        LT(3, "<", "小于等于"),
        LT_EQUAL(4, "<=", "小于等于"),
        EQUAL(5, "=", "等于"),
        EQUAL_NOT(6, "<>", "不等于");

        private int value;
        private String name;
        private String description;

        SQL_REF_TYPE(int value, String name, String description) {
            this.value = value;
            this.name = name;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        public String getName() {
            return name;
        }

        public static SQL_REF_TYPE valueOf(int val) {
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    return values()[i];
                }
            }
            return null;
        }

        public static int descOf(String desc) {
            int tmp = 1;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].name.equals(desc)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }
    }

    /**
     * 菜单类型
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum MENU_TYPE {
        FORM_METHOD(1, "FORM_METHOD", "表单功能"),
        OUTER_CHAIN(2, "OUTER_CHAIN", "外链");

        private int value;
        private String name;
        private String description;

        MENU_TYPE(int value, String name, String description) {
            this.value = value;
            this.name = name;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        public String getName() {
            return name;
        }

        public static MENU_TYPE valueOf(int val) {
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    return values()[i];
                }
            }
            return null;
        }

        public static int descOf(String desc) {
            int tmp = 1;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].name.equals(desc)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }
    }

    /**
     * 数据状态
     *  1 启用
     *  2 禁用
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum DATA_STATUS {
        ENABLE(1, "启用", "fa fa-success cell-fa fa-check"),
        DISABLE(2, "禁用", "fa fa-disabled cell-fa fa-times-circle");

        private int value;
        private String name;
        private String description;

        DATA_STATUS() {
        }

        DATA_STATUS(int value, String name, String description) {
            this.value = value;
            this.name = name;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        public String getName() {
            return name;
        }

        public static String valueOf(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].getName();
                }
            }
            return tmp;
        }

        public static int descOf(String desc) {
            int tmp = 1;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].name.equals(desc)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }
    }


    /**
     * 按钮位置类型
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum BUTTON_POSITION_TYPE {
        FORM_METHOD(1, "FORM_METHOD", "表单功能"),
        FORM_METHOD_DETAIL(2, "FORM_ETHOD_DETAIL", "表单功能明细");

        private int value;
        private String name;
        private String description;

        BUTTON_POSITION_TYPE(int value, String name, String description) {
            this.value = value;
            this.name = name;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        public String getName() {
            return name;
        }

        public static BUTTON_POSITION_TYPE valueOf(int val) {
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    return values()[i];
                }
            }
            return null;
        }

        public static int descOf(String desc) {
            int tmp = 1;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].name.equals(desc)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }
    }

    /**
     * 元素树方向
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum ELEMENT_TREE_DIRECTION {
        HORIZONTAL(1, "horizontal", "横向"),
        VERTICAL(2, "vertical", "竖向");

        private int value;
        private String code;
        private String description;

        private ELEMENT_TREE_DIRECTION (int value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String valueOfCode(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].code;
                }
            }
            return tmp;
        }

        public static int codeOfValue(String code) {
            int tmp = 1;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }

        public static String valueOfDescription(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }

        public static ELEMENT_TREE_DIRECTION  valueOf(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    return values()[i];
                }
            }
            return null;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum DATA_SOURCE_STATUS {
        CONN_SUCCESS(10, "连接成功", "连接成功"),
        CONN_FAILURE(20, "连接失败", "连接失败");
//        TIME_OUT(30, "连接超时", "连接超时"),
//        AUTH_ERROR(40, "账号密码错误", "账号密码错误");

        private int value;
        private String code;
        private String description;

        private DATA_SOURCE_STATUS (int value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }



        public static String valueOfCode(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].code;
                }
            }
            return tmp;
        }

        public static int codeOfValue(String code) {
            int tmp = 1;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }

        public static String valueOfDescription(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }

        public static DATA_SOURCE_STATUS valueOf(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    return values()[i];
                }
            }
            return null;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    /**
     * 元素约束类型枚举
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum ELEMENT_CONSTRAINT_TYPE {
        UNIQUE(10,  "唯一约束");
        // 后续扩展联合主键
//        PRIMARY_KEY(20,  "主键约束")

        private int value;
        private String description;

        private ELEMENT_CONSTRAINT_TYPE (int value, String description) {
            this.value = value;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }


        public static String valueOfDescription(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }

        public static ELEMENT_CONSTRAINT_TYPE valueOf(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    return values()[i];
                }
            }
            return null;
        }
    }

    /**
     * 操作触发来源
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum FORM_TRIGGER_SOURCE {
        INTERCEPTOR(10,  "拦截器"),
        BUTTON(20,  "按钮");

        private int value;
        private String description;

        private FORM_TRIGGER_SOURCE (int value, String description) {
            this.value = value;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }


        public static String valueOfDescription(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }

        public static FORM_TRIGGER_SOURCE valueOf(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    return values()[i];
                }
            }
            return null;
        }
    }

    /**
     * 存储过程列类型
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum PROCEDURE_COL_TYPE {
        IN_PARAM(1,  "入参"),
        INOUT_PARAM(2,  "出入参"),
//        ?(3,  "按钮"),
        OUT_PARAM(4,  "出参"),
        RETURN_PARAM(5,  "返回值");

        private int value;
        private String description;

        private PROCEDURE_COL_TYPE (int value, String description) {
            this.value = value;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }


        public static String valueOfDescription(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }

        public static PROCEDURE_COL_TYPE valueOf(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    return values()[i];
                }
            }
            return null;
        }
    }

    /**
     * 对象原始属性类型
     * TABLE_COL（10）：表格列-表，视图与存储过程查询结果的显示列
     * PROCEDURE_IN_PARAM（20）：入参-存储过程的入参
     * PROCEDURE_INOUT_PARAM（30）：入参-存储过程的出入参（sqlserver没有出参，都算出入参）
     * PROCEDURE_OUT_PARAM（40）：入参-存储过程，函数的出参
     * PROCEDURE_RETURN（50）：入参-存储过程，函数的返回值（mysql存储过程没有返回值，sqlserver有）
     *
     */
    public enum ORIGIN_PROPERTY_TYPE {
        NORMAL_PROPERTY(10,  "正常属性"),
        PROCEDURE_IN_PARAM(20,  "入参"),
        PROCEDURE_INOUT_PARAM(30,  "出入参"),
        PROCEDURE_OUT_PARAM(40,  "出参"),
        PROCEDURE_RETURN(50,  "返回值");

        private final int value;
        private final String description;

        private ORIGIN_PROPERTY_TYPE (int value, String description) {
            this.value = value;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        public static String valueOfDescription(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }

        public static ORIGIN_PROPERTY_TYPE valueOf(int val) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value == val) {
                    return values()[i];
                }
            }
            return null;
        }

        public static ORIGIN_PROPERTY_TYPE procColTypeValOf(int procColTypeVal) {
            ORIGIN_PROPERTY_TYPE result = NORMAL_PROPERTY;
            switch (Objects.requireNonNull(PROCEDURE_COL_TYPE.valueOf(procColTypeVal))){
                case IN_PARAM:
                    result = PROCEDURE_IN_PARAM;
                    break;
                case INOUT_PARAM:
                    result = PROCEDURE_INOUT_PARAM;
                    break;
                case OUT_PARAM:
                    result = PROCEDURE_OUT_PARAM;
                    break;
                case RETURN_PARAM:
                    result = PROCEDURE_RETURN;
                    break;
            }
            return result;
        }
    }
}
