package cn.iocoder.yudao.module.mes.controller.admin.deviceledger.enums;


import lombok.AllArgsConstructor;
import lombok.Getter;


@Getter
@AllArgsConstructor
public enum DeviceLedgerStatusEnum {
    NORMAL(0, "正常"),
    DISABLED(1, "停用"),
    MAINTENANCE(2, "维修"),
    SCRAP(3, "报废");

    private final Integer code;
    private final String description;

    public static DeviceLedgerStatusEnum getByCode(Integer code) {
        for (DeviceLedgerStatusEnum status : values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return null;
    }
}