diff --git a/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs b/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs index a14095742..8daa35ac0 100644 --- a/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs +++ b/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs @@ -2421,7 +2421,14 @@ namespace SqlSugar if (this.QueryBuilder.AsTables != null && this.QueryBuilder.AsTables.Count==1) { var tableinfo = this.QueryBuilder.AsTables.First(); - this.QueryBuilder.AsTables[tableinfo.Key] =" (SELECT * FROM " +this.QueryBuilder.AsTables.First().Value+")"; + if (this.Context.CurrentConnectionConfig?.MoreSettings?.IsWithNoLockQuery == true) + { + this.QueryBuilder.AsTables[tableinfo.Key] = " (SELECT * FROM " + this.QueryBuilder.AsTables.First().Value + $" {SqlWith.NoLock} )"; + } + else + { + this.QueryBuilder.AsTables[tableinfo.Key] = " (SELECT * FROM " + this.QueryBuilder.AsTables.First().Value + ")"; + } this.QueryBuilder.SelectValue = this.QueryBuilder.TableShortName +".*"; } } diff --git a/Src/Asp.NetCore2/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs b/Src/Asp.NetCore2/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs index 221e187fa..da5deae71 100644 --- a/Src/Asp.NetCore2/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs +++ b/Src/Asp.NetCore2/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs @@ -676,7 +676,10 @@ namespace SqlSugar } if (this.TableWithString.HasValue() && this.TableWithString != SqlWith.Null) { - result += TableWithString + UtilConstants.Space; + if (!result.TrimStart().StartsWith("(")) + { + result += TableWithString + UtilConstants.Space; + } } if (!this.IsSingle()) { diff --git a/Src/Asp.NetCore2/SqlSugar/Realization/Oracle/OracleProvider.cs b/Src/Asp.NetCore2/SqlSugar/Realization/Oracle/OracleProvider.cs index 3845234ee..91f2f27d8 100644 --- a/Src/Asp.NetCore2/SqlSugar/Realization/Oracle/OracleProvider.cs +++ b/Src/Asp.NetCore2/SqlSugar/Realization/Oracle/OracleProvider.cs @@ -203,6 +203,11 @@ namespace SqlSugar sqlParameter.Value = parameter.Value; sqlParameter.DbType = System.Data.DbType.DateTime; } + else if (parameter.DbType == System.Data.DbType.Date) + { + sqlParameter.Value = parameter.Value; + sqlParameter.DbType = System.Data.DbType.Date; + } else if (parameter.DbType == System.Data.DbType.AnsiStringFixedLength) { sqlParameter.DbType = System.Data.DbType.AnsiStringFixedLength; diff --git a/Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/PostgreSQLProvider.cs b/Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/PostgreSQLProvider.cs index c6e2848b5..41ac202f6 100644 --- a/Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/PostgreSQLProvider.cs +++ b/Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/PostgreSQLProvider.cs @@ -119,6 +119,10 @@ namespace SqlSugar { sqlParameter.NpgsqlDbType = NpgsqlDbType.Integer | NpgsqlDbType.Array; } + else if (parameter.DbType.IsIn(System.Data.DbType.Int16)) + { + sqlParameter.NpgsqlDbType = NpgsqlDbType.Smallint | NpgsqlDbType.Array; + } else if (parameter.DbType.IsIn(System.Data.DbType.Int64)) { sqlParameter.NpgsqlDbType = NpgsqlDbType.Bigint | NpgsqlDbType.Array;