Synchronization code

This commit is contained in:
sunkaixuan 2023-06-07 17:12:32 +08:00
parent b9c19ba4e5
commit 7d4dc4a558
3 changed files with 5 additions and 2 deletions

View File

@ -9,6 +9,7 @@ namespace SqlSugar
{ {
public partial class DefaultDbMethod : IDbMethods public partial class DefaultDbMethod : IDbMethods
{ {
public virtual string ParameterKeyWord { get; set; }= "@";
public virtual string RowNumber(MethodCallExpressionModel model) public virtual string RowNumber(MethodCallExpressionModel model)
{ {
if (model.Args.Count == 1) if (model.Args.Count == 1)
@ -901,7 +902,7 @@ namespace SqlSugar
} }
} }
//Regex regex = new Regex("\@"); //Regex regex = new Regex("\@");
if (!sql.Contains("@")) if (!sql.Contains(ParameterKeyWord))
{ {
sql = sql.Replace(" =)", $" = {newValue})"); sql = sql.Replace(" =)", $" = {newValue})");
if (!sql.Contains(newValue)) if (!sql.Contains(newValue))
@ -911,7 +912,7 @@ namespace SqlSugar
} }
else else
{ {
Regex reg = new Regex(@"@MethodConst\d+"); Regex reg = new Regex(ParameterKeyWord + @"MethodConst\d+");
sql = reg.Replace(sql, it => sql = reg.Replace(sql, it =>
{ {
return " " + newValue + " "; return " " + newValue + " ";

View File

@ -54,6 +54,7 @@ namespace SqlSugar
} }
public partial class DmMethod : DefaultDbMethod, IDbMethods public partial class DmMethod : DefaultDbMethod, IDbMethods
{ {
public override string ParameterKeyWord { get; set; } = ":";
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}) ";

View File

@ -72,6 +72,7 @@ namespace SqlSugar
} }
public partial class OracleMethod : DefaultDbMethod, IDbMethods public partial class OracleMethod : DefaultDbMethod, IDbMethods
{ {
public override string ParameterKeyWord { get; set; } = ":";
public override string Modulo(MethodCallExpressionModel model) public override string Modulo(MethodCallExpressionModel model)
{ {
return " MOD(" + model.Args[0].MemberName+ " , " + model.Args[1].MemberName+")"; return " MOD(" + model.Args[0].MemberName+ " , " + model.Args[1].MemberName+")";