using Common.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace Data.Interfaces
{
public interface IDatabase
{
#region 查询
///
/// 集合查询
///
///
///
///
///
IEnumerable FindList(string sql, object para = null) where T : class, new();
///
/// 分页集合查询
///
///
///
///
PaginationDTO> FindPageList(string sql, PaginationQuery pagination, object para = null) where T : class, new();
///
/// 分页查询-Lambda
///
///
///
///
///
PaginationDTO> FindPageList(Expression> condition, PaginationQuery pagination) where T : class, new();
///
/// 集合查询(Lambda)
///
///
///
///
IEnumerable FindList(Expression> condition) where T : class, new();
///
/// 查询实体对象
///
///
///
///
///
T FindEntity(string sql, object para = null);
///
/// 集合查询(Lambda)
///
///
///
///
T FindEntity(Expression> condition) where T : class, new();
///
/// 数据条数
///
///
///
///
int Count(Expression> condition) where T : class, new();
///
/// 数据条数
///
///
///
///
int Count(string sql, object para);
#endregion
#region 编辑
///
/// 新增sql
///
/// sql语句
/// 参数化
int Insert(string sql, object para = null);
///
/// 实体新增
///
/// sql语句
/// 参数化
int Insert(T model) where T : class, new();
///
/// 批量实体新增
///
/// sql语句
/// 参数化
int Insert(List list) where T : class, new();
///
/// 修改sql
///
/// sql语句
/// 参数化
int Update(string sql, object para = null);
///
/// 修改lammbda
///
///
///
///
int Update(T t) where T : class, new();
#endregion
#region 删除
///
/// 修改sql
///
/// sql语句
/// 参数化
int Delete(string sql, object para = null);
///
/// 泛型删除
///
///
///
///
int Delete(T t) where T : class, new();
///
/// 泛型删除
///
///
///
///
int Delete(int id) where T : class, new();
#endregion
}
}