using System;
using System.Collections.Generic;
using System.Linq.Expressions;
namespace CommonUtil.Db
{
///
/// 数据库操作扩展接口
///
public interface IDbSet where T : class, new()
{
#region Avg函数
///
/// Avg函数
///
/// 返回值
/// avg函数表达式
///
TResult Avg(Expression> avg);
///
/// Avg函数
///
/// 返回值
/// where函数表达式
/// avg函数表达式
///
TResult Avg(Expression> where, Expression> avg);
///
/// Avg函数
///
/// 返回值
/// 表名
/// avg函数表达式
///
TResult Avg(string tableName, Expression> avg);
///
/// Avg函数
///
/// 返回值
/// 表名
/// where函数表达式
/// avg函数表达式
///
TResult Avg(string tableName, Expression> where, Expression> avg);
///
/// Avg函数
///
/// 返回值
/// 库名
/// 表名
/// avg函数表达式
///
TResult Avg(string storeName, string tableName, Expression> avg);
///
/// Avg函数
///
/// 返回值
/// 库名
/// 表名
/// where函数表达式
/// avg函数表达式
///
TResult Avg(string storeName, string tableName, Expression> where, Expression> avg);
#endregion
#region Sum函数
///
/// Sum函数
///
///
///
///
///
TResult Sum(Expression> where, Expression> sum);
///
/// Sum函数
///
///
///
///
///
TResult Sum(string tableName, Expression> sum);
///
/// Sum函数
///
///
///
///
///
///
TResult Sum(string tableName, Expression> where, Expression> sum);
///
/// Sum函数
///
///
///
///
///
///
TResult Sum(string storeName, string tableName, Expression> sum);
///
/// Sum函数
///
///
///
///
///
///
///
TResult Sum(string storeName, string tableName, Expression> where, Expression> sum);
#endregion
#region Min函数
///
/// Min函数
///
///
///
///
TResult Min(Expression> min);
///
/// Min函数
///
///
///
///
///
TResult Min(Expression> where, Expression> min);
///
/// Min函数
///
///
///
///
///
TResult Min(string tableName, Expression> min);
///
/// Min函数
///
///
///
///
///
///
TResult Min(string tableName, Expression> where, Expression> min);
///
/// Min函数
///
///
///
///
///
///
TResult Min(string storeName, string tableName, Expression> min);
///
/// Min函数
///
///
///
///
///
///
///
TResult Min(string storeName, string tableName, Expression> where, Expression> min);
#endregion
#region Max函数
///
/// Max函数
///
///
///
///
TResult Max(Expression> max);
///
/// Max函数
///
///
///
///
///
TResult Max(Expression> where, Expression> max);
///
/// Max函数
///
///
///
///
///
TResult Max(string tableName, Expression> max);
///
/// Max函数
///
///
///
///
///
///
TResult Max(string tableName, Expression> where, Expression> max);
///
/// Max函数
///
///
///
///
///
///
TResult Max(string storeName, string tableName, Expression> max);
///
/// Max函数
///
///
///
///
///
///
///
TResult Max(string storeName, string tableName, Expression> where, Expression> max);
#endregion
#region Count函数
///
/// Count函数
///
///
///
int Count(Expression> where);
///
/// Count函数
///
///
///
int Count(string tableName);
///
/// Count函数
///
///
///
///
int Count(string tableName, Expression> where);
///
/// Count函数
///
///
///
///
int Count(string storeName, string tableName);
///
/// Count函数
///
///
///
///
///
int Count(string storeName, string tableName, Expression> where);
#endregion
#region IsExist函数
///
/// 是否存在,IsExist函数
///
///
///
bool IsExist(Expression> where);
///
/// IsAny函数
///
///
///
///
bool IsExist(string tableName, Expression> where);
///
/// IsAny函数
///
///
///
///
///
bool IsExist(string storeName, string tableName, Expression> where);
#endregion
#region 根据主键查询
///
/// 根据主键查询
///
///
///
T GetById(long id);
///
/// 根据主键查询
///
///
///
///
T GetById(long id, string tableName);
///
/// 根据主键查询
///
///
///
///
///
T GetById(long id, string storeName, string tableName);
///
/// 根据主键查询
///
///
///
T GetById(string id);
///
/// 根据主键查询
///
///
///
///
T GetById(string id, string tableName);
///
/// 根据主键查询
///
///
///
///
///
T GetById(string id, string storeName, string tableName);
#endregion
#region 查询单条,多条会抛出异常
///
/// 查询单条,多条会抛出异常
///
///
///
T GetSingle(Expression> where);
///
/// 查询单条,多条会抛出异常
///
///
///
///
T GetSingle(Expression> where, string tableName);
///
/// 查询单条,多条会抛出异常
///
///
///
///
///
T GetSingle(Expression> where, string storeName, string tableName);
#endregion
#region 查询第一条
///
/// 查询第一条
///
///
///
T GetFirst(Expression> where);
///
/// 查询第一条
///
///
///
T GetFirst(string tableName);
///
/// 查询第一条
///
///
///
///
T GetFirst(Expression> order, DbEnum.OrderType? orderBy);
///
/// 查询第一条
///
///
///
///
T GetFirst(string tableName, Expression> where);
///
/// 查询第一条
///
///
///
///
T GetFirst(string storeName, string tableName);
///
/// 查询第一条
///
///
///
///
///
T GetFirst(Expression> where, Expression> order, DbEnum.OrderType? orderBy);
///
/// 查询第一条
///
///
///
///
///
T GetFirst(string tableName, Expression> order, DbEnum.OrderType? orderBy);
///
/// 查询第一条
///
///
///
///
///
T GetFirst(string storeName, string tableName, Expression> where);
///
/// 查询第一条
///
///
///
///
///
///
T GetFirst(string tableName, Expression> where, Expression> order, DbEnum.OrderType? orderBy);
///
/// 查询第一条
///
///
///
///
///
///
T GetFirst(string storeName, string tableName, Expression> order, DbEnum.OrderType? orderBy);
///
/// 查询第一条
///
///
///
///
///
///
///
T GetFirst(string storeName, string tableName, Expression> where, Expression> order, DbEnum.OrderType? orderBy);
#endregion
#region 查询全部
///
/// 查询全部
///
///
///
List ListGet(Expression> groupBy);
///
/// 查询全部
///
///
///
List ListGet(Expression> where);
///
/// 查询全部
///
///
///
List ListGet(string tableName);
///
/// 查询全部
///
///
///
///
List ListGet(Expression> groupBy, Expression> having);
///
/// 查询全部
///
///
///
///
List ListGet(Expression> where, Expression> groupBy);
///
/// 查询全部
///
///
///
///
List ListGet(string tableName, Expression> groupBy);
///
/// 查询全部
///
///
///
///
List ListGet(Expression> order, DbEnum.OrderType? orderBy);
///
/// 查询全部
///
///
///
///
List ListGet(string tableName, Expression> where);
///
/// 查询全部
///
///
///
///
List ListGet(string storeName, string tableName);
///
/// 查询全部
///
///
///
///
///
List ListGet(string tableName, Expression> groupBy, Expression> having);
///
/// 查询全部
///
///
///
///
///
List ListGet(string tableName, Expression> where, Expression> groupBy);
///
/// 查询全部
///
///
///
///
///
List ListGet(string storeName, string tableName, Expression> groupBy);
///
/// 查询全部
///
///
///
///
///
List ListGet(Expression> where, Expression> order, DbEnum.OrderType? orderBy);
///
/// 查询全部
///
///
///
///
///
List ListGet(string tableName, Expression> order, DbEnum.OrderType? orderBy);
///
/// 查询全部
///
///
///
///
///
List ListGet(string storeName, string tableName, Expression> where);
///
/// 查询全部
///
///
///
///
///
///
List ListGet(Expression> order, DbEnum.OrderType? orderBy, Expression> groupBy, Expression> having);
///
/// 查询全部
///
///
///
///
///
///
List ListGet(string tableName, Expression> where, Expression> groupBy, Expression> having);
///
/// 查询全部
///
///
///
///
///
///
List ListGet(string storeName, string tableName, Expression> groupBy, Expression> having);
///
/// 查询全部
///
///
///
///
///
///
List ListGet(Expression> where, Expression> order, DbEnum.OrderType? orderBy, Expression> groupBy);
///
/// 查询全部
///
///
///
///
///
///
List ListGet(string tableName, Expression> order, DbEnum.OrderType? orderBy, Expression> groupBy);
///
/// 查询全部
///
///
///
///
///
///
List ListGet(string storeName, string tableName, Expression> where, Expression> groupBy);
///
/// 查询全部
///
///
///
///
///
///
List ListGet(string tableName, Expression> where, Expression> order, DbEnum.OrderType? orderBy);
///
/// 查询全部
///
///
///
///
///
///
List ListGet(string storeName, string tableName, Expression> order, DbEnum.OrderType? orderBy);
///
/// 查询全部
///
///
///
///
///
///
///
List ListGet(Expression> where, Expression> order, DbEnum.OrderType? orderBy, Expression> groupBy, Expression> having);
///
/// 查询全部
///
///
///
///
///
///
///
List ListGet(string tableName, Expression> order, DbEnum.OrderType? orderBy, Expression> groupBy, Expression> having);
///
/// 查询全部
///
///
///
///
///
///
///
List ListGet(string storeName, string tableName, Expression> where, Expression> groupBy, Expression> having);
///
/// 查询全部
///
///
///
///
///
///
///
List ListGet(string tableName, Expression> where, Expression> order, DbEnum.OrderType? orderBy, Expression> groupBy);
///
/// 查询全部
///
///
///
///
///
///
///
List ListGet(string storeName, string tableName, Expression> order, DbEnum.OrderType? orderBy, Expression> groupBy);
///
/// 查询全部
///
///
///
///
///
///
///
List ListGet(string storeName, string tableName, Expression> where, Expression> order, DbEnum.OrderType? orderBy);
///
/// 查询全部
///
///
///
///
///
///
///
///
List ListGet(string tableName, Expression> where, Expression> order, DbEnum.OrderType? orderBy, Expression> groupBy, Expression> having);
///
/// 查询全部
///
///
///
///
///
///
///
///
List ListGet(string storeName, string tableName, Expression> order, DbEnum.OrderType? orderBy, Expression> groupBy, Expression> having);
///
/// 查询全部
///
///
///
///
///
///
///
///
List ListGet(string storeName, string tableName, Expression> where, Expression> order, DbEnum.OrderType? orderBy, Expression> groupBy);
///
/// 查询全部
///
///
///
///
///
///
///
///
///
List ListGet(string storeName, string tableName, Expression> where, Expression> order, DbEnum.OrderType? orderBy, Expression> groupBy, Expression> having);
#endregion
#region 分页查询全部
///
/// 分页查询全部
///
///
///
///
///
List ListPageGet(int pageIndex, int pageSize, ref int totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
List ListPageGet(Expression> groupBy, int pageIndex, int pageSize, ref int totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
List ListPageGet(Expression> where, int pageIndex, int pageSize, ref int totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
List ListPageGet(string tableName, int pageIndex, int pageSize, ref int totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
List ListPageGet(Expression> groupBy, Expression> having, int pageIndex, int pageSize, ref int totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
List ListPageGet(Expression> where, Expression> groupBy, int pageIndex, int pageSize, ref int totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
List ListPageGet(string tableName, Expression> groupBy, int pageIndex, int pageSize, ref int totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
List ListPageGet(Expression> order, DbEnum.OrderType? orderBy, int pageIndex, int pageSize, ref int totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
List ListPageGet(string tableName, Expression> where, int pageIndex, int pageSize, ref int totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
List ListPageGet(string storeName, string tableName, int pageIndex, int pageSize, ref int totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
///
List ListPageGet(Expression> where, Expression> groupBy, Expression> having, int pageIndex, int pageSize, ref int totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
///
List ListPageGet(string tableName, Expression> groupBy, Expression> having, int pageIndex, int pageSize, ref int totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
///
List ListPageGet(Expression> order, DbEnum.OrderType? orderBy, Expression> groupBy, int pageIndex, int pageSize, ref int totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
///
List ListPageGet(string tableName, Expression> where, Expression> groupBy, int pageIndex, int pageSize, ref int totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
///
List ListPageGet(string storeName, string tableName, Expression> groupBy, int pageIndex, int pageSize, ref int totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
///
List ListPageGet(Expression> where, Expression> order, DbEnum.OrderType? orderBy, int pageIndex, int pageSize, ref int totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
///
List ListPageGet(string tableName, Expression> order, DbEnum.OrderType? orderBy, int pageIndex, int pageSize, ref int totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
///
List ListPageGet(string storeName, string tableName, Expression> where, int pageIndex, int pageSize, ref int totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
///
///
List ListPageGet(Expression> order, DbEnum.OrderType? orderBy, Expression> groupBy, Expression> having, int pageIndex, int pageSize, ref int totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
///
///
List ListPageGet(string tableName, Expression> where, Expression> groupBy, Expression> having, int pageIndex, int pageSize, ref int totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
///
///
List ListPageGet(string storeName, string tableName, Expression> groupBy, Expression> having, int pageIndex, int pageSize, ref int totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
///
///
List ListPageGet(Expression> where, Expression> order, DbEnum.OrderType? orderBy, Expression> groupBy, int pageIndex, int pageSize, ref int totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
///
///
List ListPageGet(string tableName, Expression> order, DbEnum.OrderType? orderBy, Expression> groupBy, int pageIndex, int pageSize, ref int totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
///
///
List ListPageGet(string storeName, string tableName, Expression> where, Expression> groupBy, int pageIndex, int pageSize, ref int totalCount);
///
///
///
///
///
///
///
///
///
///
///
List ListPageGet(string tableName, Expression> where, Expression> order, DbEnum.OrderType? orderBy, int pageIndex, int pageSize, ref int totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
///
///
List ListPageGet(string storeName, string tableName, Expression> order, DbEnum.OrderType? orderBy, int pageIndex, int pageSize, ref int totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
///
///
///
List ListPageGet(Expression> where, Expression> order, DbEnum.OrderType? orderBy, Expression> groupBy, Expression> having, int pageIndex, int pageSize, ref int totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
///
///
///
List ListPageGet(string tableName, Expression> order, DbEnum.OrderType? orderBy, Expression