/**
 * There are <a href="https://github.com/ketayao/keta-custom">keta-custom</a> code generation
 */
package com.sw.mes.yb.accessory.entity;

import com.sw.mes.base.factory.init.entity.Equipment;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

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

/**
* @Author
* @Description：
* @Date: Create in
* @Modified By:
*/
@Data
@Entity
@Table(name="zhxx_equipment_device_status")
@DynamicUpdate
@DynamicInsert
public class EquipmentDeviceStatus {
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

	/**
	 * 设备编号
	 */
    @Column(length=20)
    private String deviceNo;

	/**
	 * init_equipment.id 设备表id
	 */
    @ManyToOne(fetch = FetchType.LAZY)
    @NotFound(action = NotFoundAction.IGNORE)
    @JoinColumn(name = "equipment_id", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
    private Equipment equipment;

	/**
	 * 开启时间
	 */
    @Column(length=19)
	@Temporal(TemporalType.TIMESTAMP)
    private Date startTime;

	/**
	 * 结束时间
	 */
    @Column(length=19)
	@Temporal(TemporalType.TIMESTAMP)
    private Date endTime;

	/**
	 * 设备状态(1-抽真空 、2-停炉) 抽真空为开始、停炉为结束
	 */
    @Column(length=10)
    private Integer status;


	public EquipmentDeviceStatus() {
	}

	public EquipmentDeviceStatus(Long id) {
		this.id = id;
	}
}
