package com.neusoft.smart.pos.member.constants;

public enum MemberLevelConditionType {

    RECHARGE_BASED(0, "根据充值"),
    AND_OR_GATE(1, "与或门");

    private Integer code;

    private String value;

    MemberLevelConditionType(Integer code, String value) {
        this.code = code;
        this.value = value;
    }

    public Integer getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }

    public static MemberLevelConditionType getEnumByCode(String enumName, Integer code) {
        for (MemberLevelConditionType dictEnum : MemberLevelConditionType.values()) {
            if (dictEnum.name().startsWith(enumName) && code.equals(dictEnum.getCode())) {
                return dictEnum;
            }
        }
        return null;
    }
}
