项目初始导入

This commit is contained in:
dell
2017-12-29 16:18:40 +08:00
commit 0788f42ae7
3221 changed files with 500217 additions and 0 deletions

View File

@@ -0,0 +1,79 @@
package com.nis.domain;
import com.fasterxml.jackson.annotation.JsonBackReference;
import com.nis.util.Reflections;
import com.nis.util.StringUtil;
/**
* 数据Entity类
* @author ThinkGem
* @version 2014-05-16
*/
public abstract class TreeEntity<T> extends BaseEntity<T> {
private static final long serialVersionUID = 1L;
protected T parent; // 父级编号
protected String parentIds; // 所有父级编号
protected String name; // 机构名称
protected Long sort; // 排序
public TreeEntity() {
super();
this.sort = 30L;
}
public TreeEntity(Long id) {
super(id);
}
/**
* 父对象只能通过子类实现父类实现mybatis无法读取
* @return
*/
@JsonBackReference
public abstract T getParent();
/**
* 父对象只能通过子类实现父类实现mybatis无法读取
* @return
*/
public abstract void setParent(T parent);
public String getParentIds() {
return parentIds;
}
public void setParentIds(String parentIds) {
this.parentIds = parentIds;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Long getSort() {
return sort;
}
public void setSort(Long sort) {
this.sort = sort;
}
public Long getParentId() {
Long id = null;
if (parent != null){
id = (Long)Reflections.getFieldValue(parent, "id");
}
return StringUtil.isEmpty(id) ? 0 : id;
}
}