From d4eb924900e8ac8fafe5371de5681e0fc4dedf8f Mon Sep 17 00:00:00 2001 From: "guoshun.du" Date: Tue, 9 Sep 2025 20:40:57 +0800 Subject: [PATCH] =?UTF-8?q?1.this=3F.Context=3F.Case=20=E4=B8=8D=E7=AD=89?= =?UTF-8?q?=E4=BA=8E=E5=88=A4=E6=96=AD=202.OceanBaseForOracle=E5=92=8CTDSQ?= =?UTF-8?q?LForODBC=E9=87=8D=E5=86=99Case?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SqlBuilder/OceanBaseForOracleExpressionContext.cs | 3 ++- .../TDSQLForPG/SqlBuilder/TDSQLForPGODBCExpressionContext.cs | 3 ++- .../SqlSugar/ExpressionsToSql/Subquery/Items/SubTake.cs | 5 +---- .../SqlSugar/ExpressionsToSql/Subquery/Items/SubTop.cs | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Src/Asp.NetCore2/SqlSugar.OceanBaseForOracle/OceanBase/SqlBuilder/OceanBaseForOracleExpressionContext.cs b/Src/Asp.NetCore2/SqlSugar.OceanBaseForOracle/OceanBase/SqlBuilder/OceanBaseForOracleExpressionContext.cs index 31c8bc592..5fc03c9aa 100644 --- a/Src/Asp.NetCore2/SqlSugar.OceanBaseForOracle/OceanBase/SqlBuilder/OceanBaseForOracleExpressionContext.cs +++ b/Src/Asp.NetCore2/SqlSugar.OceanBaseForOracle/OceanBase/SqlBuilder/OceanBaseForOracleExpressionContext.cs @@ -16,6 +16,7 @@ namespace SqlSugar.OceanBaseForOracle public OceanBaseForOracleExpressionContext() { base.DbMehtods = new OceanBaseForOracleMethod(); + base.Case = new ExpressionContextCase(); } public override string SqlParameterKeyWord { @@ -76,7 +77,7 @@ namespace SqlSugar.OceanBaseForOracle public override string GetLimit() { int num = 1; - if (this.Case?.Num != 1) + if (this.Case?.Num > 1) { num = this.Case.Num; } diff --git a/Src/Asp.NetCore2/SqlSugar.TDSQLForPGODBC/TDSQLForPG/SqlBuilder/TDSQLForPGODBCExpressionContext.cs b/Src/Asp.NetCore2/SqlSugar.TDSQLForPGODBC/TDSQLForPG/SqlBuilder/TDSQLForPGODBCExpressionContext.cs index 05cb81a82..c8b713ef9 100644 --- a/Src/Asp.NetCore2/SqlSugar.TDSQLForPGODBC/TDSQLForPG/SqlBuilder/TDSQLForPGODBCExpressionContext.cs +++ b/Src/Asp.NetCore2/SqlSugar.TDSQLForPGODBC/TDSQLForPG/SqlBuilder/TDSQLForPGODBCExpressionContext.cs @@ -8,6 +8,7 @@ namespace SqlSugar.TDSQLForPGODBC public TDSQLForPGODBCExpressionContext() { base.DbMehtods = new TDSQLForPGODBCMethod(); + base.Case = new ExpressionContextCase(); } public override string SqlTranslationLeft { @@ -134,7 +135,7 @@ namespace SqlSugar.TDSQLForPGODBC public override string GetLimit() { int num = 1; - if (this.Case.Num != 1) + if (this.Case.Num > 1) { num = this.Case.Num; } diff --git a/Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/Subquery/Items/SubTake.cs b/Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/Subquery/Items/SubTake.cs index 534fa0a5d..3270810e6 100644 --- a/Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/Subquery/Items/SubTake.cs +++ b/Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/Subquery/Items/SubTake.cs @@ -82,12 +82,9 @@ namespace SqlSugar } else if (this.Context.GetLimit() != null) { - if (this?.Context?.Case?.HasWhere == true) + if (this?.Context?.Case != null) { this.Context.Case.HasWhere = this.HasWhere; - } - if (this?.Context?.Case?.Num != 1) - { this.Context.Case.Num = num; } return this.Context.GetLimit(); diff --git a/Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/Subquery/Items/SubTop.cs b/Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/Subquery/Items/SubTop.cs index 312ed677b..a9396d65a 100644 --- a/Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/Subquery/Items/SubTop.cs +++ b/Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/Subquery/Items/SubTop.cs @@ -67,7 +67,7 @@ namespace SqlSugar } else if (this.Context.GetLimit()!=null) { - if (this?.Context?.Case?.HasWhere == true) + if (this?.Context?.Case != null) { this.Context.Case.HasWhere = this.HasWhere; }