package thyyxxk.webserver.constants.sidicts;

import thyyxxk.webserver.utils.StringUtil;

/**
 * 参保区划（非常规）
 * */
public enum Admdvs {
    PROVINCE("439900", "省本级"),
    HEADCITY("430199", "市本级");
    
    private final String code;
    private final String name;

    Admdvs(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static Admdvs get(String code) {
        if (StringUtil.isBlank(code)) {
            return null;
        }
        for (Admdvs admdvs : Admdvs.values()) {
            if (code.trim().equals(admdvs.getCode())) {
                return admdvs;
            }
        }
        return null;
    }
}
