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

import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
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;
import java.util.List;

/**
 * @Description :工作单元
 * @Reference :
 * @Author : jack.jia
 * @CreateDate : 2019-04-02
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_WORK_CELL")
@Api("工作单元")
public class MesWorkCell extends BaseBean implements Serializable {

    private static final long serialVersionUID = -5981041286446162921L;

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

    @Column(name = "WORK_CELL_NAME")
    @ApiParam("工作单元名称")
    private String workCellName;

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

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

    @Transient
    @ApiParam(value ="工作单元中安灯队列标识")
    private String workCellSignal;

    @Transient
    @ApiParam(value ="子集列表")
    @AnnoOutputColumn(hidden = true)
    private List<MesEquipment> childTreeList;

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

    @Column(name = "WORK_CELL_TYPE")
    @ApiParam("工位类型")
    private String workCellType;

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