package cn.estsh.i3plus.ext.mes.pojo.bean;


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

import javax.persistence.*;
import java.io.Serializable;

/**
 * @Author: wangjie
 * @CreateDate: 2019/7/30 9:30 AM
 * @Description:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "MES_SHIFT_PROD_CENTER_RECORD", indexes = {
        @Index(columnList = "WORK_CENTER_CODE,SHIFT_CODE,WORK_TIME"),
        @Index(columnList = "WORK_CENTER_CODE"),
        @Index(columnList = "SHIFT_CODE"),
        @Index(columnList = "WORK_TIME"),
        @Index(columnList = "PROD_TYPE"),
        @Index(columnList = "CATEGORY_CODE")
})
@Api("停开机时间记录表")
public class MesShiftProdCenterRecord extends BaseBean implements Serializable {

    private static final long serialVersionUID = -2079811054569652967L;

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

    @Column(name = "SHIFT_CODE")
    @ApiParam("班次代码")
    private String shiftCode;

    @Column(name = "SHIFT_NAME")
    @ApiParam("班次名称")
    private String shiftName;

    @Column(name = "WORK_TIME")
    @ApiParam("作业时间")
    private String workTime;

    @Column(name = "PROD_CODE")
    @ApiParam("作业内容代码")
    private String prodCode;

    @Column(name = "PART_NO")
    @ApiParam("物料编码")
    private String partNo;

    @Column(name = "PART_NAME_RDD")
    @ApiParam("物料名称")
    private String partNameRdd;

    @Column(name = "START_TIME")
    @ApiParam("开始时间")
    private String startTime;

    @Column(name = "END_TIME")
    @ApiParam("结束时间")
    private String endTime;

    @Column(name = "PROD_NAME")
    @ApiParam("作业内容名称")
    private String prodName;

    @Column(name = "PROD_CATEGORY")
    @ApiParam("作业内容分类")
    private Integer prodCategory;

    @Column(name = "IS_PROD_TIME")
    @ApiParam("是否作业时间")
    private Integer isProdTime;

    @Column(name = "PROD_TYPE")
    @ApiParam("作业类型")
    private Integer prodType;

    @Column(
            name = "WORKER_QTY",
            columnDefinition = "decimal(18,8)"
    )
    @ColumnDefault("0")
    @ApiParam("作业人数")
    private Double workerQty;

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

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

    @Column(name = "ORDER_NO")
    @ApiParam("单号")
    private String orderNo;

    @Column(name = "CATEGORY_CODE")
    @ApiParam(value = "产品类别代码")
    public String categoryCode;

    @Column(name = "CAREER_CODE")
    @ApiParam("事业别")
    private String careerCode;

    @Column(name = "WORK_START_TIME")
    @ApiParam("作业开始时间")
    private String workStartTime;

    @Column(name = "WORK_END_TIME")
    @ApiParam("作业结束时间")
    private String workEndTime;

    @Column(name = "PART_CUT_COUNT")
    @ApiParam("机种切换次数")
    private Integer partCutCount;

    @Column(name="AT_HOME_NUM")
    @ApiParam(value = "在籍人数")
    @ColumnDefault("0")
    public Integer atHomeNum;

    @Column(name="ABSENTEEISM_NUM")
    @ApiParam(value = "缺勤人数")
    @ColumnDefault("0")
    public Integer absenteeismNum;

    @Column(name="OVERTIME_NUM")
    @ApiParam(value = "加班人数")
    @ColumnDefault("0")
    public Integer overtimeNum;

    @Column(name="NEW_WORK_NUM")
    @ApiParam(value = "新上班人数")
    @ColumnDefault("0")
    public Integer newWorkNum;

    @Column(name="QUIT_WORK_NUM")
    @ApiParam(value = "退职人数")
    @ColumnDefault("0")
    public Integer quitWorkNum;

    @Column(name = "MAIN_REASON")
    @ApiParam("主要原因")
    private String mainReason;

    @Column(name = "OWNER_DEPARTMENT")
    @ApiParam(value = "责任部门")
    private String ownerDepartment;

    @Column(name = "COUNTERMEASURE")
    @ApiParam("对策")
    private String countermeasure;

    @Column(name = "IMPL_DATE")
    @ApiParam("实施日")
    private String implDate;

    @Column(name = "DECISION_MAKER")
    @ApiParam("决策者")
    private String decisionMaker;

}
