Update utils method

This commit is contained in:
sunkaixuan
2023-12-15 18:37:41 +08:00
parent 0149cd4936
commit b58959c32c
2 changed files with 5 additions and 1 deletions

View File

@@ -2,7 +2,7 @@
<package >
<metadata>
<id>SqlSugarCore</id>
<version>5.1.4.127</version>
<version>5.1.4.128-preview03</version>
<authors>sunkaixuan</authors>
<owners>果糖大数据科技</owners>
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>

View File

@@ -1384,6 +1384,10 @@ namespace SqlSugar
{
result = result.Replace(item.ParameterName, item.Value.ObjToString());
}
else if (item.Value is DateTime&&connectionConfig.DbType==DbType.SqlServer)
{
result = result.Replace(item.ParameterName, "CAST('" + item.Value.ObjToDate().ToString("yyyy-MM-dd HH:mm:ss.fff") + "' AS DATETIME)");
}
else if (item.Value is DateTime)
{
result = result.Replace(item.ParameterName, "'"+item.Value.ObjToDate().ToString("yyyy-MM-dd HH:mm:ss.fff")+"'");