ConditionalModel传带时区的时间(DateTimeOffset),生成的Sql会截断时区 返回

SqlSugar 处理完成
3 76
该叫什么 肘子 发布于6天前
悬赏:0 飞吻

ConditionalModel传带时区的时间(DateTimeOffset),生成的Sql会截断时区

复现代码:

List<IConditionalModel> condi = new List<IConditionalModel>
{
    new ConditionalModel
    {
        FieldName = nameof(SysUser.CreateTime),
        FieldValue = "2024-06-11 00:00:00 +08:00",
        ConditionalType = ConditionalType.LessThan,
        CSharpTypeName = typeof(DateTimeOffset).Name
    }
};
var users = db.Queryable<SysUser>().Where(condi).ToList();

生成的Sql:

SELECT [LoginId],[LoginPassword],[Picture],[Gender],[Phone],[DingDing],[WeChat],[FactoryIds],[IsLocked],[NFC],[IsForcedChangePwd],[PwdExpireTime],[LoginErrorCount],[ChangeCount],[TokenExpired],[FactoryId],[Name],[Remark],[Sort],[SystemOperatorId],[SystemOperateTime],[Notes],[PostIds],[UserIds],[Id],[IsDeleted],[VersionLock],[CreatorId],[CreateTime],[LastModifierId],[LastModifyTime] FROM [SysUser]  WHERE   [CreateTime] < @ConditCreateTime0
      @ConditCreateTime0:6/11/2024 00:00:00 +00:00(DateTimeOffset),


数据库:SqlServer

SqlSugar版本:5.1.4.154

热忱回答3