package com.sundot.airport.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 质控分析报告比较枚举
 **/
@Getter
@AllArgsConstructor
public enum CompareTypeEnum {
    YEAR_ON_YEAR("YEAR_ON_YEAR", "同比"),
    RING_RATIO("RING_RATIO", "环比"),
    CURRENT("CURRENT", "当期");

    private final String code;
    private final String desc;

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

}
