mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2026-02-27 16:50:33 +08:00
Update exp to sql
This commit is contained in:
@@ -209,6 +209,7 @@ namespace SqlSugar
|
||||
else if (expResult.IsNavicate)
|
||||
{
|
||||
whereString = whereString.Replace(expression.Parameters.First().Name + ".", this.SqlBuilder.GetTranslationTableName(this.EntityInfo.DbTableName) + ".");
|
||||
whereString = whereString.Replace(this.SqlBuilder.GetTranslationColumnName(expression.Parameters.First().Name) + ".", this.SqlBuilder.GetTranslationTableName(this.EntityInfo.DbTableName) + ".");
|
||||
}
|
||||
DeleteBuilder.WhereInfos.Add(whereString);
|
||||
return this;
|
||||
|
||||
@@ -572,6 +572,7 @@ namespace SqlSugar
|
||||
else if (expResult.IsNavicate)
|
||||
{
|
||||
whereString = whereString.Replace(expression.Parameters.First().Name + ".", this.SqlBuilder.GetTranslationTableName(this.EntityInfo.DbTableName) + ".");
|
||||
whereString = whereString.Replace(this.SqlBuilder.GetTranslationColumnName(expression.Parameters.First().Name) + ".", this.SqlBuilder.GetTranslationTableName(this.EntityInfo.DbTableName) + ".");
|
||||
}
|
||||
UpdateBuilder.WhereValues.Add(whereString);
|
||||
return this;
|
||||
|
||||
@@ -85,7 +85,11 @@ namespace SqlSugar
|
||||
}
|
||||
|
||||
var selfParameterName = this.Context.GetTranslationColumnName((argExp as LambdaExpression).Parameters.First().Name) + UtilConstants.Dot;
|
||||
if (this.Context.JoinIndex == 0)
|
||||
if (this.Context.JoinIndex == 0 && result.Contains(" FROM "))
|
||||
{
|
||||
this.Context.CurrentShortName = selfParameterName;
|
||||
}
|
||||
else if (this.Context.JoinIndex == 0)
|
||||
result = result.Replace(selfParameterName, SubTools.GetSubReplace(this.Context));
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -87,7 +87,11 @@ namespace SqlSugar
|
||||
}
|
||||
|
||||
var selfParameterName = Context.GetTranslationColumnName((argExp as LambdaExpression).Parameters.First().Name) + UtilConstants.Dot;
|
||||
if (this.Context.JoinIndex == 0)
|
||||
if (this.Context.JoinIndex == 0&&result.Contains(" FROM "))
|
||||
{
|
||||
this.Context.CurrentShortName= selfParameterName;
|
||||
}
|
||||
else if (this.Context.JoinIndex == 0)
|
||||
result = result.Replace(selfParameterName, SubTools.GetSubReplace(this.Context));
|
||||
if (!string.IsNullOrEmpty(selfParameterName) && this.Context.IsSingle&& this.Context.JoinIndex == 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user