mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 10:08:19 +08:00
修复DB2插入时日期转换问题
This commit is contained in:
@@ -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") + "'";
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user