1.this?.Context?.Case 不等于判断

2.OceanBaseForOracle和TDSQLForODBC重写Case
This commit is contained in:
guoshun.du
2025-09-09 20:40:57 +08:00
parent 5431701ec6
commit d4eb924900
4 changed files with 6 additions and 7 deletions

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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();

View File

@@ -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;
}