package com.sundot.airport.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 质控分析报告时间范围类型枚举
 **/
@Getter
@AllArgsConstructor
public enum DateRangeQueryTypeEnum {
    YEAR("YEAR", "年份"),
    QUARTER("QUARTER", "季度"),
    MONTH("MONTH", "月份");

    private final String code;
    private final String desc;

    public static DateRangeQueryTypeEnum getByCode(String code) {
        for (DateRangeQueryTypeEnum itemEnum : values()) {
            if (itemEnum.getCode().equals(code)) {
                return itemEnum;
            }
        }
        return null;
    }

}
