package io.gisbi.dataset.dao.auto.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.gisbi.dataset.dao.auto.entity.CoreDatasetTable;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @Author bi-coder
 * @since 2023-04-14
 */
@Mapper
public interface CoreDatasetTableMapper extends BaseMapper<CoreDatasetTable> {
    @Select("select b.name group_name,a.table_name table_name,a.id table_id,a.datasource_id datasource_id from core_dataset_table a join core_dataset_group b on  (a.dataset_group_id=b.id) where b.app_id=#{appid} and a.type='db'  order by a.name")
    List<Map<String,Object>> getTablesByAppId(String appid);
}
