Synchronization code

This commit is contained in:
sunkaixuan 2023-12-15 19:02:14 +08:00
parent e66d53273b
commit d92ef16298
2 changed files with 6 additions and 1 deletions

View File

@ -2210,8 +2210,9 @@ namespace SqlSugar
};
var value = UtilMethods.GetSqlString(config.DbType, "@p", p, true);
sql = sql.Replace(re.Name, value);
sql = SqlBuilder.RemoveParentheses(sql);
}
sql = SqlBuilder.RemoveParentheses(sql);
sql = sql.Replace("@sugarIndex", index + "");
sqls.Add(sql);

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")+"'");