package com.yeejoin.equipmanage.common.enums;

/**
 * @author keyong
 * @title: EquipmentStateEnum
 * <pre>
 * @description: TODO
 * </pre>
 * @date 2020/11/23 16:40
 */
public enum EquipmentStateEnum {

    PB("SHIELD", "屏蔽", "5", "shield"),
    HZGJ("FIREALARM", "火灾告警", "4", "fireAlarm"),
    GZ("BREAKDOWN", "故障", "3", "fault"),
    ZC("NORMAL", "正常", "2", "normal"),
    STOP("STOP", "挂起", "1", "stop");

    private String code;
    private String describe;
    private String status;
    private String bizProperty;

    EquipmentStateEnum(String code, String describe, String status, String bizProperty) {
        this.code=code;
        this.describe=describe;
        this.status=status;
        this.bizProperty=bizProperty;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public void setBizProperty(String bizProperty) {
        this.bizProperty = bizProperty;
    }

    public String getBizProperty() {
        return bizProperty;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getType() {
        return describe;
    }

    public void setType(String describe) {
        this.describe = describe;
    }

    public static String getEquipSate(String val) {
        for (EquipmentStateEnum eenum : EquipmentStateEnum.values()) {
            if (val.equals(eenum.getStatus())) {
                return eenum.getBizProperty();
            }
        }
        return null;
    }

    public static String getEquipDesc(String val) {
        for (EquipmentStateEnum eenum : EquipmentStateEnum.values()) {
            if (val.equals(eenum.getStatus())) {
                return eenum.getType();
            }
        }
        return null;
    }
}
