package cn.estsh.i3plus.pojo.mes.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 org.springframework.data.annotation.Transient;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * @Description :mes系统业务动作
 * @Reference :
 * @Author : crish
 * @CreateDate : 2019-04-19
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_SHIFT")
@Api("班次信息")
public class MesShift extends BaseBean implements Serializable {
    private static final long serialVersionUID = 4001070186534674096L;

    @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 = "START_TIME")
    @ApiParam("开班时间")
    private String startTime;

    @Column(name = "END_TIME")
    @ApiParam("下班时间")
    private String endTime;

    @Column(name = "WORK_TIMES", columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam("作业时长")
    private Double workTimes;

    @Column(name = "SHIFT_SEQ")
    @ApiParam("班次顺序")
    private Integer shiftSeq;

    @Column(name = "AREA_CODE")
    @ApiParam("区域代码")
    private String areaCode;

    @Transient
    private String queryBeginTime;

    @Transient
    private String queryEndTime;

    public int getShiftSeqVal() {
        return this.shiftSeq == null ? 0 : this.shiftSeq;
    }

    public double getWorkTimesVal() {
        return this.workTimes == null ? 0.0d : this.workTimes;
    }
}
