# DbPmsReportDataRangeEnum.java

    package cloud.wconnect.workperformance.cons.database;

    import lombok.AllArgsConstructor;
    import lombok.Getter;
    import org.apache.commons.lang3.StringUtils;

    import java.util.Arrays;

    /**
     * Enum: Database PMS Report Data Range
     *
     * @author zc
     * @date 2025/12/02
     */
    @Getter
    @AllArgsConstructor
    public enum DbPmsReportDataRangeEnum {

        MANAGER_FLASH_LAST_1_DAY(DbNotifyTypeEnum.MISSING_REPORT_MANAGER_FLASH_LAST_1_DAY.getType(), "-1,-1"),
        MANAGER_FLASH_LAST_2_DAY(DbNotifyTypeEnum.MISSING_REPORT_MANAGER_FLASH_LAST_2_DAY.getType(), "-2,-2"),
        MARKET_CODE_STATISTICS_LAST_1_DAY(DbNotifyTypeEnum.MISSING_REPORT_MARKET_CODE_STATISTICS_LAST_1_DAY.getType(), "-1,-1"),
        MARKET_CODE_STATISTICS_LAST_2_DAY(DbNotifyTypeEnum.MISSING_REPORT_MARKET_CODE_STATISTICS_LAST_2_DAY.getType(), "-2,-2"),
        HF_LAST_2_DAY_TO_365_DAY(DbNotifyTypeEnum.MISSING_REPORT_HF_LAST_2_DAY_TO_365_DAY.getType(), "-2,365");

        /**
         * 报告分类
         */
        private final int type;
        /**
         * 报告数据范围
         */
        private final String dateRange;

        /**
         * Get date range
         *
         * @param type Report type
         * @return date range
         */
        public static String getDateRange(int type) {
            return Arrays.stream(DbPmsReportDataRangeEnum.values()).filter(value ->
                            value.getType() == type).findFirst().map(DbPmsReportDataRangeEnum::getDateRange)
                    .orElse(StringUtils.EMPTY);
        }
    }