新增差异日志记录到库

This commit is contained in:
不做码农
2023-07-20 18:20:59 +08:00
parent 1ba31c17cf
commit 95b0178dd4
10 changed files with 111 additions and 23 deletions

View File

@@ -56,7 +56,7 @@ namespace ZR.Repository
}
public IInsertable<T> Insertable(T t)
{
return Context.Insertable<T>(t);
return Context.Insertable(t);
}
#endregion add
@@ -212,13 +212,13 @@ namespace ZR.Repository
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
public int Delete(object[] obj)
public int Delete(object[] obj, string title = "")
{
return Context.Deleteable<T>().In(obj).ExecuteCommand();
return Context.Deleteable<T>().In(obj).EnableDiffLogEventIF(title.IsNotEmpty(), title).ExecuteCommand();
}
public int Delete(object id)
public int Delete(object id, string title = "")
{
return Context.Deleteable<T>(id).ExecuteCommand();
return Context.Deleteable<T>(id).EnableDiffLogEventIF(title.IsNotEmpty(), title).ExecuteCommand();
}
public int DeleteTable()
{
@@ -376,7 +376,7 @@ namespace ZR.Repository
var result = source
.OrderByIF(parm.Sort.IsNotEmpty(), $"{parm.Sort.ToSqlFilter()} {(!string.IsNullOrWhiteSpace(parm.SortType) && parm.SortType.Contains("desc") ? "desc" : "asc")}")
.ToPageList(parm.PageNum, parm.PageSize, ref total);
page.TotalNum = total;
page.Result = result.Adapt<List<T2>>();
return page;

View File

@@ -47,8 +47,8 @@ namespace ZR.Repository
#region delete
IDeleteable<T> Deleteable();
int Delete(object[] obj);
int Delete(object id);
int Delete(object[] obj, string title = "");
int Delete(object id, string title = "");
int DeleteTable();
bool Truncate();