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.

109 lines
3.9 KiB
C#

using Newtonsoft.Json.Linq;
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, JContainer? 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, JContainer? where, JContainer? 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, JContainer? where, JContainer? 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, JContainer? where, JContainer? row, string[]? col);
/// <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, JContainer? where, JContainer? row,
JContainer? order, string[]? col);
/// <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, JContainer? where, JContainer? row, JContainer? order, string[]? col);
/// <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);
}
}