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

import cn.estsh.i3plus.pojo.base.annotation.DynamicField;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import com.fasterxml.jackson.annotation.JsonProperty;
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.Table;
import javax.persistence.Transient;
import java.io.Serializable;

/**
 * @Description : MES_看板工位信息
 * @Reference :
 * @Author : amy
 * @CreateDate : 2018-11-07 14:21
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="MES_BOARD_WORK_CELL")
@Api("MES_看板工位信息")
public class MesBoardWorkCell extends BaseBean implements Serializable {
    private static final long serialVersionUID = 6251886604848913685L;

    @Column(name = "BOARD_CODE")
    @ApiParam("看板代码")
    private String boardCode;

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

    @Column(name = "WORK_CELL_CODE")
    @ApiParam("工作单元代码")
    private String workCellCode;

    @Column(name = "X_AXES", columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam("横坐标")
    private Double xAxes = 0d;

    @Column(name = "Y_AXES", columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam("纵坐标")
    private Double yAxes = 0d;

    @Column(name = "WORK_CELL_IP")
    @ApiParam("工位IP")
    private String workCellIp;

    @Transient
    @ApiParam("看板工位状态")
    private Boolean boardWorkCellStatus;

    @JsonProperty("xAxes")
    public Double getxAxes() {
        return xAxes;
    }

    public void setxAxes(Double xAxes) {
        this.xAxes = xAxes;
    }

    @JsonProperty("yAxes")
    public Double getyAxes() {
        return yAxes;
    }

    public void setyAxes(Double yAxes) {
        this.yAxes = yAxes;
    }

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

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