package com.zy.asrs.entity;
|
|
import com.baomidou.mybatisplus.annotations.TableId;
|
import com.baomidou.mybatisplus.enums.IdType;
|
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableField;
|
|
import com.core.common.SpringUtils;
|
import com.zy.asrs.service.AreaService;
|
import com.zy.asrs.service.TagService;
|
import io.swagger.annotations.ApiModelProperty;
|
import lombok.Data;
|
import com.baomidou.mybatisplus.annotations.TableName;
|
import java.io.Serializable;
|
|
@Data
|
@TableName("man_area")
|
public class Area implements Serializable {
|
|
private static final long serialVersionUID = 1L;
|
|
/**
|
* ID
|
*/
|
@ApiModelProperty(value= "ID")
|
@TableId(value = "id", type = IdType.AUTO)
|
private Long id;
|
|
@ApiModelProperty(value= "")
|
@TableField("tag_id")
|
private Long tagId;
|
|
/**
|
* 库区id
|
*/
|
@ApiModelProperty(value= "库区id")
|
@TableField("area_id")
|
private String areaId;
|
|
/**
|
* 库区名称
|
*/
|
@ApiModelProperty(value= "库区名称")
|
@TableField("area_name")
|
private String areaName;
|
|
/**
|
* 库区备注
|
*/
|
@ApiModelProperty(value= "库区备注")
|
private String memo;
|
|
/**
|
* 备用字段
|
*/
|
@ApiModelProperty(value= "备用字段")
|
private String backup1;
|
|
/**
|
* 备用字段2
|
*/
|
@ApiModelProperty(value= "备用字段2")
|
private String backup2;
|
|
/**
|
* 备用字段3
|
*/
|
@ApiModelProperty(value= "备用字段3")
|
private String backup3;
|
|
public Area() {}
|
|
public Area(Long id,Long tagId,String areaId,String areaName,String memo,String backup1,String backup2,String backup3) {
|
this.id = id;
|
this.tagId = tagId;
|
this.areaId = areaId;
|
this.areaName = areaName;
|
this.memo = memo;
|
this.backup1 = backup1;
|
this.backup2 = backup2;
|
this.backup3 = backup3;
|
}
|
public String getAreaId$(){
|
AreaService service = SpringUtils.getBean(AreaService.class);
|
Area area = service.selectOne(new EntityWrapper<Area>().eq("area_id",areaId));
|
if (!Cools.isEmpty(area)){
|
return String.valueOf(area.getAreaName());
|
}
|
return null;
|
}
|
// Area area = new Area(
|
// null, // ID[非空]
|
// null, // [非空]
|
// null, // 库区id[非空]
|
// null, // 库区名称
|
// null, // 库区备注
|
// null, // 备用字段
|
// null, // 备用字段2
|
// null // 备用字段3
|
// );
|
|
|
}
|