#namespace("DataEase")
  -- 获取树根
  #sql("getTreeRoot")
    select  * from core_dataset_group where name like '云南省教科院项目';
  #end
  -- 获取所有的数据集
  #sql("getAllDataSet")
    WITH RECURSIVE tree_cte AS (
          SELECT *
          FROM core_dataset_group
          WHERE id = #para(id) -- 根节点的id
          UNION ALL
          SELECT c.*
          FROM core_dataset_group c
          INNER JOIN tree_cte t ON c.pid = t.id
      )
    SELECT t1.id  ,t1.name ,t1.pid,t1.node_type,t2.name as parent_name FROM tree_cte as t1 inner join core_dataset_group as t2
        on t1.pid=t2.id
        #if(dataset)
            where t1.node_type='dataset'
        #end
    #end
    -- 获取表名
    #sql("getTableName")
        select  table_name from core_dataset_table where dataset_group_id=#para(dataset_group_id);
    #end
#end