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

import java.io.Serializable;

import java.util.Date;

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

/**
 * <p>
 * 设备闸井关联表
 * </p>
 *
 * @author lwh123
 * @since 2019-05-29
 */
@TableName("bus_device_well")
@Data
public class DeviceWell extends Model<DeviceWell> {

    private static final long serialVersionUID = 1L;

    /**
     * 设备主键
     */
    @TableField("DEVICE_ID")
    private Long deviceId;
    /**
     * 井主键
     */
    @TableField("WELL_ID")
    private Long wellId;
    /**
     * 时间戳
     */
    @TableField("TS")
    private Date ts;
    /**
     * 是否有效：1有效，0无效
     */
    @TableLogic
    @TableField("VALID")
    private String valid;

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

    public DeviceWell() {
    }

    public DeviceWell(Long deviceId, Long wellId, Date ts, String valid) {
        this.deviceId = deviceId;
        this.wellId = wellId;
        this.ts = ts;
        this.valid = valid;
    }

    @Override
    public String toString() {
        return "DeviceWell{" +
        "deviceId=" + deviceId +
        ", wellId=" + wellId +
        ", ts=" + ts +
        ", valid=" + valid +
        "}";
    }
}
