mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-05 17:37:58 +08:00
修复DB2插入时日期转换问题
This commit is contained in:
parent
12249dee26
commit
db3dd58302
@ -90,9 +90,9 @@ namespace SqlSugar.DB2
|
||||
new KeyValuePair<string, CSharpDataType>("char",CSharpDataType.@string),
|
||||
new KeyValuePair<string, CSharpDataType>("clob",CSharpDataType.@string),
|
||||
|
||||
new KeyValuePair<string, CSharpDataType>("timestamp",CSharpDataType.@DateTime),
|
||||
new KeyValuePair<string, CSharpDataType>("date",CSharpDataType.@DateTime),
|
||||
new KeyValuePair<string, CSharpDataType>("time",CSharpDataType.@DateTime),
|
||||
new KeyValuePair<string, CSharpDataType>("timestamp",CSharpDataType.@DateTime),
|
||||
|
||||
new KeyValuePair<string, CSharpDataType>("integer",CSharpDataType.@int),
|
||||
new KeyValuePair<string, CSharpDataType>("smallint",CSharpDataType.@short),
|
||||
|
@ -238,7 +238,7 @@ namespace SqlSugar.DB2
|
||||
{
|
||||
var parameter = model.Args[0];
|
||||
var parameter2 = model.Args[1];
|
||||
return string.Format(" ({0} like concat('%',{1},'%')) ", parameter.MemberName, parameter2.MemberName );
|
||||
return string.Format(" ({0} like concat('%',concat({1},'%'))) ", parameter.MemberName, parameter2.MemberName );
|
||||
}
|
||||
|
||||
public override string StartsWith(MethodCallExpressionModel model)
|
||||
|
@ -90,7 +90,11 @@ namespace SqlSugar.DB2
|
||||
object value = null;
|
||||
if (it.Value is DateTime)
|
||||
{
|
||||
value = ((DateTime)it.Value).ToString("O");
|
||||
value = ((DateTime)it.Value).ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||
}
|
||||
else if (it.Value is Boolean)
|
||||
{
|
||||
value = ((Boolean)it.Value) ? 1 : 0;
|
||||
}
|
||||
else if (it.Value is DateTimeOffset)
|
||||
{
|
||||
@ -179,7 +183,7 @@ namespace SqlSugar.DB2
|
||||
}
|
||||
public override string FormatDateTimeOffset(object value)
|
||||
{
|
||||
return "'" + ((DateTimeOffset)value).ToString("o") + "'";
|
||||
return "'" + ((DateTimeOffset)value).ToString("yyyy-MM-dd HH:mm:ss.fff") + "'";
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user