Synchronization code

This commit is contained in:
sunkaixuan
2023-11-04 18:25:38 +08:00
parent c373cb80a8
commit 9f2f40884f

View File

@@ -51,6 +51,31 @@ namespace SqlSugar
}
return result;
}
public override object FormatValue(object value)
{
if (value != null && value is DateTime)
{
var date = value.ObjToDate();
if (date < UtilMethods.GetMinDate(this.Context.CurrentConnectionConfig))
{
date = UtilMethods.GetMinDate(this.Context.CurrentConnectionConfig);
}
if (this.Context.CurrentConnectionConfig?.MoreSettings?.DisableMillisecond == true)
{
return "to_date('" + date.ToString("yyyy-MM-dd HH:mm:ss") + "', 'YYYY-MM-DD HH24:MI:SS') ";
}
else
{
return "to_timestamp('" + date.ToString("yyyy-MM-dd HH:mm:ss.ffffff") + "', 'YYYY-MM-DD HH24:MI:SS.FF') ";
}
}
else
{
return base.FormatValue(value);
}
}
//public override string ToSqlString()
//{
// if (IsNoInsertNull)