package thyyxxk.webserver.entity.medicine;

public enum YpTypeNumberEnum {
    ONE(1,"29999","00000"),
    TWO(2,"39999","30000"),
    THREE(3,"49999","40000"),
    FOUR(4,"59999","50000");

    public final Integer code;
    public final String maxNum;
    public final String minNum;

    YpTypeNumberEnum(Integer code, String maxNum, String minNum){
        this.code=code;
        this.maxNum=maxNum;
        this.minNum=minNum;
    }

    /**
     * 根据编码查询对应的类型
     * @param code
     * @return
     */
    public static YpTypeNumberEnum getYpTypeNumberByCode(Integer code){
        YpTypeNumberEnum[] ypTypeNumberList = values();
        for (YpTypeNumberEnum ypTypeNumber : ypTypeNumberList){
            if(ypTypeNumber.code.equals(code)){
                return ypTypeNumber;
            }
        }
        return null;
    }

}
