package com.mvc.constant;

/**
 * 查询用户类型
 */
public enum QueryUserType {
    INTERNAL ("0","内部用户"),
    OPRATIONER("1","运维单位"),
    CUSTOMER("2","客户"),
    ;

    private String flag;
    private String desc;

    QueryUserType(String flag, String desc) {
        this.flag = flag;
        this.desc = desc;
    }

    public String getFlag() {
        return flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static QueryUserType findDataViewTypeByflag(String flag){
        for (QueryUserType type: QueryUserType.values()) {
            if (type.flag.equals(flag)) {
                return  type;
            }
        }
        return null;
    }
}
