package org.jeecg.modules.system.entity;
|
|
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
import lombok.Data;
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
import org.springframework.format.annotation.DateTimeFormat;
|
|
import java.io.Serializable;
|
import java.util.ArrayList;
|
import java.util.List;
|
|
/**
|
* @Description: 分类字典
|
* @Author: jeecg-boot
|
* @Date: 2019-05-29
|
* @Version: V1.0
|
*/
|
@Data
|
@TableName("sys_category")
|
public class SysCategory implements Serializable {
|
private static final long serialVersionUID = 1L;
|
|
/**
|
* 主键
|
*/
|
@TableId(type = IdType.ASSIGN_ID)
|
private String id;
|
/**
|
* 父级节点
|
*/
|
private String pid;
|
/**
|
* 类型编码
|
*/
|
@Excel(name = "分类编码", width = 15, orderNum = "1")
|
private String code;
|
/**
|
* 类型名称
|
*/
|
@Excel(name = "分类名称", width = 15, orderNum = "2")
|
private String name;
|
/**
|
* 创建人
|
*/
|
private String createBy;
|
/**
|
* 创建日期
|
*/
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
private java.util.Date createTime;
|
/**
|
* 更新人
|
*/
|
private String updateBy;
|
/**
|
* 更新日期
|
*/
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
private java.util.Date updateTime;
|
/**
|
* 所属部门
|
*/
|
private String sysOrgCode;
|
/**
|
* 是否有子节点
|
*/
|
private String hasChild;
|
/**
|
* 根节点编码
|
*/
|
@Excel(name = "根节点编码", width = 15, orderNum = "4")
|
private String rootCode;
|
/**
|
* 所有父节点ID
|
*/
|
private String parentIds;
|
|
@TableField(exist = false)
|
@Excel(name = "父节点编码", width = 15, orderNum = "3")
|
private String parentCode;
|
|
@TableField(exist = false)
|
private List<SysCategory> children;
|
|
@Override
|
public String toString() {
|
return "SysCategory [code=" + code + ", name=" + name + "]";
|
}
|
|
public void addChild(SysCategory node) {
|
if (children == null) {
|
children = new ArrayList<>();
|
}
|
children.add(node);
|
}
|
}
|