mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-05 17:37:58 +08:00
Update subquery
This commit is contained in:
parent
3afb8ce813
commit
5472b5d8bc
@ -186,9 +186,9 @@ namespace SqlSugar
|
||||
{
|
||||
var asName = this.context.GetTranslationTableName(asItems.First().Replace(subKey, ""), false);
|
||||
var repKey = $"\\{this.context.SqlTranslationLeft}.+\\{this.context.SqlTranslationRight}";
|
||||
if (this.context.CurrentShortName.HasValue())
|
||||
if (this.context.IsSingle&&this.context.JoinIndex==0&&this.context.CurrentShortName.HasValue()&& isAsAttr&& !asName.Contains(this.context.CurrentShortName))
|
||||
{
|
||||
asName = asName + " " + this.context.CurrentShortName;
|
||||
asName = asName + " " + this.context.CurrentShortName+" ";
|
||||
}
|
||||
sqlItems[i] = Regex.Replace(sqlItems[i], repKey, asName);
|
||||
}
|
||||
@ -200,7 +200,13 @@ namespace SqlSugar
|
||||
{
|
||||
if (sqlItems[i].StartsWith("FROM " + this.context.SqlTranslationLeft))
|
||||
{
|
||||
sqlItems[i] = sqlItems[i]+" "+this.context.CurrentShortName +" ";
|
||||
if (isAsAttr&&sqlItems[i].EndsWith(this.context.CurrentShortName + " "))
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
sqlItems[i] = sqlItems[i] + " " + this.context.CurrentShortName + " ";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user