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 javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

@JsonInclude(JsonInclude.Include.NON_NULL)
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "modevtype_point")
@ApiModel("监测设备类型属性点表")
public class ModevTypePoint {

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

    @NotNull(message = "监测设备类型表id不能为空")
    @ApiModelProperty("监测设备类型表id")
    @Column(name = "modevtype_id")
    private Integer modevtypeId;

    @NotBlank(message = "字段名不能为空")
    @ApiModelProperty("对应tablename表的字段名")
    @Column(name = "field")
    private String field;

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

    @ApiModelProperty("对应tablename表的字段类型")
    @Column(name = "type")
    private String type;

    @Transient
    private String unit;

    @Transient
    private List<Object> data;

}