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.*;
import java.io.Serializable;

/**
 * @Description: 安灯通知记录表
 * @Reference:
 * @Author: Crish
 * @CreateDate:2019-11-11-14:23
 * @Modify:
 **/
@Data
@Entity
@Table(name="ANDON_MESSAGE_RECORD")
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Api("通知记录")
public class AndonMessageRecord extends BaseBean implements Serializable {

    private static final long serialVersionUID = -5002185160195696080L;

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

    @Column(name = "ANDON_ORDER_NO")
    @ApiParam(value = "安灯队列编号")
    private String andonOrderNo;

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

    @Column(name = "STATUS_CODE")
    @AnnoOutputColumn(refClass = AndonEnumUtil.ANDON_ACTION_TAG.class,refForeignKey = "code",value = "description")
    @ApiParam(value = "安灯状态代码")
    private String statusCode;

    @Column(name = "RP_OBJECT_CODE")
    @ApiParam(value = "通知对象代码")
    private String rpObjectCode;

    @Transient
    @ApiParam(value = "通知对象名称")
    private String rpObjectName;

    @Column(name = "RP_CODE")
    @AnnoOutputColumn(refClass = AndonEnumUtil.NOTICE_MESSAGE_SEND_TYPE.class,refForeignKey = "value",value = "description")
    @ApiParam(value = "通知方式")
    private String rpCode;

    @Column(name = "RP_NAME")
    @AnnoOutputColumn(refClass = AndonEnumUtil.NOTICE_MESSAGE_SEND_TYPE.class,refForeignKey = "value",value = "description")
    @ApiParam(value = "通知方式名称")
    private String rpName;

    @Column(name = "RP_LEVEL")
    @ApiParam(value = "通知等级")
    private String rpLevel;

    @Column(name = "IS_SUCCEED")
    @ApiParam(value = "成功标识")
    private String isSucceed;

    @Column(name = "MEMO")
    @ApiParam(value = "备注")
    private String memo;

    @Lob
    @Column(name = "MESSAGE")
    @ApiParam(value = "广播内容")
    private String message;
}
