Synchronization code

This commit is contained in:
sunkaixuan 2024-04-22 19:28:14 +08:00
parent d41dd183e2
commit 4ba79e9225
2 changed files with 10 additions and 6 deletions

View File

@ -1552,10 +1552,18 @@ namespace SqlSugar
else if (item.Value is DateTime)
{
result = result.Replace(item.ParameterName, "'"+item.Value.ObjToDate().ToString("yyyy-MM-dd HH:mm:ss.fff")+"'");
}
else if (item.IsArray)
{
result = result.Replace(item.ParameterName, "'{" + new SerializeService().SerializeObject(item.Value).TrimStart('[').TrimEnd(']') + "}'");
}
else if (item.Value is byte[]&&connectionConfig.DbType==DbType.PostgreSQL)
{
result = result.Replace(item.ParameterName, "E'0x" + BitConverter.ToString((byte[])item.Value).Replace("-", "")+"'" );
}
else if (item.Value is byte[])
{
result = result.Replace(item.ParameterName, "0x" + BitConverter.ToString((byte[])item.Value));
result = result.Replace(item.ParameterName, "0x" + BitConverter.ToString((byte[])item.Value).Replace("-",""));
}
else if (item.Value is bool)
{
@ -1578,10 +1586,6 @@ namespace SqlSugar
{
result = result.Replace(item.ParameterName, $"'{item.Value.ObjToString().ToSqlFilter()}'");
}
else if (item.IsArray)
{
result = result.Replace(item.ParameterName, "'{" + new SerializeService().SerializeObject(item.Value).TrimStart('[').TrimEnd(']') + "}'");
}
else
{
result = result.Replace(item.ParameterName, $"N'{item.Value.ObjToString().ToSqlFilter()}'");

View File

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