mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 20:38:16 +08:00
- 优化 表达式对整数除法的处理,解析为整除;
This commit is contained in:
@ -74,6 +74,8 @@ namespace FreeSql.MySql
|
||||
public override string IsNull(string sql, object value) => $"ifnull({sql}, {value})";
|
||||
public override string StringConcat(string[] objs, Type[] types) => $"concat({string.Join(", ", objs)})";
|
||||
public override string Mod(string left, string right, Type leftType, Type rightType) => $"{left} % {right}";
|
||||
public override string Div(string left, string right, Type leftType, Type rightType) => $"{left} div {right}";
|
||||
|
||||
public override string QuoteWriteParamter(Type type, string paramterName)
|
||||
{
|
||||
switch (type.FullName)
|
||||
@ -87,7 +89,6 @@ namespace FreeSql.MySql
|
||||
}
|
||||
return paramterName;
|
||||
}
|
||||
|
||||
public override string QuoteReadColumn(Type type, string columnName)
|
||||
{
|
||||
switch (type.FullName)
|
||||
|
@ -82,6 +82,8 @@ namespace FreeSql.MySql
|
||||
public override string IsNull(string sql, object value) => $"ifnull({sql}, {value})";
|
||||
public override string StringConcat(string[] objs, Type[] types) => $"concat({string.Join(", ", objs)})";
|
||||
public override string Mod(string left, string right, Type leftType, Type rightType) => $"{left} % {right}";
|
||||
public override string Div(string left, string right, Type leftType, Type rightType) => $"{left} div {right}";
|
||||
|
||||
public override string QuoteWriteParamter(Type type, string paramterName)
|
||||
{
|
||||
switch (type.FullName)
|
||||
@ -95,7 +97,6 @@ namespace FreeSql.MySql
|
||||
}
|
||||
return paramterName;
|
||||
}
|
||||
|
||||
public override string QuoteReadColumn(Type type, string columnName)
|
||||
{
|
||||
switch (type.FullName)
|
||||
|
@ -64,6 +64,7 @@ namespace FreeSql.Oracle
|
||||
public override string IsNull(string sql, object value) => $"nvl({sql}, {value})";
|
||||
public override string StringConcat(string[] objs, Type[] types) => $"{string.Join(" || ", objs)}";
|
||||
public override string Mod(string left, string right, Type leftType, Type rightType) => $"mod({left}, {right})";
|
||||
public override string Div(string left, string right, Type leftType, Type rightType) => $"trunc({left} / {right})";
|
||||
|
||||
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
||||
public override string QuoteReadColumn(Type type, string columnName) => columnName;
|
||||
|
@ -126,6 +126,7 @@ namespace FreeSql.PostgreSQL
|
||||
public override string IsNull(string sql, object value) => $"coalesce({sql}, {value})";
|
||||
public override string StringConcat(string[] objs, Type[] types) => $"{string.Join(" || ", objs)}";
|
||||
public override string Mod(string left, string right, Type leftType, Type rightType) => $"{left} % {right}";
|
||||
public override string Div(string left, string right, Type leftType, Type rightType) => $"{left} / {right}";
|
||||
|
||||
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
||||
public override string QuoteReadColumn(Type type, string columnName) => columnName;
|
||||
|
@ -66,6 +66,7 @@ namespace FreeSql.SqlServer
|
||||
return string.Join(" + ", news);
|
||||
}
|
||||
public override string Mod(string left, string right, Type leftType, Type rightType) => $"{left} % {right}";
|
||||
public override string Div(string left, string right, Type leftType, Type rightType) => $"{left} / {right}";
|
||||
|
||||
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
||||
public override string QuoteReadColumn(Type type, string columnName) => columnName;
|
||||
|
@ -79,6 +79,7 @@ namespace FreeSql.Sqlite
|
||||
public override string IsNull(string sql, object value) => $"ifnull({sql}, {value})";
|
||||
public override string StringConcat(string[] objs, Type[] types) => $"{string.Join(" || ", objs)}";
|
||||
public override string Mod(string left, string right, Type leftType, Type rightType) => $"{left} % {right}";
|
||||
public override string Div(string left, string right, Type leftType, Type rightType) => $"{left} / {right}";
|
||||
|
||||
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
||||
public override string QuoteReadColumn(Type type, string columnName) => columnName;
|
||||
|
Reference in New Issue
Block a user