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.

141 lines
5.0 KiB
C#

using Newtonsoft.Json.Linq;
using System;
9 months ago
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
4 months ago
using System.Transactions;
9 months ago
using ZKLT.Hadoop.Model;
namespace ZKLT.Hadoop.Interface
{
public interface ITableService
{
4 months ago
/// <summary>
/// 初始化云计算
/// </summary>
/// <param name="config">配置</param>
public void Init(Action<HDP_Source> config);
/// <summary>
/// 获取源
/// </summary>
/// <param name="sourceid">数据源编号</param>
/// <returns>结果</returns>
public HDP_Source GetSource(string sourceid);
/// <summary>
/// 获取表
/// </summary>
/// <param name="tableid">表编号</param>
/// <returns>结果</returns>
public HDP_Table GetTable(string tableid);
9 months ago
/// <summary>
/// 同步结构
/// </summary>
4 months ago
/// <param name="sourceId">数据源</param>
9 months ago
/// <param name="table">数据表</param>
/// <returns>是否成功</returns>
4 months ago
public bool InitStruct(string sourceId, HDP_Table table);
9 months ago
/// <summary>
/// 删除结构
/// </summary>
4 months ago
/// <param name="sourceId">源</param>
/// <param name="tableId">表</param>
9 months ago
/// <returns>是否成功</returns>
4 months ago
public bool RemoveStruct(string sourceId, string tableId);
9 months ago
/// <summary>
/// 插入数据
/// </summary>
4 months ago
/// <param name="sourceId">数据源</param>
/// <param name="tableId">数据表</param>
/// <param name="data">数据</param>
9 months ago
/// <returns>是否成功</returns>
4 months ago
public bool Insert(string sourceId, string tableId, JToken? data);
9 months ago
/// <summary>
/// 更新
/// </summary>
/// <param name="source">数据源</param>
/// <param name="table">数据表</param>
/// <param name="where">条件</param>
4 months ago
/// <param name="data">数据</param>
9 months ago
/// <returns>是否成功</returns>
4 months ago
public bool Update(string sourceId, string tableId, JToken? where, JToken? data);
9 months ago
/// <summary>
/// 删除
/// </summary>
4 months ago
/// <param name="sourceId">数据源</param>
/// <param name="tableId">数据表</param>
9 months ago
/// <param name="where">条件</param>
/// <param name="row">数据</param>
/// <returns>是否成功</returns>
4 months ago
public bool Delete(string sourceId, string tableId, JToken? where, JToken? data);
9 months ago
/// <summary>
/// 查询单个
/// </summary>
4 months ago
/// <param name="sourceId">数据源</param>
/// <param name="tableId">数据表</param>
9 months ago
/// <param name="where">条件</param>
4 months ago
/// <param name="data">数据</param>
9 months ago
/// <returns>结果</returns>
4 months ago
public T? QuerySingle<T>(string sourceId, string tableId, JToken? where, JToken? data,
string[]? col);
9 months ago
/// <summary>
/// 查询列表
/// </summary>
/// <typeparam name="T">返回类型</typeparam>
/// <param name="source">数据源</param>
/// <param name="table">数据表</param>
/// <param name="where">条件</param>
4 months ago
/// <param name="data">数据</param>
/// <param name="order">排序</param>
/// <param name="col">筛选返回字段</param>
9 months ago
/// <returns>结果集</returns>
4 months ago
public T[] Query<T>(string sourceId, string tableId, JToken? where, JToken? data,
JToken? order, string[]? col);
public string QueryString(string sourceId, string tableId, JToken? where, JToken? data,
JToken? order, string[]? col, Dictionary<string, object> param);
9 months ago
/// <summary>
4 months ago
/// 查询分页列表
9 months ago
/// </summary>
/// <typeparam name="T">返回类型</typeparam>
4 months ago
/// <param name="sourceId">数据源</param>
/// <param name="tableId">数据表</param>
/// <param name="pageIndex">分页下标</param>
/// <param name="pageSize">分页大小</param>
9 months ago
/// <param name="where">条件</param>
4 months ago
/// <param name="data">数据</param>
/// <param name="order">排序</param>
/// <param name="col">返回咧</param>
9 months ago
/// <returns>结果集</returns>
4 months ago
public HDP_Page<T> QueryPage<T>(string sourceId, string tableId, int pageIndex, int pageSize, JToken? where,
JToken? data, JToken? order, string[]? col);
9 months ago
/// <summary>
/// 判断数据源是否存在表
/// </summary>
4 months ago
/// <param name="sourceId">数据源</param>
9 months ago
/// <param name="tableName">表名</param>
/// <returns>是否存在</returns>
4 months ago
public bool DbExistTable(string sourceId, string tableName);
9 months ago
/// <summary>
/// 查询数据列
/// </summary>
4 months ago
/// <param name="sourceId">数据源</param>
/// <param name="tableId">表</param>
9 months ago
/// <returns>列</returns>
4 months ago
public HDP_Column[] DbGetColumns(string sourceId, string tableId);
9 months ago
}
}