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.Index;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * @Description : 安灯停线配置数据
 * @Reference :
 * @Author : silliter.yuan
 * @CreateDate : 2019-05-29 17:16
 * @Modify:
 **/
@Data
@Entity
@Table(name="ANDON_HALT_CFG", indexes = {
        @Index(columnList = "WORK_CENTER_CODE", name = "ANDON_INDEX_WORK_CENTER_CODE"),
        @Index(columnList = "WORK_CELL_CODE", name = "ANDON_INDEX_WORK_CELL_CODE"),
        @Index(columnList = "ORGANIZE_CODE", name = "ANDON_INDEX_ORGANIZE_CODE"),
        @Index(columnList = "ALARM_CODE", name = "ANDON_INDEX_ALARM_CODE")
})
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Api("安灯队列")
public class AndonHaltCfg extends BaseBean implements Serializable {

    private static final long serialVersionUID = 6209233767460121461L;

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

    @Column(name = "WORK_CENTER_CODE")
    @ApiParam(value = "工作中心代码")
    private String workCenterCode;

    @Column(name = "WORK_CENTER_NAME_RDD")
    @ApiParam(value = "工作中心名称")
    private String workCenterNameRdd;

    @Column(name = "WORK_CELL_NAME_RDD")
    @ApiParam(value = "工作单元名称")
    private String workCellNameRdd;

    @Column(name = "WORK_CELL_CODE")
    @ApiParam(value = "工作单元代码")
    private String workCellCode;
}
