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

/**
 * @Description:
 * @Author: wangjie
 * @Date: 2021/01/14 20:03
 * @Modify:
 */
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_OFFICIAL_LOSS_DETAIL_RECORD", indexes = {
        @Index(columnList = "SYSTEM_SYNC_STATUS"),
        @Index(columnList = "LOSS_DATE"),
        @Index(columnList = "LOSS_TYPE"),
        @Index(columnList = "LOSS_ITEM"),
        @Index(columnList = "PART_NO")
})
@Api("MES_仕损明细记录")
public class MesOfficialLossDetailRecord extends BaseBean implements Serializable {

    private static final long serialVersionUID = 4175258267731075350L;

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

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

    @Column(name = "CATEGORY_CODE")
    @ApiParam("产品别")
    private String categoryCode;

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

    @Column(name = "LOSS_DATE")
    @ApiParam(value = "仕损年月")
    public String lossDate;

    @Column(name = "LOSS_TYPE")
    @ApiParam(value = "仕损类型")
    public String lossType;

    @Column(name = "LOSS_ITEM")
    @ApiParam(value = "仕损明细")
    public String lossItem;

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

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

    @Column(
            name = "QTY",
            columnDefinition = "decimal(18,8)"
    )
    @ColumnDefault("0")
    @ApiParam("报废数量")
    private Double qty;

    @Column(
            name = "UNIT_PRICE",
            columnDefinition = "decimal(18,8)"
    )
    @ColumnDefault("0")
    @ApiParam("单价")
    private Double unitPrice;

    @Column(
            name = "AMOUNT",
            columnDefinition = "decimal(18,8)"
    )
    @ColumnDefault("0")
    @ApiParam("金额")
    private Double amount;

}
