From 93151643c1c1534061dab9001292ac6e8bf82730 Mon Sep 17 00:00:00 2001 From: "guoshun.du" Date: Tue, 9 Sep 2025 20:19:02 +0800 Subject: [PATCH] =?UTF-8?q?1.OcaenBaseForOracle=E5=92=8CTDSQLForOdbc?= =?UTF-8?q?=E9=87=8D=E5=86=99Case=202.SubTake=E4=B8=AD=E7=9A=84GetValue?= =?UTF-8?q?=E6=96=B9=E6=B3=95=EF=BC=8C=E5=88=A4=E6=96=ADthis=3F.Context=3F?= =?UTF-8?q?.Case=3F.Num=20>=201=EF=BC=8C=E8=BF=99=E6=A0=B7=E9=98=B2?= =?UTF-8?q?=E6=AD=A2=E6=8A=A5=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OceanBaseForOracleExpressionContext.cs | 1 + .../SqlBuilder/TDSQLForPGODBCExpressionContext.cs | 1 + .../ExpressionsToSql/Subquery/Items/SubTake.cs | 12 ++++++------ 3 files changed, 8 insertions(+), 6 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..b3f4e51df 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 { diff --git a/Src/Asp.NetCore2/SqlSugar.TDSQLForPGODBC/TDSQLForPG/SqlBuilder/TDSQLForPGODBCExpressionContext.cs b/Src/Asp.NetCore2/SqlSugar.TDSQLForPGODBC/TDSQLForPG/SqlBuilder/TDSQLForPGODBCExpressionContext.cs index 05cb81a82..3728c75db 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 { diff --git a/Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/Subquery/Items/SubTake.cs b/Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/Subquery/Items/SubTake.cs index 534fa0a5d..978122ae5 100644 --- a/Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/Subquery/Items/SubTake.cs +++ b/Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/Subquery/Items/SubTake.cs @@ -55,19 +55,19 @@ namespace SqlSugar public string GetValue(Expression expression) { var numExp = (expression as MethodCallExpression).Arguments[0]; - var num =1; - if (ExpressionTool.GetParameters(numExp).Any()) - { + var num = 1; + if (ExpressionTool.GetParameters(numExp).Any()) + { var copyContext = this.Context.GetCopyContextWithMapping(); copyContext.IsSingle = false; copyContext.Resolve(numExp, ResolveExpressType.WhereMultiple); copyContext.Result.GetString(); } - else + else { num = ExpressionTool.DynamicInvoke(numExp).ObjToInt(); } - var take = (expression as MethodCallExpression); + var take = (expression as MethodCallExpression); if (this.Context is SqlServerExpressionContext || this.Context.GetType().Name.Contains("Access")) { return "TOP " + num; @@ -86,7 +86,7 @@ namespace SqlSugar { this.Context.Case.HasWhere = this.HasWhere; } - if (this?.Context?.Case?.Num != 1) + if (this?.Context?.Case?.Num > 1) { this.Context.Case.Num = num; } -- Gitee