package com.sw.mes.yb.pc.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
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.*;

@Entity
@Data
@DynamicUpdate
@DynamicInsert
@Table(name="zhxx_operate_crucible_check_data_item")
public class CrucibleCheckDataItem {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /** 坩埚点检项ID **/
    @JsonIgnore
    @ManyToOne(fetch = FetchType.LAZY)
    @NotFound(action = NotFoundAction.IGNORE)
    @JoinColumn(name = "checkItem_id", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
    private CrucibleCheckItem checkItem;

    /** 坩埚点检ID **/
    @JsonIgnore
    @ManyToOne(fetch = FetchType.LAZY)
    @NotFound(action = NotFoundAction.IGNORE)
    @JoinColumn(name = "checkData_id", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
    private CrucibleCheckData checkData;

    /**
     * 点检结果 1无 2有
     */
    @Column(length = 10)
    private String checkResult;

    /**
     * 确认结果 1可用 2不可用
     */
    @Column(length = 10)
    private String confirmResult;

    /**
     * 备注
     */
    @Column
    private String remark;
}
