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_PROD_DATA_TO_STATISTICS_SHIFT_PROD", indexes = {
        @Index(columnList = "SYSTEM_SYNC_STATUS"),
        @Index(columnList = "DATA_KEY"),
        @Index(columnList = "DATA_TYPE"),
        @Index(columnList = "STATISTICS_DATE"),
        @Index(columnList = "WORK_CENTER_CODE"),
        @Index(columnList = "SHIFT_CODE"),
        @Index(columnList = "WORK_TIME"),
        @Index(columnList = "PROD_CATEGORY"),
        @Index(columnList = "PROD_TYPE"),
        @Index(columnList = "CAREER_CODE"),
        @Index(columnList = "CATEGORY_CODE")
})
@Api("生产数据停开机时间记录统计表")
public class MesProdDataToStatisticsShiftProd extends BaseBean implements Serializable {

    private static final long serialVersionUID = -2064121327449256970L;

    @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 = "DATA_KEY")
    @ApiParam("数据KEY")
    private String dataKey;

    @Column(name = "DATA_TYPE")
    @ApiParam("数据时间维度")
    private String dataType;

    @Column(name = "STATISTICS_DATE")
    @ApiParam(value = "统计日期")
    private String statisticsDate;

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

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

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

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

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

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

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

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

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

    @Column(name = "PERSONNEL_COST")
    @ApiParam("人件费")
    private String personnelCost;

    @Column(
            name = "STATISTICS",
            columnDefinition = "decimal(18,8)"
    )
    @ColumnDefault("0")
    @ApiParam("统计数")
    private Double statistics;

    @Column(name = "PID")
    @ApiParam(value = "PID")
    public String pid;

    @Column(name = "SYSTEM_SYNC_STATUS")
    @ColumnDefault("2")
    @ApiParam(value = "系统同步标志")
    public Integer systemSyncStatus = 2;

}
