package com.mortals.xhx.module.demotree.model;
import java.util.List;
import java.util.ArrayList;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.demotree.model.vo.DemotreeVo;
/**
* 树信息实体对象
*
* @author zxfei
* @date 2021-11-26
*/

public class DemotreeEntity extends DemotreeVo {
    private static final long serialVersionUID = 1L;

    /**
    * 名称
    */
    private String treeName;
    /**
    * 父级id
    */
    private Long parentId;
    /**
    * 祖级列表，逗号分隔
    */
    private String ancestors;
    /**
    * 排序字段
    */
    private Integer orderNum;
    /**
    * 状态 ，0，停用，1，正常 默认1
    */
    private Integer status;



    public DemotreeEntity(){}
    /**
    * 获取 名称
    * @return String
    */
    public String getTreeName(){
        return treeName;
    }
    /**
    * 设置 名称
    * @param treeName
    */
    public void setTreeName(String treeName){
        this.treeName = treeName;
    }
    /**
    * 获取 父级id
    * @return Long
    */
    public Long getParentId(){
        return parentId;
    }
    /**
    * 设置 父级id
    * @param parentId
    */
    public void setParentId(Long parentId){
        this.parentId = parentId;
    }
    /**
    * 获取 祖级列表，逗号分隔
    * @return String
    */
    public String getAncestors(){
        return ancestors;
    }
    /**
    * 设置 祖级列表，逗号分隔
    * @param ancestors
    */
    public void setAncestors(String ancestors){
        this.ancestors = ancestors;
    }
    /**
    * 获取 排序字段
    * @return Integer
    */
    public Integer getOrderNum(){
        return orderNum;
    }
    /**
    * 设置 排序字段
    * @param orderNum
    */
    public void setOrderNum(Integer orderNum){
        this.orderNum = orderNum;
    }
    /**
    * 获取 状态 ，0，停用，1，正常 默认1
    * @return Integer
    */
    public Integer getStatus(){
        return status;
    }
    /**
    * 设置 状态 ，0，停用，1，正常 默认1
    * @param status
    */
    public void setStatus(Integer status){
        this.status = status;
    }




    @Override
    public int hashCode() {
         return this.getId().hashCode();
    }
    @Override
    public boolean equals(Object obj) {
        if (obj == null) return false;
        if (obj instanceof DemotreeEntity) {
            DemotreeEntity tmp = (DemotreeEntity) obj;
            if (this.getId() == tmp.getId()) {
                 return true;
            }
        }
        return false;
    }

    public String toString(){
        StringBuilder sb = new StringBuilder("");
        sb.append(",treeName:").append(getTreeName());
        sb.append(",parentId:").append(getParentId());
        sb.append(",ancestors:").append(getAncestors());
        sb.append(",orderNum:").append(getOrderNum());
        sb.append(",status:").append(getStatus());
        return sb.toString();
    }

    public void initAttrValue(){
            this.treeName = null;
            this.parentId = null;
            this.ancestors = "";
            this.orderNum = 0;
            this.status = 1;
    }
}