mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-26 02:39:14 +08:00
Update : queryable.ToSqlString()
This commit is contained in:
@@ -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()}'");
|
||||
|
||||
Reference in New Issue
Block a user