package com.casic.missiles.modular.system.model;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 设备集中器关联表
 * </p>
 *
 * @author lwh123
 * @since 2019-05-29
 */
@TableName("bus_device_concentrator")
@Data
public class DeviceConcentrator extends Model<DeviceConcentrator> {

    private static final long serialVersionUID = 1L;

    /**
     * 设备ID
     */
    @TableField("DEVICE_ID")
    private Long deviceId;
    /**
     * 集中器ID
     */
    @TableField("CONCEN_ID")
    private Long concenId;
    /**
     * 状态
     */
    @TableField("STATUS")
    private Integer status;
    /**
     * 是否有效
     */
    @TableLogic
    @TableField("ACTIVE")
    private Integer active;
    /**
     * 时间戳
     */
    @TableField("TS")
    private Date ts;

    public DeviceConcentrator() {
    }

    public DeviceConcentrator(Long deviceId, Long concenId, Integer status, Integer active, Date ts) {
        this.deviceId = deviceId;
        this.concenId = concenId;
        this.status = status;
        this.active = active;
        this.ts = ts;
    }

    @Override
    protected Serializable pkVal() {
        return this.deviceId;
    }

    @Override
    public String toString() {
        return "DeviceConcentrator{" +
                "deviceId=" + deviceId +
                ", concenId=" + concenId +
                ", status=" + status +
                ", active=" + active +
                ", ts=" + ts +
                "}";
    }
}
