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.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

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

/**
 * @Description: 分时产量统计表
 * @Reference:
 * @Author: wangjie
 * @CreateDate: 2023\02\10 09:45
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "MES_OUT_PUT_STATISTICS_TIME_SEGMENT", indexes = {
        @Index(columnList = "WORK_ORDER_NO,WORK_TIME,TIME_SEGMENT_CODE"),
        @Index(columnList = "WORK_ORDER_NO,WORK_TIME"),
        @Index(columnList = "WORK_ORDER_NO"),
        @Index(columnList = "WORK_CENTER_CODE"),
        @Index(columnList = "PART_NO"),
        @Index(columnList = "SHIFT_CODE"),
        @Index(columnList = "WORK_TIME"),
        @Index(columnList = "WORK_ORDER_TYPE")
})
@NoArgsConstructor
@AllArgsConstructor
@Api("分时产量统计表")
public class MesOutPutStatisticsTimeSegment extends BaseBean implements Serializable {

    private static final long serialVersionUID = 209085242707461269L;

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

    @Column(name = "WORK_CENTER_CODE")
    @ApiParam("产线代码")
    private String workCenterCode;

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

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

    @Column(name = "WORK_ORDER_NO")
    @ApiParam("生产工单号")
    private String workOrderNo;

    @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 = "QTY", columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam("产量")
    private Double qty;

    @Column(name = "PLAN_QTY", columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam("工单计划数量")
    private Double planQty;

    @Column(name = "WORK_ORDER_TYPE")
    @ApiParam("工单类型")
    private Integer workOrderType;

    @Column(name = "TIME_SEGMENT_CODE")
    @ApiParam("分时代码")
    private String timeSegmentCode;

    @Column(name = "TIME_SEGMENT_START_TIME")
    @ApiParam("分时开始时间")
    private String timeSegmentsStartTime;

    @Column(name = "TIME_SEGMENT_END_TIME")
    @ApiParam("分时结束时间")
    private String timeSegmentEndTime;

}
