package com.sckw.core.model.enums;

/**
 * @author lfdc
 * @description 报表枚举
 * @date 2023-10-31 11:10:07
 */
public enum ReportTypeEnum {
    /**
     * 日
     */
    DAY(1, "1", "日报表", "每日0时"),

    /**
     * 周
     */
    WEEK(2, "2", "周报表", "每周一0时"),

    /**
     * 月
     */
    MONTH(3, "3", "月报表", "每月1号0时");

    private final String status;
    private final Integer code;
    private final String description;
    private final String value;

    public String getStatus() {
        return status;
    }
    public String getValue() {
        return value;
    }

    public Integer getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    ReportTypeEnum(Integer code, String status, String description,String value) {
        this.code = code;
        this.status = status;
        this.description = description;
        this.value = value;
    }

    public static String getDescription(Integer code) {
        for (ReportTypeEnum value : ReportTypeEnum.values()) {
            if (value.code == code) {
                return value.description;
            }
        }
        return null;
    }

    public static String getDescription(String status) {
        for (ReportTypeEnum value : ReportTypeEnum.values()) {
            if (value.status.equals(status)) {
                return value.description;
            }
        }
        return null;
    }

    public static String getValue(String status) {
        for (ReportTypeEnum value : ReportTypeEnum.values()) {
            if (value.status.equals(status)) {
                return value.getValue();
            }
        }
        return null;
    }
}
