mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-01 10:10:16 +08:00
Synchronization code
This commit is contained in:
parent
9107999bbb
commit
7bf259d9a9
@ -178,15 +178,12 @@ namespace SqlSugar
|
|||||||
var select = copyContext.Result.GetString();
|
var select = copyContext.Result.GetString();
|
||||||
if (dic.Count > 0 && appendColumns.Count == 0)
|
if (dic.Count > 0 && appendColumns.Count == 0)
|
||||||
{
|
{
|
||||||
if (copyContext.Parameters?.Any()==true)
|
select = AppendParameter(copyContext, select);
|
||||||
{
|
|
||||||
this.Context.Parameters.AddRange(copyContext.Parameters);
|
|
||||||
select = select.Replace("), AS", ") AS");
|
|
||||||
}
|
|
||||||
return select + ",@sugarIndex as sugarIndex"; ;
|
return select + ",@sugarIndex as sugarIndex"; ;
|
||||||
}
|
}
|
||||||
else if (dic.Count > 0 && appendColumns.Count > 0)
|
else if (dic.Count > 0 && appendColumns.Count > 0)
|
||||||
{
|
{
|
||||||
|
select = AppendParameter(copyContext, select);
|
||||||
return select+","+string.Join(",",appendColumns) + ",@sugarIndex as sugarIndex"; ;
|
return select+","+string.Join(",",appendColumns) + ",@sugarIndex as sugarIndex"; ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -194,6 +191,17 @@ namespace SqlSugar
|
|||||||
return string.Join(",", appendColumns) + ",@sugarIndex as sugarIndex";
|
return string.Join(",", appendColumns) + ",@sugarIndex as sugarIndex";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string AppendParameter(ExpressionContext copyContext, string select)
|
||||||
|
{
|
||||||
|
if (copyContext.Parameters?.Any() == true)
|
||||||
|
{
|
||||||
|
this.Context.Parameters.AddRange(copyContext.Parameters);
|
||||||
|
select = select.Replace("), AS", ") AS");
|
||||||
|
}
|
||||||
|
return select;
|
||||||
|
}
|
||||||
|
|
||||||
private static bool IsAutoSelect(MethodCallExpression exp)
|
private static bool IsAutoSelect(MethodCallExpression exp)
|
||||||
{
|
{
|
||||||
return exp.Arguments.Count == 2 && exp.Arguments.Last().Type == UtilConstants.BoolType;
|
return exp.Arguments.Count == 2 && exp.Arguments.Last().Type == UtilConstants.BoolType;
|
||||||
|
Loading…
Reference in New Issue
Block a user