package com.crm.rely.backend.core.constant;

/**
 * 薪资类型
 *
 * @author y
 * @create 2022/1/21
 */
public enum SalesSalaryType {


    BASIC_SALARY(1, "BASIC_SALARY"),
    VOLUME_COMMISSION(2, "VOLUME_COMMISSION"),
    KPI(3, "KPI");


    private final Integer code;
    private final String desc;

    SalesSalaryType(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static SalesSalaryType matchCode(Integer code) {
        for (SalesSalaryType type : SalesSalaryType.values()) {
            if (type.getCode() == code) {
                return type;
            }
        }
        return null;
    }


}
