package com.evobms.project.bms.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.evobms.framework.aspectj.lang.annotation.Excel;
import com.evobms.framework.web.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;

/**
 * BMS设备对象 bms_device
 * 
 * @author evobms
 * @date 2025-01-22
 */
@TableName("bms_device")
public class BmsDevice extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 设备ID */
    @TableId(type = IdType.AUTO)
    private Long deviceId;

    /** 设备编号 */
    @Excel(name = "设备编号")
    private String deviceCode;

    /** 设备名称 */
    @Excel(name = "设备名称")
    private String deviceName;

    /** 设备类型 */
    @Excel(name = "设备类型")
    private String deviceType;

    /** 设备状态（0正常 1停用） */
    @Excel(name = "设备状态", readConverterExp = "0=正常,1=停用")
    private String status;

    /** 电池容量(Ah) */
    @Excel(name = "电池容量")
    private Double batteryCapacity;

    /** 额定电压(V) */
    @Excel(name = "额定电压")
    private Double ratedVoltage;

    /** 当前电压(V) */
    private Double currentVoltage;

    /** 当前电流(A) */
    private Double currentCurrent;

    /** 剩余电量(%) */
    private Double remainingCapacity;

    /** 温度(℃) */
    private Double temperature;

    /** 最后通信时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date lastCommTime;

    /** 删除标志（0代表存在 2代表删除） */
    @TableLogic
    private String delFlag;

    /** 版本号（乐观锁） */
    @Version
    private Integer version;

    public void setDeviceId(Long deviceId) {
        this.deviceId = deviceId;
    }

    public Long getDeviceId() {
        return deviceId;
    }

    public void setDeviceCode(String deviceCode) {
        this.deviceCode = deviceCode;
    }

    public String getDeviceCode() {
        return deviceCode;
    }

    public void setDeviceName(String deviceName) {
        this.deviceName = deviceName;
    }

    public String getDeviceName() {
        return deviceName;
    }

    public void setDeviceType(String deviceType) {
        this.deviceType = deviceType;
    }

    public String getDeviceType() {
        return deviceType;
    }

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

    public String getStatus() {
        return status;
    }

    public void setBatteryCapacity(Double batteryCapacity) {
        this.batteryCapacity = batteryCapacity;
    }

    public Double getBatteryCapacity() {
        return batteryCapacity;
    }

    public void setRatedVoltage(Double ratedVoltage) {
        this.ratedVoltage = ratedVoltage;
    }

    public Double getRatedVoltage() {
        return ratedVoltage;
    }

    public void setCurrentVoltage(Double currentVoltage) {
        this.currentVoltage = currentVoltage;
    }

    public Double getCurrentVoltage() {
        return currentVoltage;
    }

    public void setCurrentCurrent(Double currentCurrent) {
        this.currentCurrent = currentCurrent;
    }

    public Double getCurrentCurrent() {
        return currentCurrent;
    }

    public void setRemainingCapacity(Double remainingCapacity) {
        this.remainingCapacity = remainingCapacity;
    }

    public Double getRemainingCapacity() {
        return remainingCapacity;
    }

    public void setTemperature(Double temperature) {
        this.temperature = temperature;
    }

    public Double getTemperature() {
        return temperature;
    }

    public void setLastCommTime(Date lastCommTime) {
        this.lastCommTime = lastCommTime;
    }

    public Date getLastCommTime() {
        return lastCommTime;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    public String getDelFlag() {
        return delFlag;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

    public Integer getVersion() {
        return version;
    }

    @Override
    public String toString() {
        return "BmsDevice{" +
                "deviceId=" + deviceId +
                ", deviceCode='" + deviceCode + '\'' +
                ", deviceName='" + deviceName + '\'' +
                ", deviceType='" + deviceType + '\'' +
                ", status='" + status + '\'' +
                ", batteryCapacity=" + batteryCapacity +
                ", ratedVoltage=" + ratedVoltage +
                ", currentVoltage=" + currentVoltage +
                ", currentCurrent=" + currentCurrent +
                ", remainingCapacity=" + remainingCapacity +
                ", temperature=" + temperature +
                ", lastCommTime=" + lastCommTime +
                ", delFlag='" + delFlag + '\'' +
                ", version=" + version +
                '}';
    }
}