mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-06-28 13:34:32 +08:00
-
This commit is contained in:
parent
c342f11fe8
commit
e0e1f1a554
Binary file not shown.
@ -22,7 +22,7 @@ namespace SqlSugar
|
||||
public int Index { get; set; }
|
||||
public ResolveExpressType Type { get; set; }
|
||||
public Expression Expression { get; set; }
|
||||
public StringBuilder SqlWhere { get; set; }
|
||||
public StringBuilder ResultString { get; set; }
|
||||
public bool IsWhereSingle
|
||||
{
|
||||
get
|
||||
@ -60,8 +60,8 @@ namespace SqlSugar
|
||||
{
|
||||
BaseResolve resolve = new BaseResolve(new ExpressionParameter() { Expression = this.Expression, Context = this });
|
||||
resolve.Start();
|
||||
if (this.SqlWhere == null) return string.Empty;
|
||||
return this.SqlWhere.ToString();
|
||||
if (this.ResultString == null) return string.Empty;
|
||||
return this.ResultString.ToString();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
@ -28,21 +28,21 @@ namespace SqlSugar
|
||||
string leftString = GetLeftString(parameter);
|
||||
string rightString = GetRightString(parameter);
|
||||
string binarySql =string.Format(ExpressionConst.BinaryFormatString,leftString,operatorValue,rightString);
|
||||
string sqlWhereString = base.Context.SqlWhere.ObjToString();
|
||||
if (base.Context.SqlWhere == null) {
|
||||
base.Context.SqlWhere = new StringBuilder();
|
||||
string sqlWhereString = base.Context.ResultString.ObjToString();
|
||||
if (base.Context.ResultString == null) {
|
||||
base.Context.ResultString = new StringBuilder();
|
||||
}
|
||||
if (sqlWhereString.Contains(ExpressionConst.Format0))
|
||||
{
|
||||
base.Context.SqlWhere.Replace(ExpressionConst.Format0, binarySql);
|
||||
base.Context.ResultString.Replace(ExpressionConst.Format0, binarySql);
|
||||
}
|
||||
else
|
||||
{
|
||||
base.Context.SqlWhere.Append(binarySql);
|
||||
base.Context.ResultString.Append(binarySql);
|
||||
}
|
||||
if (sqlWhereString.Contains(ExpressionConst.Format1))
|
||||
{
|
||||
base.Context.SqlWhere.Replace(ExpressionConst.Format1, ExpressionConst.Format0);
|
||||
base.Context.ResultString.Replace(ExpressionConst.Format1, ExpressionConst.Format0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,12 +22,12 @@ namespace SqlSugar
|
||||
fieldName = GetFiledNameByWhereMultiple(parameter, expression, isLeft);
|
||||
break;
|
||||
case ResolveExpressType.SelectSingle:
|
||||
base.Context.SqlWhere = new StringBuilder();
|
||||
base.Context.SqlWhere.Append(fieldName);
|
||||
base.Context.ResultString = new StringBuilder();
|
||||
base.Context.ResultString.Append(fieldName);
|
||||
break;
|
||||
case ResolveExpressType.SelectMultiple:
|
||||
base.Context.SqlWhere = new StringBuilder();
|
||||
base.Context.SqlWhere.Append(fieldName);
|
||||
base.Context.ResultString = new StringBuilder();
|
||||
base.Context.ResultString.Append(fieldName);
|
||||
break;
|
||||
case ResolveExpressType.FieldSingle:
|
||||
break;
|
||||
|
@ -33,10 +33,10 @@ namespace SqlSugar
|
||||
ExpressionType = ExpressionConst.ConstantExpressionType
|
||||
}));
|
||||
}
|
||||
if (isLeft == null && base.Context.SqlWhere == null)
|
||||
if (isLeft == null && base.Context.ResultString == null)
|
||||
{
|
||||
base.Context.SqlWhere = new StringBuilder();
|
||||
base.Context.SqlWhere.Append(value);
|
||||
base.Context.ResultString = new StringBuilder();
|
||||
base.Context.ResultString.Append(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user