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


import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.enumutil.AndonEnumUtil;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
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 :生产设备
 * @Reference :
 * @Author : jack.jia
 * @CreateDate : 2019-04-02
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="MES_EQUIPMENT")
@Api("生产设备")
public class MesEquipment extends BaseBean implements Serializable {

    private static final long serialVersionUID = -4827453020382814751L;

    @Column(name="EQUIPMENT_CODE")
    @ApiParam("设备代码")
    private String equipmentCode;

    @Column(name="EQUIPMENT_NAME")
    @ApiParam("设备名称")
    private String equipmentName;

    @Column(name="STATUS")
    @ApiParam("设备状态")
    @AnnoOutputColumn(refClass = AndonEnumUtil.ANDON_EQUIPMENT_STATUS.class,refForeignKey = "value",value = "description")
    private String status;

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

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

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

    @Transient
    @ApiParam(value ="名称")
    @AnnoOutputColumn(hidden = true)
    private String name;

    public String getName(){
        return this.equipmentName;
    }
}
