#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 id  ,name ,pid,node_type FROM tree_cte
        #if(dataset)
            where node_type='dataset'
        #end
    #end
#end