- 修复 Oracle 表达式 DateTime.Subtract(DateTime) 解析 bug;

This commit is contained in:
28810 2019-07-30 18:31:39 +08:00
parent 53cd4f17e1
commit fcf52f3998
2 changed files with 4 additions and 1 deletions

View File

@ -341,6 +341,9 @@ namespace FreeSql.Tests
[Fact]
public void Test1()
{
var kfkfjdfg = g.oracle.Select<Templates>().Where(a => (DateTime.Now - a.EditTime).TotalMinutes > 100).ToSql();
g.oracle.Aop.SyncStructureAfter += (s, e) =>
Trace.WriteLine(e.Sql);

View File

@ -378,7 +378,7 @@ namespace FreeSql.Oracle
case "Subtract":
switch ((exp.Arguments[0].Type.IsNullableType() ? exp.Arguments[0].Type.GenericTypeArguments.FirstOrDefault() : exp.Arguments[0].Type).FullName)
{
case "System.DateTime": return $"({args1}-{left})";
case "System.DateTime": return $"numtodsinterval(({left}+0)-({args1}+0),'day')";
case "System.TimeSpan": return $"({left}-{args1})";
}
break;