You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
107 lines
4.1 KiB
C#
107 lines
4.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using ZKLT.Hadoop.Model;
|
|
|
|
namespace ZKLT.Hadoop.Interface
|
|
{
|
|
public interface ITableService
|
|
{
|
|
/// <summary>
|
|
/// 同步结构
|
|
/// </summary>
|
|
/// <param name="source">数据源</param>
|
|
/// <param name="table">数据表</param>
|
|
/// <returns>是否成功</returns>
|
|
public bool InitStruct(HDP_Source source, HDP_Table table);
|
|
|
|
/// <summary>
|
|
/// 删除结构
|
|
/// </summary>
|
|
/// <param name="source">源</param>
|
|
/// <param name="tableKey">表</param>
|
|
/// <returns>是否成功</returns>
|
|
public bool RemoveStruct(HDP_Source source, string tableKey);
|
|
|
|
/// <summary>
|
|
/// 插入数据
|
|
/// </summary>
|
|
/// <param name="source">数据源</param>
|
|
/// <param name="table">数据表</param>
|
|
/// <param name="row">数据</param>
|
|
/// <returns>是否成功</returns>
|
|
public bool Insert(HDP_Source source, HDP_Table table, Dictionary<string, object> row);
|
|
|
|
/// <summary>
|
|
/// 更新
|
|
/// </summary>
|
|
/// <param name="source">数据源</param>
|
|
/// <param name="table">数据表</param>
|
|
/// <param name="where">条件</param>
|
|
/// <param name="row">数据</param>
|
|
/// <returns>是否成功</returns>
|
|
public bool Update(HDP_Source source, HDP_Table table, Dictionary<string, string> where, Dictionary<string, object> row);
|
|
|
|
/// <summary>
|
|
/// 删除
|
|
/// </summary>
|
|
/// <param name="source">数据源</param>
|
|
/// <param name="table">数据表</param>
|
|
/// <param name="where">条件</param>
|
|
/// <param name="row">数据</param>
|
|
/// <returns>是否成功</returns>
|
|
public bool Delete(HDP_Source source, HDP_Table table, Dictionary<string, string> where, Dictionary<string, object> row);
|
|
|
|
/// <summary>
|
|
/// 查询单个
|
|
/// </summary>
|
|
/// <param name="source">数据源</param>
|
|
/// <param name="table">数据表</param>
|
|
/// <param name="where">条件</param>
|
|
/// <param name="row">数据</param>
|
|
/// <returns>结果</returns>
|
|
public T? QuerySingle<T>(HDP_Source source, HDP_Table table, Dictionary<string, string> where, Dictionary<string, object> row);
|
|
|
|
/// <summary>
|
|
/// 查询列表
|
|
/// </summary>
|
|
/// <typeparam name="T">返回类型</typeparam>
|
|
/// <param name="source">数据源</param>
|
|
/// <param name="table">数据表</param>
|
|
/// <param name="where">条件</param>
|
|
/// <param name="row">数据</param>
|
|
/// <returns>结果集</returns>
|
|
public T[] Query<T>(HDP_Source source, HDP_Table table, Dictionary<string, string>? where = null, Dictionary<string, object>? row = null, Dictionary<string, string>? order = null);
|
|
|
|
/// <summary>
|
|
/// 查询列表
|
|
/// </summary>
|
|
/// <typeparam name="T">返回类型</typeparam>
|
|
/// <param name="source">数据源</param>
|
|
/// <param name="table">数据表</param>
|
|
/// <param name="where">条件</param>
|
|
/// <param name="row">数据</param>
|
|
/// <returns>结果集</returns>
|
|
public HDP_Page<T> QueryPage<T>(HDP_Source source, HDP_Table table, int pageIndex, int pageSize, Dictionary<string, string>? where = null, Dictionary<string, object>? row = null, Dictionary<string, string>? order = null);
|
|
|
|
|
|
/// <summary>
|
|
/// 判断数据源是否存在表
|
|
/// </summary>
|
|
/// <param name="source">数据源</param>
|
|
/// <param name="tableName">表名</param>
|
|
/// <returns>是否存在</returns>
|
|
public bool DbExistTable(HDP_Source source, string tableName);
|
|
|
|
/// <summary>
|
|
/// 查询数据列
|
|
/// </summary>
|
|
/// <param name="source">数据源</param>
|
|
/// <param name="tableName">表名</param>
|
|
/// <returns>列</returns>
|
|
public HDP_Column[] DbGetColumns(HDP_Source source, string tableName);
|
|
}
|
|
}
|