package com.nanometer.smartlab.entity; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.nanometer.smartlab.entity.enumtype.ValidFlag; import lombok.Getter; import lombok.Setter; import java.io.Serializable; import java.sql.Timestamp; import java.util.*; import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL; /** * Created by johnny on 17/11/23. */ @Getter @Setter @SuppressWarnings("serial") @JsonInclude(NON_NULL) @JsonIgnoreProperties(value = {"handler"}) public class SysLaboratoryContainer implements Serializable { private Long id; private Long laboratoryId; private Long type; private String containerCode; private String infoCode; private String name; private Long structure; private Timestamp createTime; private Timestamp updateTime; private ValidFlag validFlag; private Long characterLeft; private Long characterRight; private String controllerCode; private Double temp; private Integer humidity; private Double voc1; private String flag; private String project; //非数据库字段 private String laboratoryName; private String laboratoryType; private String controllerName; private List projects; public List getProjects() { if (projects == null && project != null){ this.projects = Arrays.asList(this.project.split(",")); } return projects; } public String getProject() { if (this.project == null){ this.project = ""; if (projects != null && projects.size() > 0) { projects.forEach(pro->{ this.project += ","; this.project += pro; }); this.project = this.project.substring(1); } } return project; } }