mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-07 15:14:33 +08:00
Compare commits
5 Commits
bb2e53bc4f
...
482fe429b9
Author | SHA1 | Date | |
---|---|---|---|
![]() |
482fe429b9 | ||
![]() |
d4eb924900 | ||
![]() |
5431701ec6 | ||
![]() |
81eb7a5a3f | ||
![]() |
96a670465c |
@@ -16,6 +16,7 @@ namespace SqlSugar.OceanBaseForOracle
|
||||
public OceanBaseForOracleExpressionContext()
|
||||
{
|
||||
base.DbMehtods = new OceanBaseForOracleMethod();
|
||||
base.Case = new ExpressionContextCase();
|
||||
}
|
||||
public override string SqlParameterKeyWord
|
||||
{
|
||||
@@ -72,6 +73,16 @@ namespace SqlSugar.OceanBaseForOracle
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override string GetLimit()
|
||||
{
|
||||
int num = 1;
|
||||
if (this.Case?.Num > 1)
|
||||
{
|
||||
num = this.Case.Num;
|
||||
}
|
||||
return (this.Case?.HasWhere == true ? "AND" : "WHERE") + " ROWNUM=" + num;
|
||||
}
|
||||
}
|
||||
public partial class OceanBaseForOracleMethod : DefaultDbMethod, IDbMethods
|
||||
{
|
||||
|
@@ -8,6 +8,7 @@ namespace SqlSugar.TDSQLForPGODBC
|
||||
public TDSQLForPGODBCExpressionContext()
|
||||
{
|
||||
base.DbMehtods = new TDSQLForPGODBCMethod();
|
||||
base.Case = new ExpressionContextCase();
|
||||
}
|
||||
public override string SqlTranslationLeft
|
||||
{
|
||||
@@ -130,6 +131,16 @@ namespace SqlSugar.TDSQLForPGODBC
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public override string GetLimit()
|
||||
{
|
||||
int num = 1;
|
||||
if (this.Case.Num > 1)
|
||||
{
|
||||
num = this.Case.Num;
|
||||
}
|
||||
return "limit " + num;
|
||||
}
|
||||
}
|
||||
public class TDSQLForPGODBCMethod : DefaultDbMethod, IDbMethods
|
||||
{
|
||||
|
@@ -151,7 +151,7 @@ namespace SqlSugar
|
||||
}
|
||||
if (dr.GetDataTypeName(i) == "NUMBER")
|
||||
{
|
||||
return Convert.ToInt32(dr.GetDouble(i));
|
||||
return Convert.ToInt32(dr.GetDecimal(i));
|
||||
}
|
||||
var result = dr.GetInt32(i);
|
||||
return result;
|
||||
@@ -160,7 +160,7 @@ namespace SqlSugar
|
||||
{
|
||||
if (dr.GetDataTypeName(i) == "NUMBER")
|
||||
{
|
||||
return Convert.ToInt32(dr.GetDouble(i));
|
||||
return Convert.ToInt32(dr.GetDecimal(i));
|
||||
}
|
||||
var result = dr.GetInt32(i);
|
||||
return result;
|
||||
|
@@ -4,10 +4,12 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SqlSugar
|
||||
namespace SqlSugar
|
||||
{
|
||||
public class ExpressionContextCase
|
||||
{
|
||||
public bool IsDateString { get; set; }
|
||||
public bool HasWhere { get; set; }
|
||||
public int Num { get; set; } = 1;
|
||||
}
|
||||
}
|
||||
|
@@ -82,6 +82,11 @@ namespace SqlSugar
|
||||
}
|
||||
else if (this.Context.GetLimit() != null)
|
||||
{
|
||||
if (this?.Context?.Case != null)
|
||||
{
|
||||
this.Context.Case.HasWhere = this.HasWhere;
|
||||
this.Context.Case.Num = num;
|
||||
}
|
||||
return this.Context.GetLimit();
|
||||
}
|
||||
else
|
||||
|
@@ -67,6 +67,10 @@ namespace SqlSugar
|
||||
}
|
||||
else if (this.Context.GetLimit()!=null)
|
||||
{
|
||||
if (this?.Context?.Case != null)
|
||||
{
|
||||
this.Context.Case.HasWhere = this.HasWhere;
|
||||
}
|
||||
return this.Context.GetLimit();
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user