package ${packageName}.model;

import java.util.List;
import java.util.ArrayList;
import ${packageName}.model.vo.${ClassName}Vo;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serializable;
import java.util.stream.Collectors;
/**
* ${functionName}前端映射树结构实体类
*
* @author ${author}
* @date ${datetime}
*/
@Data
public class ${ClassName}TreeSelect  implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
    * 节点ID
    */
    private Long id;

    /**
    * 节点名称
    */
    private String label;

    /**
    * 子节点
    */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<${ClassName}TreeSelect> children;

    public ${ClassName}TreeSelect(${ClassName}Entity entity) {
        this.id = entity.get${pkColumn.javaField?cap_first}();
        this.label = entity.get${treeName?cap_first}();
        this.children = entity.getChildren().stream().map(${ClassName}TreeSelect::new).collect(Collectors.toList());
    }

}