diff --git a/Src/Asp.NetCore2/SqlSugar.OceanBaseForOracle/OceanBase/SqlBuilder/OceanBaseForOracleExpressionContext.cs b/Src/Asp.NetCore2/SqlSugar.OceanBaseForOracle/OceanBase/SqlBuilder/OceanBaseForOracleExpressionContext.cs index 31c8bc592a0c118d69155e4011db5f988de07022..5fc03c9aaf4a6e98b932085b4da5b79cbdfe5ccf 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 05cb81a82b1881f2fdabf9fbe6619142b01c71be..c8b713ef9fb69d0a85038a976a1dc9a3349b791d 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 534fa0a5df7b8fc591ac0da5acd681ab140df054..3270810e6a73576b16ad0603e169fdd8fa75d582 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 312ed677be2d3bcca758575710b7ee99db66c7ba..a9396d65ad1bfad75c0b494617b43feeff6208fd 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; }