mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-20 00:44:19 +08:00
Update difflog
This commit is contained in:
parent
c3c7f5e96e
commit
0758e8dd53
@ -741,6 +741,15 @@ namespace SqlSugar
|
||||
{
|
||||
List<DiffLogTableInfo> result = new List<DiffLogTableInfo>();
|
||||
var whereSql = Regex.Replace(sql, ".* WHERE ", "", RegexOptions.Singleline);
|
||||
if (IsExists(sql))
|
||||
{
|
||||
// 取第一个 WHERE 后面的部分
|
||||
var match = Regex.Match(sql, @"\bWHERE\b\s*(.*)", RegexOptions.Singleline | RegexOptions.IgnoreCase);
|
||||
if (match.Success)
|
||||
{
|
||||
whereSql = match.Groups[1].Value;
|
||||
}
|
||||
}
|
||||
var dt = this.Context.Queryable<T>().AS(this.DeleteBuilder.AsName).Filter(null, true).Where(whereSql).AddParameters(parameters).ToDataTable();
|
||||
if (dt.Rows != null && dt.Rows.Count > 0)
|
||||
{
|
||||
@ -800,5 +809,10 @@ namespace SqlSugar
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static bool IsExists(string sql)
|
||||
{
|
||||
return UtilMethods.CountSubstringOccurrences(sql, "WHERE") > 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user