mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-12-22 01:05:47 +08:00
- continue
This commit is contained in:
@@ -130,12 +130,7 @@ namespace FreeSql.Odbc.KingbaseES
|
||||
value = getParamterValue(type, value);
|
||||
var type2 = value.GetType();
|
||||
if (type2 == typeof(byte[])) return $"'\\x{CommonUtils.BytesSqlRaw(value as byte[])}'";
|
||||
if (type2 == typeof(TimeSpan) || type2 == typeof(TimeSpan?))
|
||||
{
|
||||
var ts = (TimeSpan)value;
|
||||
return $"'{Math.Min(24, (int)Math.Floor(ts.TotalHours))}:{ts.Minutes}:{ts.Seconds}'";
|
||||
}
|
||||
else if (value is Array)
|
||||
if (value is Array)
|
||||
{
|
||||
var valueArr = value as Array;
|
||||
var eleType = type2.GetElementType();
|
||||
|
||||
@@ -98,11 +98,6 @@ namespace FreeSql.Odbc.MySql
|
||||
if (value == null) return "NULL";
|
||||
if (type.IsNumberType()) return string.Format(CultureInfo.InvariantCulture, "{0}", value);
|
||||
if (type == typeof(byte[])) return $"0x{CommonUtils.BytesSqlRaw(value as byte[])}";
|
||||
if (type == typeof(TimeSpan) || type == typeof(TimeSpan?))
|
||||
{
|
||||
var ts = (TimeSpan)value;
|
||||
value = $"{Math.Floor(ts.TotalHours)}:{ts.Minutes}:{ts.Seconds}";
|
||||
}
|
||||
return FormatSql("{0}", value, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,12 +130,7 @@ namespace FreeSql.Odbc.PostgreSQL
|
||||
value = getParamterValue(type, value);
|
||||
var type2 = value.GetType();
|
||||
if (type2 == typeof(byte[])) return $"'\\x{CommonUtils.BytesSqlRaw(value as byte[])}'";
|
||||
if (type2 == typeof(TimeSpan) || type2 == typeof(TimeSpan?))
|
||||
{
|
||||
var ts = (TimeSpan)value;
|
||||
return $"'{Math.Min(24, (int)Math.Floor(ts.TotalHours))}:{ts.Minutes}:{ts.Seconds}'";
|
||||
}
|
||||
else if (value is Array)
|
||||
if (value is Array)
|
||||
{
|
||||
var valueArr = value as Array;
|
||||
var eleType = type2.GetElementType();
|
||||
|
||||
@@ -92,11 +92,6 @@ namespace FreeSql.Odbc.SqlServer
|
||||
if (value == null) return "NULL";
|
||||
if (type.IsNumberType()) return string.Format(CultureInfo.InvariantCulture, "{0}", value);
|
||||
if (type == typeof(byte[])) return $"0x{CommonUtils.BytesSqlRaw(value as byte[])}";
|
||||
if (type == typeof(TimeSpan) || type == typeof(TimeSpan?))
|
||||
{
|
||||
var ts = (TimeSpan)value;
|
||||
value = $"{ts.Hours}:{ts.Minutes}:{ts.Seconds}.{ts.Milliseconds}";
|
||||
}
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0}", (_orm.Ado as AdoProvider).AddslashesProcessParam(value, type, col));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user