package thyyxxk.webserver.constants;

import java.util.Arrays;
import java.util.List;

/**
 * 申请状态  0 未确认 1.已确认 2 已驳回 3 已入院
 */
public enum ZyReqEnum {
    UN_CONFIRM("0","未确认"),
    CONFIRMED("1","已确认"),
    REJECT("2","已驳回"),
    IN_HOSPITAL("3","已入院"),
    YI_ZF("4","已作废");

    public String code;
    public String name;

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

    /**
     * 根据编码查询对应的类型
     * @param code
     * @return
     */
    public static ZyReqEnum geteZyReqEnumByCode(String code){
        List<ZyReqEnum> classCodeEnums= Arrays.asList(values());
        for (ZyReqEnum classCode:classCodeEnums){
            if(classCode.code.equals(code)){
                return classCode;
            }
        }
        return null;
    }
}
