Update 人大金仓

This commit is contained in:
sunkaixuan
2025-06-05 15:54:30 +08:00
parent a1dfcd4445
commit 490233f679
2 changed files with 13 additions and 1 deletions

View File

@@ -88,7 +88,7 @@ namespace SqlSugar
} }
else if (IsSqlOracleModel()&& it.Value is TimeSpan timeSpan) else if (IsSqlOracleModel()&& it.Value is TimeSpan timeSpan)
{ {
return $"{timeSpan.Days} {timeSpan.Hours:00}:{timeSpan.Minutes:00}:{timeSpan.Seconds:00}.{timeSpan.Milliseconds:000}{timeSpan.Ticks % 10000:0000}"; return $"'{timeSpan.Days} {timeSpan.Hours:00}:{timeSpan.Minutes:00}:{timeSpan.Seconds:00}.{timeSpan.Milliseconds:000}{timeSpan.Ticks % 10000:0000}'";
} }
else if (it.Value is bool&& (IsMySqlModel()|| IsSqlServerModel())) else if (it.Value is bool&& (IsMySqlModel()|| IsSqlServerModel()))
{ {

View File

@@ -69,6 +69,14 @@ namespace SqlSugar
{ {
return value.ObjToBool() ? "1" : "0"; return value.ObjToBool() ? "1" : "0";
} }
else if (value is DateTimeOffset)
{
return FormatDateTimeOffset(value);
}
else if (IsSqlOracleModel() && value is TimeSpan timeSpan)
{
return $"'{timeSpan.Days} {timeSpan.Hours:00}:{timeSpan.Minutes:00}:{timeSpan.Seconds:00}.{timeSpan.Milliseconds:000}{timeSpan.Ticks % 10000:0000}'";
}
else if (type == UtilConstants.StringType || type == UtilConstants.ObjType) else if (type == UtilConstants.StringType || type == UtilConstants.ObjType)
{ {
return "'" + value.ToString().ToSqlFilter() + "'"; return "'" + value.ToString().ToSqlFilter() + "'";
@@ -268,5 +276,9 @@ namespace SqlSugar
var date = UtilMethods.ConvertFromDateTimeOffset((DateTimeOffset)value); var date = UtilMethods.ConvertFromDateTimeOffset((DateTimeOffset)value);
return "'" + date.ToString("yyyy-MM-dd HH:mm:ss.fff zzz") + "'"; return "'" + date.ToString("yyyy-MM-dd HH:mm:ss.fff zzz") + "'";
} }
private bool IsSqlOracleModel()
{
return this.Context?.CurrentConnectionConfig?.MoreSettings?.DatabaseModel == DbType.Oracle;
}
} }
} }