mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-31 15:56:25 +08:00
Add SqlFunc.BiwiseAnd BiwiselusiveOR
This commit is contained in:
parent
940b15bc17
commit
d19b004229
@ -420,5 +420,17 @@ namespace SqlSugar
|
||||
var parameter = model.Args[0];
|
||||
return string.Format(" CAST({0} AS VARCHAR(MAX))", parameter.MemberName);
|
||||
}
|
||||
public string BitwiseAnd(MethodCallExpressionModel model)
|
||||
{
|
||||
var parameter = model.Args[0];
|
||||
var parameter2 = model.Args[1];
|
||||
return string.Format(" ({0} & {1}) ", parameter.MemberName, parameter2.MemberName); ;
|
||||
}
|
||||
public string BitwiseInclusiveOR(MethodCallExpressionModel model)
|
||||
{
|
||||
var parameter = model.Args[0];
|
||||
var parameter2 = model.Args[1];
|
||||
return string.Format(" ({0} | {1}) ", parameter.MemberName, parameter2.MemberName); ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -65,5 +65,7 @@ namespace SqlSugar
|
||||
string GetDate();
|
||||
string GetRandom();
|
||||
string CharIndex(MethodCallExpressionModel model);
|
||||
string BitwiseAnd(MethodCallExpressionModel model);
|
||||
string BitwiseInclusiveOR(MethodCallExpressionModel model);
|
||||
}
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ namespace SqlSugar
|
||||
{
|
||||
return thisValue.Equals(parameterValue);
|
||||
}
|
||||
public new static bool EqualsNull(object thisValue, object parameterValue)
|
||||
public static bool EqualsNull(object thisValue, object parameterValue)
|
||||
{
|
||||
return thisValue.Equals(parameterValue);
|
||||
}
|
||||
@ -137,5 +137,7 @@ namespace SqlSugar
|
||||
public static Subqueryable<T> Subqueryable<T>() where T:class,new(){ throw new NotSupportedException("Can only be used in expressions");}
|
||||
public static CaseThen IF(bool condition) { throw new NotSupportedException("Can only be used in expressions"); }
|
||||
public static int CharIndex(string findChar,string searchValue) { throw new NotSupportedException("Can only be used in expressions"); }
|
||||
public static int BitwiseAnd(int left, int right) { throw new NotSupportedException("Can only be used in expressions"); }
|
||||
public static int BitwiseInclusiveOR(int left, int right) { throw new NotSupportedException("Can only be used in expressions"); }
|
||||
}
|
||||
}
|
||||
|
@ -664,6 +664,10 @@ namespace SqlSugar
|
||||
return this.Context.DbMehtods.GetRandom();
|
||||
case "CharIndex":
|
||||
return this.Context.DbMehtods.CharIndex(model);
|
||||
case "BitwiseAnd":
|
||||
return this.Context.DbMehtods.BitwiseAnd(model);
|
||||
case "BitwiseInclusiveOR":
|
||||
return this.Context.DbMehtods.BitwiseInclusiveOR(model);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user