Browse Source

-

pull/12/MERGE
sunkaixuan 7 years ago
parent
commit
c7c96b1efb
  1. 5
      Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/DefaultDbMethod.cs
  2. 1
      Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/IDbMethods.cs
  3. 4
      Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MemberExpressionResolve.cs

5
Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/DefaultDbMethod.cs

@ -294,5 +294,10 @@ namespace SqlSugar
{
return string.Join("", strings);
}
public virtual string EqualTrue(string fieldName)
{
return "( " + fieldName + "=1 )";
}
}
}

1
Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/IDbMethods.cs

@ -52,5 +52,6 @@ namespace SqlSugar
string False();
string GuidNew();
string MergeString(params string[] strings);
string EqualTrue(string value);
}
}

4
Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MemberExpressionResolve.cs

@ -127,7 +127,7 @@ namespace SqlSugar
fieldName = GetName(parameter, expression, isLeft, isSingle);
if (expression.Type == UtilConstants.BoolType && baseParameter.OperatorValue.IsNullOrEmpty())
{
fieldName = "( " + fieldName + "=1 )";
fieldName = this.Context.DbMehtods.EqualTrue(fieldName);
}
AppendMember(parameter, isLeft, fieldName);
}
@ -148,7 +148,7 @@ namespace SqlSugar
string fieldName = GetName(parameter, expression.Expression as MemberExpression, isLeft, isSingle);
if (expression.Type == UtilConstants.BoolType && baseParameter.OperatorValue.IsNullOrEmpty())
{
fieldName = "( " + fieldName + "=1 )";
fieldName = this.Context.DbMehtods.EqualTrue(fieldName);
}
AppendMember(parameter, isLeft, fieldName);
}

Loading…
Cancel
Save