package cn.estsh.i3plus.pojo.andon.bean;

import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.enumutil.AndonEnumUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;

/**
 * @Description : ANDON_事件原因
 * @Reference :
 * @Author : hansen.ke
 * @CreateDate : 2019-05-13 9:40
 * @Modify:
 **/
@Data
@Entity
@Table(name="ANDON_EVENT_CAUSE")
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Api(value = "ANDON_事件原因")
public class AndonEventCause extends BaseBean implements Serializable {

    private static final long serialVersionUID = 3051829000971794178L;

    @Column(name = "EC_CODE")
    @ApiParam(value = "事件原因代码")
    private String ecCode;

    @Column(name = "EC_NAME")
    @ApiParam(value = "事件原因描述")
    private String ecName;

    @Column(name = "PARENT_EC_CODE")
    @ApiParam(value = "父阶原因代码")
    @AnnoOutputColumn(hidden = true)
    private String parentEcCode;

//    @AnnoOutputColumn(refClass = AndonEnumUtil.ALARM_TYPE.class,refForeignKey = "value",value = "description")
    @Column(name = "ALARM_CODE")
    @ApiParam(value = "安灯类型")
    private String alarmCode;

    @Transient
    @ApiParam(value = "工作中心")
    @AnnoOutputColumn(hidden = true)
    private String workCenterCode;

    @Transient
    @ApiParam(value = "工作单元")
    @AnnoOutputColumn(hidden = true)
    private String workCellCode;
}
