mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 18:22:23 +08:00
Bug: Same table subquery update
This commit is contained in:
@@ -784,6 +784,11 @@ namespace SqlSugar
|
||||
var whereString = expResult.GetResultString();
|
||||
if (expression.ToString().Contains("Subqueryable()"))
|
||||
{
|
||||
if (ExpressionTool.GetParameters(expression).First().Type == typeof(T))
|
||||
{
|
||||
var tableName = this.SqlBuilder.GetTranslationColumnName(this.EntityInfo.DbTableName);
|
||||
whereString = whereString.Replace(tableName, $"( SELECT * FROM {tableName}) ");
|
||||
}
|
||||
whereString = whereString.Replace(this.SqlBuilder.GetTranslationColumnName(expression.Parameters.First().Name) + ".", this.SqlBuilder.GetTranslationTableName(this.EntityInfo.DbTableName) + ".");
|
||||
}
|
||||
else if (expResult.IsNavicate)
|
||||
|
Reference in New Issue
Block a user