package com.ruoyi.syzy.domain;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.ruoyi.sy.domain.SyVocational;

import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;

/**
 * TreeSelectVocational树结构实体类
 * 
 * @author mjx
 */
public class TreeSelectVocational implements Serializable
{
    private static final long serialVersionUID = 1L;

    /** 节点编码 */
    private Long id;
    private String code;
    /** 节点名称 */
    private String name;
    private String type;
    private Integer childCount;
    private Integer grandchildCount;
    private Integer level;
    private String learnYearArab;

    /** 子节点 */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<TreeSelectVocational> children;

    public TreeSelectVocational()
    {

    }

    public TreeSelectVocational(SyVocational vocational)
    {
        this.id = vocational.getId();
        this.code = vocational.getCode();
        this.type = vocational.getType();
        this.name = vocational.getName();
        this.level = vocational.getLevel();
        this.childCount = vocational.getChildCount();
        this.learnYearArab = vocational.getLearnYearArab();
        this.grandchildCount = vocational.getGrandchildCount();
        this.children = vocational.getChildren().stream().map(TreeSelectVocational::new).collect(Collectors.toList());
    }

    public String getLearnYearArab() {
        return learnYearArab;
    }

    public void setLearnYearArab(String learnYearArab) {
        this.learnYearArab = learnYearArab;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getChildCount() {
        return childCount;
    }

    public void setChildCount(Integer childCount) {
        this.childCount = childCount;
    }

    public Integer getGrandchildCount() {
        return grandchildCount;
    }

    public void setGrandchildCount(Integer grandchildCount) {
        this.grandchildCount = grandchildCount;
    }

    public List<TreeSelectVocational> getChildren()
    {
        return children;
    }

    public void setChildren(List<TreeSelectVocational> children)
    {
        this.children = children;
    }

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
}
