mirror of
https://github.com/dotnetcore/FreeSql.git
synced 2026-02-08 09:20:55 +08:00
- 修复 */表达式解析问题;#1836
This commit is contained in:
@@ -946,10 +946,11 @@ namespace FreeSql.Internal
|
||||
if (right == "NULL") oper = oper == "=" ? " IS " : " IS NOT ";
|
||||
switch (oper)
|
||||
{
|
||||
case "%": return _common.Mod(left, right, leftExp.Type, rightExp.Type);
|
||||
case "*": return $"({left} {oper} {right})";
|
||||
case "%": return $"({_common.Mod(left, right, leftExp.Type, rightExp.Type)})";
|
||||
case "/":
|
||||
if (leftExp.Type.IsIntegerType() && rightExp.Type.IsIntegerType()) return _common.Div(left, right, leftExp.Type, rightExp.Type);
|
||||
break;
|
||||
if (leftExp.Type.IsIntegerType() && rightExp.Type.IsIntegerType()) return $"({_common.Div(left, right, leftExp.Type, rightExp.Type)})";
|
||||
return $"({left} {oper} {right})";
|
||||
case "AND":
|
||||
case "OR":
|
||||
if (leftMapColumn != null) left = $"{left} = {formatSql(true, leftMapColumn.Attribute.MapType, null, null)}";
|
||||
|
||||
Reference in New Issue
Block a user