package com.jiayue.ipfcst.common.data.entity;

import com.jiayue.ipfcst.common.data.constant.enums.EquipmentTypeEnum;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;

/**
 * 各个装备的属性值提取出来
 *
 * @author 修唯xiuwei
 * @version 3.0
 */
@Data
@Entity
public class EquipmentAttribute {

    /**
     * Id
     */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "myid")
    @GenericGenerator(name = "myid", strategy = "com.jiayue.ipfcst.common.data.entity.id.CustomIDGenerator")
    Integer id;

    /**
     * 属性的定义
     */
    @Column(length = 50)
    String explanation;


    /**
     * 属性所对应的的类的属性
     */
    @Column(length = 90)
    String fieldName;


    /**
     * 计量单位
     */
    @Column(length = 5)
    String measurementUnits;


    /**
     * Equipment type
     */
    @Column(length = 200)
    @Enumerated(EnumType.STRING)
    EquipmentTypeEnum equipmentType;

    /**
     * 场站标识
     */
    @Column
    private String stationCode;

    /**
     * 字段类型
     */
    @Column()
    @Enumerated(EnumType.STRING)
    private EquipmentAttributeTypeEnum equipmentAttributeTypeEnum;

    enum EquipmentAttributeTypeEnum{
        /**
         * INVARIANT 固定字段 不可修改的
         * SPARE 备用字段
         * CUSTOM 自定义字段
         */
         INVARIANT,SPARE,CUSTOM
    }



}
