package cn.com.qmth.examcloud.core.questions.base.core.enums;

public enum CourseLevel {

    ZSB("专升本", "Z"),

    GQZ("高起专", "Q"),

    GQB("高起本", "S"),

    ALL("不限", "");

    /**
     * 名称
     */
    private String name;

    /**
     * 简写
     */
    private String abbreviate;

    private CourseLevel(String name, String abbreviate) {
        this.name = name;
        this.abbreviate = abbreviate;
    }

    public String getName() {
        return this.name;
    }

    public String getAbbreviate() {
        return abbreviate;
    }

    /**
     * 混合查询
     *
     * @param name
     * @return
     * @author WANGWEI
     */
    public static CourseLevel getCourseLevel(String name) {
        if (null == name) {
            return CourseLevel.ALL;
        }
        for (CourseLevel cur : CourseLevel.values()) {
            if (name.equals(cur.getName())) {
                return cur;
            }
            if (name.equals(cur.name())) {
                return cur;
            }
        }
        return CourseLevel.ALL;
    }
}
