package cn.hnthyy.thmz.enums;

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

/**
 * 检验检查类型 2 - 检验  3 --检查
 */
public enum ReqTypeEnum {
    JIAN_YAN("2","检验"),
    JIAN_CHA("3","检查");
    public String code;
    public String name;

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

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