package cn.iocoder.yudao.module.pms.dal.dataobject.iotmodeltree;

import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;

import java.util.ArrayList;
import java.util.List;

/**
 * @author yc
 * @version 1.0
 * @className ModelTreeNode
 * @date 2025/5/4 22:29
 * @description
 */
@TableName("model_tree_node")
@KeySequence("model_tree_node_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库，可不写。
@Data
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ModelTreeNode {
    @TableId
    private Long id;
    private String name;
    private Long parentId;
    private Integer sortOrder;

    @TableField(exist = false)
    private List<ModelTreeNode> children = new ArrayList<>();
}