mirror of
https://github.com/dotnetcore/FreeSql.git
synced 2026-02-18 22:30:56 +08:00
- 优化 DateTime.Subtract 统一得到秒差值;
This commit is contained in:
@@ -488,8 +488,7 @@ namespace FreeSql.Duckdb
|
||||
case "Subtract":
|
||||
switch ((exp.Arguments[0].Type.IsNullableType() ? exp.Arguments[0].Type.GetGenericArguments().FirstOrDefault() : exp.Arguments[0].Type).FullName)
|
||||
{
|
||||
case "System.DateTime": return $"cast((epoch({left})-epoch({args1}))||' seconds' as interval)";
|
||||
case "System.TimeSpan": return $"date_add({left},{args1})";
|
||||
case "System.DateTime": return $"(epoch({left})-epoch({args1}))";
|
||||
}
|
||||
break;
|
||||
case "Equals": return $"({left} = {args1})";
|
||||
|
||||
Reference in New Issue
Block a user