package com.willalp.device.domain;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.willalp.common.annotation.Excel;
import com.willalp.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;

/**
 * device对象 pns_device
 *
 * @author willalp
 * @date 2021-11-23
 */

@EqualsAndHashCode(callSuper = true)
@Data
@TableName("pns_device")
public class Device extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 平板设备ID
     */
    @TableId
    private String deviceId;

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

    /**
     * 所属机构ID
     */
    @Excel(name = "所属机构ID")
    private String deviceOrgId;

    /**
     * 所属用户
     */
    @Excel(name = "所属用户")
    private String deviceUseId;

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

    /**
     * 设备初始化码
     */
    @Excel(name = "设备初始化码")
    private String deviceInitCode;

    /**
     * 设备IP地址
     */
    @Excel(name = "设备IP地址")
    private String deviceIpAddr;

    /**
     * 设备地理位置
     */
    @Excel(name = "设备地理位置")
    private String deviceLocationAddr;

    /**
     * 设备状态
     */
    @Excel(name = "设备状态")
    private Integer deviceState;

    /**
     * 到期时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "到期时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date expirationDate;

    /**
     * 排序
     */
    @Excel(name = "排序")
    private Long sort;

    /**
     * 是否删除（0.未删除；1.已删除）
     */
    @TableLogic
    private Integer isDelete;

    @Excel(name = "位置编号")
    private String placeNumber;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("deviceId", getDeviceId())
                .append("deviceNo", getDeviceNo())
                .append("deviceOrgId", getDeviceOrgId())
                .append("deviceUseId", getDeviceUseId())
                .append("deviceName", getDeviceName())
                .append("deviceName", getDeviceInitCode())
                .append("deviceIpAddr", getDeviceIpAddr())
                .append("deviceLocationAddr", getDeviceLocationAddr())
                .append("deviceState", getDeviceState())
                .append("expirationDate", getExpirationDate())
                .append("sort", getSort())
                .append("isDelete", getIsDelete())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .append("placeNumber", getPlaceNumber())
                .toString();
    }
}
