mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-23 04:23:47 +08:00
Synchronization code
This commit is contained in:
@@ -817,5 +817,10 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
return $"{dataBaseName}.{tableName}";
|
return $"{dataBaseName}.{tableName}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual string Modulo(MethodCallExpressionModel model)
|
||||||
|
{
|
||||||
|
return "("+model.Args[0].MemberName + " % "+ model.Args[1].MemberName+")";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -107,5 +107,6 @@ namespace SqlSugar
|
|||||||
string SplitIn(MethodCallExpressionModel model);
|
string SplitIn(MethodCallExpressionModel model);
|
||||||
string ListAny(MethodCallExpressionModel model);
|
string ListAny(MethodCallExpressionModel model);
|
||||||
string GetTableWithDataBase(string databaseName,string tableName);
|
string GetTableWithDataBase(string databaseName,string tableName);
|
||||||
|
string Modulo(MethodCallExpressionModel mode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -9,6 +9,10 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
public partial class SqlFunc
|
public partial class SqlFunc
|
||||||
{
|
{
|
||||||
|
public static int Modulo(decimal numA, decimal numB)
|
||||||
|
{
|
||||||
|
throw new NotSupportedException("Can only be used in expressions");
|
||||||
|
}
|
||||||
public static int CompareTo(decimal numA, decimal numB)
|
public static int CompareTo(decimal numA, decimal numB)
|
||||||
{
|
{
|
||||||
throw new NotSupportedException("Can only be used in expressions");
|
throw new NotSupportedException("Can only be used in expressions");
|
||||||
|
@@ -835,6 +835,8 @@ namespace SqlSugar
|
|||||||
case "ListAny":
|
case "ListAny":
|
||||||
this.Context.Parameters.RemoveAll(it => model.Args[0].MemberName.ObjToString().Contains(it.ParameterName));
|
this.Context.Parameters.RemoveAll(it => model.Args[0].MemberName.ObjToString().Contains(it.ParameterName));
|
||||||
return this.Context.DbMehtods.ListAny(model);
|
return this.Context.DbMehtods.ListAny(model);
|
||||||
|
case "Modulo":
|
||||||
|
return this.Context.DbMehtods.Modulo(model);
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -72,6 +72,10 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
public partial class OracleMethod : DefaultDbMethod, IDbMethods
|
public partial class OracleMethod : DefaultDbMethod, IDbMethods
|
||||||
{
|
{
|
||||||
|
public override string Modulo(MethodCallExpressionModel model)
|
||||||
|
{
|
||||||
|
return " MOD(" + model.Args[0].MemberName+ " , " + model.Args[1].MemberName+")";
|
||||||
|
}
|
||||||
public override string GetStringJoinSelector(string result, string separator)
|
public override string GetStringJoinSelector(string result, string separator)
|
||||||
{
|
{
|
||||||
return $"listagg(to_char({result}),'{separator}') within group(order by {result}) ";
|
return $"listagg(to_char({result}),'{separator}') within group(order by {result}) ";
|
||||||
|
Reference in New Issue
Block a user