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

import cn.estsh.i3plus.pojo.base.bean.BaseBean;
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:
 * @Author: jokelin
 * @Date: 2020/4/20 5:07 下午
 * @Modify:
 */
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_BOARD_EQU_DETAIL")
@Api("MES_看板设备明细")
public class MesBoardEquDetail extends BaseBean implements Serializable {

    private static final long serialVersionUID = 2187463105092165451L;

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

    @Column(name = "EQU_CODE")
    @ApiParam("设备代码")
    private String equCode;

    @Column(name = "EQU_NAME")
    @ApiParam("设备名称")
    private String equName;

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

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

    @Transient
    @ApiParam("设备状态")
    private Integer equStatus;

    @Transient
    @ApiParam("颜色")
    private String color;

    @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;
    }
}
