package com.xydl.cac.entity;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.util.List;

@JsonInclude(JsonInclude.Include.NON_NULL)
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "n_point")
@ApiModel("装置点表")
public class NPoint {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Integer id;

    @ApiModelProperty("sensor表的id")
    @Column(name = "sensor_id")
    private Integer sensorId;

    @ApiModelProperty("对应tablename表的字段名")
    @Column(name = "field")
    private String field;

    @ApiModelProperty("对应tablename表的字段名称描述")
    @Column(name = "field_desc")
    private String fieldDesc;

    @ApiModelProperty("对应的点位编号")
    @Column(name = "point_id")
    private Integer pointId;

    @ApiModelProperty("点位类型")
    @Column(name = "type")
    private Integer type;

    @Transient
    private int row;
    @Transient
    private String unit;

    @Transient
    private List<Object> data;

    @Transient
    N103Point n103Point;

}