using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
namespace CommonUtil.Db
{
///
/// 数据库操作扩展
///
public abstract class DbSet : DbContext, IDbSet where T : class, new()
{
#region Avg函数
///
/// Avg函数
///
/// 返回值
/// avg函数表达式
///
public virtual TResult Avg(Expression> avg) => Avg(null, null, null, avg);
///
/// Avg函数
///
/// 返回值
/// where函数表达式
/// avg函数表达式
///
public virtual TResult Avg(Expression> where, Expression> avg) => Avg(null, null, where, avg);
///
/// Avg函数
///
/// 返回值
/// 表名
/// avg函数表达式
///
public virtual TResult Avg(string tableName, Expression> avg) => Avg(null, null, null, avg);
///
/// Avg函数
///
/// 返回值
/// 表名
/// where函数表达式
/// avg函数表达式
///
public virtual TResult Avg(string tableName, Expression> where, Expression> avg) => Avg(null, tableName, where, avg);
///
/// Avg函数
///
/// 返回值
/// 库名
/// 表名
/// avg函数表达式
///
public virtual TResult Avg(string storeName, string tableName, Expression> avg) => Avg(storeName, tableName, null, avg);
///
/// Avg函数
///
/// 返回值
/// 库名
/// 表名
/// where函数表达式
/// avg函数表达式
///
public virtual TResult Avg(string storeName, string tableName, Expression> where, Expression> avg)
{
ChangeDatabaseIf(storeName);
var queryable = Db.Queryable();
if (!tableName.IsNullOrEmpty())
{
queryable = queryable.AS(tableName);
}
if (where != null)
{
queryable = queryable.Where(where);
}
return queryable.Avg(avg);
}
#endregion
#region Sum函数
///
/// Sum函数
///
///
///
///
///
public virtual TResult Sum(Expression> where, Expression> sum) => Sum(null, null, where, sum);
///
/// Sum函数
///
///
///
///
///
public virtual TResult Sum(string tableName, Expression> sum) => Sum(null, tableName, null, sum);
///
/// Sum函数
///
///
///
///
///
///
public virtual TResult Sum(string tableName, Expression> where, Expression> sum) => Sum(null, tableName, where, sum);
///
/// Sum函数
///
///
///
///
///
///
public virtual TResult Sum(string storeName, string tableName, Expression> sum) => Sum(storeName, tableName, null, sum);
///
/// Sum函数
///
///
///
///
///
///
///
public virtual TResult Sum(string storeName, string tableName, Expression> where, Expression> sum)
{
ChangeDatabaseIf(storeName);
var queryable = Db.Queryable();
if (!tableName.IsNullOrEmpty())
{
queryable = queryable.AS(tableName);
}
if (where != null)
{
queryable = queryable.Where(where);
}
return queryable.Sum(sum);
}
#endregion
#region Min函数
///
/// Min函数
///
///
///
///
public virtual TResult Min(Expression> min) => Min(null, null, null, min);
///
/// Min函数
///
///
///
///
///
public virtual TResult Min(Expression> where, Expression> min) => Min(null, null, where, min);
///
/// Min函数
///
///
///
///
///
public virtual TResult Min(string tableName, Expression> min) => Min(null, tableName, null, min);
///
/// Min函数
///
///
///
///
///
///
public virtual TResult Min(string tableName, Expression> where, Expression> min) => Min(null, tableName, where, min);
///
/// Min函数
///
///
///
///
///
///
public virtual TResult Min(string storeName, string tableName, Expression> min) => Min(storeName, tableName, null, min);
///
/// Min函数
///
///
///
///
///
///
///
public virtual TResult Min(string storeName, string tableName, Expression> where, Expression> min)
{
ChangeDatabaseIf(storeName);
var queryable = Db.Queryable();
if (!tableName.IsNullOrEmpty())
{
queryable = queryable.AS(tableName);
}
if (where != null)
{
queryable = queryable.Where(where);
}
return queryable.Min(min);
}
#endregion
#region Max函数
///
/// Max函数
///
///
///
///
public virtual TResult Max(Expression> max) => Max(null, null, null, max);
///
/// Max函数
///
///
///
///
///
public virtual TResult Max(Expression> where, Expression> max) => Max(null, null, where, max);
///
/// Max函数
///
///
///
///
///
public virtual TResult Max(string tableName, Expression> max) => Max(null, tableName, null, max);
///
/// Max函数
///
///
///
///
///
///
public virtual TResult Max(string tableName, Expression> where, Expression> max) => Max(null, tableName, where, max);
///
/// Max函数
///
///
///
///
///
///
public virtual TResult Max(string storeName, string tableName, Expression> max) => Max(storeName, tableName, null, max);
///
/// Max函数
///
///
///
///
///
///
///
public virtual TResult Max(string storeName, string tableName, Expression> where, Expression> max)
{
ChangeDatabaseIf(storeName);
var queryable = Db.Queryable();
if (!tableName.IsNullOrEmpty())
{
queryable = queryable.AS(tableName);
}
if (where != null)
{
queryable = queryable.Where(where);
}
return queryable.Max(max);
}
#endregion
#region Count函数
///
/// Count函数
///
///
///
public virtual int Count(Expression> where) => Count(null, null, where);
///
/// Count函数
///
///
///
public virtual int Count(string tableName) => Count(null, tableName, null);
///
/// Count函数
///
///
///
///
public virtual int Count(string tableName, Expression> where) => Count(null, tableName, where);
///
/// Count函数
///
///
///
///
public virtual int Count(string storeName, string tableName) => Count(storeName, tableName, null);
///
/// Count函数
///
///
///
///
///
public virtual int Count(string storeName, string tableName, Expression> where)
{
ChangeDatabaseIf(storeName);
var queryable = Db.Queryable();
if (!tableName.IsNullOrEmpty())
{
queryable = queryable.AS(tableName);
}
if (where != null)
{
queryable = queryable.Where(where);
}
return queryable.Count();
}
#endregion
#region IsExist函数
///
/// 是否存在,IsExist函数
///
///
///
public virtual bool IsExist(Expression> where) => IsExist(null, null, where);
///
/// IsAny函数
///
///
///
///
public virtual bool IsExist(string tableName, Expression> where) => IsExist(null, tableName, where);
///
/// IsAny函数
///
///
///
///
///
public virtual bool IsExist(string storeName, string tableName, Expression> where)
{
ChangeDatabaseIf(storeName);
var queryable = Db.Queryable();
if (!tableName.IsNullOrEmpty())
{
queryable = queryable.AS(tableName);
}
if (where != null)
{
queryable = queryable.Where(where);
}
return queryable.Any();
}
#endregion
#region 根据主键查询
///
/// 根据主键查询
///
///
///
public virtual T GetById(long id) => GetById(id, null, null);
///
/// 根据主键查询
///
///
///
///
public virtual T GetById(long id, string tableName) => GetById(id, null, tableName);
///
/// 根据主键查询
///
///
///
///
///
public virtual T GetById(long id, string storeName, string tableName)
{
ChangeDatabaseIf(storeName);
var queryable = Db.Queryable();
if (!tableName.IsNullOrEmpty())
{
queryable = queryable.AS(tableName);
}
return queryable.InSingle(id);
}
///
/// 根据主键查询
///
///
///
public virtual T GetById(string id) => GetById(id, null, null);
///
/// 根据主键查询
///
///
///
///
public virtual T GetById(string id, string tableName) => GetById(id, null, tableName);
///
/// 根据主键查询
///
///
///
///
///
public virtual T GetById(string id, string storeName, string tableName)
{
ChangeDatabaseIf(storeName);
var queryable = Db.Queryable();
if (!tableName.IsNullOrEmpty())
{
queryable = queryable.AS(tableName);
}
return queryable.InSingle(id);
}
#endregion
#region 查询单条,多条会抛出异常
///
/// 查询单条,多条会抛出异常
///
///
///
public virtual T GetSingle(Expression> where) => GetSingle(where, null, null);
///
/// 查询单条,多条会抛出异常
///
///
///
///
public virtual T GetSingle(Expression> where, string tableName) => GetSingle(where, null, tableName);
///
/// 查询单条,多条会抛出异常
///
///
///
///
///
public virtual T GetSingle(Expression> where, string storeName, string tableName)
{
ChangeDatabaseIf(storeName);
var queryable = Db.Queryable();
if (!tableName.IsNullOrEmpty())
{
queryable = queryable.AS(tableName);
}
return queryable.Single(where);
}
#endregion
#region 查询第一条
///
/// 查询第一条
///
///
///
public virtual T GetFirst(Expression> where) => GetFirst(null, null, where, null, null);
///
/// 查询第一条
///
///
///
public virtual T GetFirst(string tableName) => GetFirst(null, tableName, null, null, null);
///
/// 查询第一条
///
///
///
///
public virtual T GetFirst(Expression> order, DbEnum.OrderType? orderBy) => GetFirst(null, null, null, order, orderBy);
///
/// 查询第一条
///
///
///
///
public virtual T GetFirst(string tableName, Expression> where) => GetFirst(null, tableName, where, null, null);
///
/// 查询第一条
///
///
///
///
public virtual T GetFirst(string storeName, string tableName) => GetFirst(storeName, tableName, null, null, null);
///
/// 查询第一条
///
///
///
///
///
public virtual T GetFirst(Expression> where, Expression> order, DbEnum.OrderType? orderBy) => GetFirst(null, null, where, order, orderBy);
///
/// 查询第一条
///
///
///
///
///
public virtual T GetFirst(string tableName, Expression> order, DbEnum.OrderType? orderBy) => GetFirst(null, tableName, null, order, orderBy);
///
/// 查询第一条
///
///
///
///
///
public virtual T GetFirst(string storeName, string tableName, Expression> where) => GetFirst(storeName, tableName, where, null, null);
///
/// 查询第一条
///
///
///
///
///
///
public virtual T GetFirst(string tableName, Expression> where, Expression> order, DbEnum.OrderType? orderBy) => GetFirst(null, tableName, where, order, orderBy);
///
/// 查询第一条
///
///
///
///
///
///
public virtual T GetFirst(string storeName, string tableName, Expression> order, DbEnum.OrderType? orderBy) => GetFirst(storeName, tableName, null, order, orderBy);
///
/// 查询第一条
///
///
///
///
///
///
///
public virtual T GetFirst(string storeName, string tableName, Expression> where, Expression> order, DbEnum.OrderType? orderBy)
{
ChangeDatabaseIf(storeName);
var queryable = Db.Queryable();
if (!tableName.IsNullOrEmpty())
{
queryable = queryable.AS(tableName);
}
if (order != null)
{
queryable = orderBy.HasValue ? queryable.OrderBy(order, (SqlSugar.OrderByType)orderBy) : queryable.OrderBy(order);
}
if (where != null)
{
queryable = queryable.Where(where);
}
return queryable.First();
}
#endregion
#region 查询全部
///
/// 查询全部
///
///
///
public virtual List ListGet(Expression> groupBy) => ListGet(null, null, null, null, null, groupBy, null);
///
/// 查询全部
///
///
///
public virtual List ListGet(Expression> where) => ListGet(null, tableName: null, where: where, order: null, orderBy: null, groupBy: null, having: null);
///
/// 查询全部
///
///
///
public virtual List ListGet(string tableName) => ListGet(null, tableName, null, null, null, null, null);
///
/// 查询全部
///
///
///
///
public virtual List ListGet(Expression> groupBy, Expression> having) => ListGet(null, null, null, null, null, groupBy, having);
///
/// 查询全部
///
///
///
///
public virtual List ListGet(Expression> where, Expression> groupBy) => ListGet(null, null, where, order: null, orderBy: null, groupBy: groupBy, having: null);
///
/// 查询全部
///
///
///
///
public virtual List ListGet(string tableName, Expression> groupBy) => ListGet(null, tableName, null, null, null, groupBy, null);
///
/// 查询全部
///
///
///
///
public virtual List ListGet(Expression> order, DbEnum.OrderType? orderBy) => ListGet(null, null, null, order, orderBy, null, null);
///
/// 查询全部
///
///
///
///
public virtual List ListGet(string tableName, Expression> where) => ListGet(null, tableName: tableName, where: where, order: null, orderBy: null, groupBy: null, having: null);
///
/// 查询全部
///
///
///
///
public virtual List ListGet(string storeName, string tableName) => ListGet(storeName, tableName, null, null, null, null, null);
///
/// 查询全部
///
///
///
///
///
public virtual List ListGet(string tableName, Expression> groupBy, Expression> having) => ListGet(null, tableName, null, null, null, groupBy, having);
///
/// 查询全部
///
///
///
///
///
public virtual List ListGet(string tableName, Expression> where, Expression> groupBy) => ListGet(null, tableName, where, order: null, orderBy: null, groupBy: groupBy, having: null);
///
/// 查询全部
///
///
///
///
///
public virtual List ListGet(string storeName, string tableName, Expression> groupBy) => ListGet(storeName, tableName, null, null, null, groupBy, null);
///
/// 查询全部
///
///
///
///
///
public virtual List ListGet(Expression> where, Expression> order, DbEnum.OrderType? orderBy) => ListGet(null, null, where, order, orderBy, null, null);
///
/// 查询全部
///
///
///
///
///
public virtual List ListGet(string tableName, Expression> order, DbEnum.OrderType? orderBy) => ListGet(null, tableName, null, order, orderBy, null, null);
///
/// 查询全部
///
///
///
///
///
public virtual List ListGet(string storeName, string tableName, Expression> where) => ListGet(storeName, tableName: tableName, where: where, order: null, orderBy: null, groupBy: null, having: null);
///
/// 查询全部
///
///
///
///
///
///
public virtual List ListGet(Expression> order, DbEnum.OrderType? orderBy, Expression> groupBy, Expression> having) => ListGet(null, null, null, order, orderBy, groupBy, having);
///
/// 查询全部
///
///
///
///
///
///
public virtual List ListGet(string tableName, Expression> where, Expression> groupBy, Expression> having) => ListGet(null, tableName, where, order: null, orderBy: null, groupBy: groupBy, having: having);
///
/// 查询全部
///
///
///
///
///
///
public virtual List ListGet(string storeName, string tableName, Expression> groupBy, Expression> having) => ListGet(storeName, tableName, null, null, null, groupBy, having);
///
/// 查询全部
///
///
///
///
///
///
public virtual List ListGet(Expression> where, Expression> order, DbEnum.OrderType? orderBy, Expression> groupBy) => ListGet(null, null, where, order, orderBy, groupBy, null);
///
/// 查询全部
///
///
///
///
///
///
public virtual List ListGet(string tableName, Expression> order, DbEnum.OrderType? orderBy, Expression> groupBy) => ListGet(null, tableName, null, order, orderBy, groupBy, null);
///
/// 查询全部
///
///
///
///
///
///
public virtual List ListGet(string storeName, string tableName, Expression> where, Expression> groupBy) => ListGet(storeName, tableName, where, order: null, orderBy: null, groupBy: groupBy, having: null);
///
/// 查询全部
///
///
///
///
///
///
public virtual List ListGet(string tableName, Expression> where, Expression> order, DbEnum.OrderType? orderBy) => ListGet(null, tableName, where, order, orderBy, null, null);
///
/// 查询全部
///
///
///
///
///
///
public virtual List ListGet(string storeName, string tableName, Expression> order, DbEnum.OrderType? orderBy) => ListGet(storeName, tableName, null, order, orderBy, null, null);
///
/// 查询全部
///
///
///
///
///
///
///
public virtual List ListGet(Expression> where, Expression> order, DbEnum.OrderType? orderBy, Expression> groupBy, Expression> having) => ListGet(null, null, where, order, orderBy, groupBy, having);
///
/// 查询全部
///
///
///
///
///
///
///
public virtual List ListGet(string tableName, Expression> order, DbEnum.OrderType? orderBy, Expression> groupBy, Expression> having) => ListGet(null, tableName, null, order, orderBy, groupBy, having);
///
/// 查询全部
///
///
///
///
///
///
///
public virtual List ListGet(string storeName, string tableName, Expression> where, Expression> groupBy, Expression> having) => ListGet(storeName, tableName, where, order: null, orderBy: null, groupBy: groupBy, having: having);
///
/// 查询全部
///
///
///
///
///
///
///
public virtual List ListGet(string tableName, Expression> where, Expression> order, DbEnum.OrderType? orderBy, Expression> groupBy) => ListGet(null, tableName, where, order, orderBy, groupBy, null);
///
/// 查询全部
///
///
///
///
///
///
///
public virtual List ListGet(string storeName, string tableName, Expression> order, DbEnum.OrderType? orderBy, Expression> groupBy) => ListGet(storeName, tableName, null, order, orderBy, groupBy, null);
///
/// 查询全部
///
///
///
///
///
///
///
public virtual List ListGet(string storeName, string tableName, Expression> where, Expression> order, DbEnum.OrderType? orderBy) => ListGet(storeName, tableName, where, order, orderBy, null, null);
///
/// 查询全部
///
///
///
///
///
///
///
///
public virtual List ListGet(string tableName, Expression> where, Expression> order, DbEnum.OrderType? orderBy, Expression> groupBy, Expression> having) => ListGet(null, tableName, where, order, orderBy, groupBy, having);
///
/// 查询全部
///
///
///
///
///
///
///
///
public virtual List ListGet(string storeName, string tableName, Expression> order, DbEnum.OrderType? orderBy, Expression> groupBy, Expression> having) => ListGet(storeName, tableName, null, order, orderBy, groupBy, having);
///
/// 查询全部
///
///
///
///
///
///
///
///
public virtual List ListGet(string storeName, string tableName, Expression> where, Expression> order, DbEnum.OrderType? orderBy, Expression> groupBy) => ListGet(storeName, tableName, where, order, orderBy, groupBy, null);
///
/// 查询全部
///
///
///
///
///
///
///
///
///
public virtual List ListGet(string storeName, string tableName, Expression> where, Expression> order, DbEnum.OrderType? orderBy, Expression> groupBy, Expression> having)
{
ChangeDatabaseIf(storeName);
var queryable = Db.Queryable();
if (!tableName.IsNullOrEmpty())
{
queryable = queryable.AS(tableName);
}
if (where != null)
{
queryable = queryable.Where(where);
}
if (order != null)
{
queryable = orderBy.HasValue ? queryable.OrderBy(order, (SqlSugar.OrderByType)orderBy) : queryable.OrderBy(order);
}
if (groupBy != null)
{
queryable = queryable.GroupBy(groupBy);
}
if (having != null)
{
queryable = queryable.Having(having);
}
return queryable.ToList();
}
#endregion
#region 分页查询全部
///
/// 分页查询全部
///
///
///
///
///
public virtual List ListPageGet(int pageIndex, int pageSize, ref int totalCount) => ListPageGet(null, null, null, null, null, null, null, pageIndex, pageSize, ref totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
public virtual List ListPageGet(Expression> groupBy, int pageIndex, int pageSize, ref int totalCount) => ListPageGet(null, null, null, null, null, groupBy, null, pageIndex, pageSize, ref totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
public virtual List ListPageGet(Expression> where, int pageIndex, int pageSize, ref int totalCount) => ListPageGet(storeName: null, tableName: null, where: where, order: null, orderBy: null, groupBy: null, having: null, pageIndex: pageIndex, pageSize: pageSize, totalCount: ref totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
public virtual List ListPageGet(string tableName, int pageIndex, int pageSize, ref int totalCount) => ListPageGet(null, tableName, null, null, null, null, null, pageIndex, pageSize, ref totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
public virtual List ListPageGet(Expression> groupBy, Expression> having, int pageIndex, int pageSize, ref int totalCount) => ListPageGet(null, null, null, null, null, groupBy, having, pageIndex, pageSize, ref totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
public virtual List ListPageGet(Expression> where, Expression> groupBy, int pageIndex, int pageSize, ref int totalCount) => ListPageGet(null, null, where, null, null, groupBy, null, pageIndex, pageSize, ref totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
public virtual List ListPageGet(string tableName, Expression> groupBy, int pageIndex, int pageSize, ref int totalCount) => ListPageGet(null, tableName, null, null, null, groupBy, null, pageIndex, pageSize, ref totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
public virtual List ListPageGet(Expression> order, DbEnum.OrderType? orderBy, int pageIndex, int pageSize, ref int totalCount) => ListPageGet(null, null, null, order, orderBy, null, null, pageIndex, pageSize, ref totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
public virtual List ListPageGet(string tableName, Expression> where, int pageIndex, int pageSize, ref int totalCount) => ListPageGet(storeName: null, tableName: tableName, where: where, order: null, orderBy: null, groupBy: null, having: null, pageIndex: pageIndex, pageSize: pageSize, totalCount: ref totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
public virtual List ListPageGet(string storeName, string tableName, int pageIndex, int pageSize, ref int totalCount) => ListPageGet(storeName, tableName, null, null, null, null, null, pageIndex, pageSize, ref totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
///
public virtual List ListPageGet(Expression> where, Expression> groupBy, Expression> having, int pageIndex, int pageSize, ref int totalCount) => ListPageGet(null, null, where, null, null, groupBy, having, pageIndex, pageSize, ref totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
///
public virtual List ListPageGet(string tableName, Expression> groupBy, Expression> having, int pageIndex, int pageSize, ref int totalCount) => ListPageGet(null, tableName, null, null, null, groupBy, having, pageIndex, pageSize, ref totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
///
public virtual List ListPageGet(Expression> order, DbEnum.OrderType? orderBy, Expression> groupBy, int pageIndex, int pageSize, ref int totalCount) => ListPageGet(null, null, null, order, orderBy, groupBy, null, pageIndex, pageSize, ref totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
///
public virtual List ListPageGet(string tableName, Expression> where, Expression> groupBy, int pageIndex, int pageSize, ref int totalCount) => ListPageGet(null, tableName, where, null, null, groupBy, null, pageIndex, pageSize, ref totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
///
public virtual List ListPageGet(string storeName, string tableName, Expression> groupBy, int pageIndex, int pageSize, ref int totalCount) => ListPageGet(storeName, tableName, null, null, null, groupBy, null, pageIndex, pageSize, ref totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
///
public virtual List ListPageGet(Expression> where, Expression> order, DbEnum.OrderType? orderBy, int pageIndex, int pageSize, ref int totalCount) => ListPageGet(null, null, where, order, orderBy, null, null, pageIndex, pageSize, ref totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
///
public virtual List ListPageGet(string tableName, Expression> order, DbEnum.OrderType? orderBy, int pageIndex, int pageSize, ref int totalCount) => ListPageGet(null, tableName, null, order, orderBy, null, null, pageIndex, pageSize, ref totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
///
public virtual List ListPageGet(string storeName, string tableName, Expression> where, int pageIndex, int pageSize, ref int totalCount) => ListPageGet(storeName: storeName, tableName: tableName, where: where, order: null, orderBy: null, groupBy: null, having: null, pageIndex: pageIndex, pageSize: pageSize, totalCount: ref totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
///
///
public virtual List ListPageGet(Expression> order, DbEnum.OrderType? orderBy, Expression> groupBy, Expression> having, int pageIndex, int pageSize, ref int totalCount) => ListPageGet(null, null, null, order, orderBy, groupBy, having, pageIndex, pageSize, ref totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
///
///
public virtual List ListPageGet(string tableName, Expression> where, Expression> groupBy, Expression> having, int pageIndex, int pageSize, ref int totalCount) => ListPageGet(null, tableName, where, null, null, groupBy, having, pageIndex, pageSize, ref totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
///
///
public virtual List ListPageGet(string storeName, string tableName, Expression> groupBy, Expression> having, int pageIndex, int pageSize, ref int totalCount) => ListPageGet(storeName, tableName, null, null, null, groupBy, having, pageIndex, pageSize, ref totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
///
///
public virtual List ListPageGet(Expression> where, Expression> order, DbEnum.OrderType? orderBy, Expression> groupBy, int pageIndex, int pageSize, ref int totalCount) => ListPageGet(null, null, where, order, orderBy, groupBy, null, pageIndex, pageSize, ref totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
///
///
public virtual List ListPageGet(string tableName, Expression> order, DbEnum.OrderType? orderBy, Expression> groupBy, int pageIndex, int pageSize, ref int totalCount) => ListPageGet(null, tableName, null, order, orderBy, groupBy, null, pageIndex, pageSize, ref totalCount);
///
/// 分页查询全部
///
///
///
///
///
///
///
///
///
public virtual List ListPageGet(string storeName, string tableName, Expression> where, Expression> groupBy, int pageIndex, int pageSize, ref int totalCount) => ListPageGet(storeName, tableName, where, null, null, groupBy, null, pageIndex, pageSize, ref totalCount);
///