mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 01:58:13 +08:00
1.ExpressionContextCase增加Num属性,用于传递跳过的数据数量。
2.OcaenBaseForOracle 重写 GetLimit,使其支持子查询。 3.TDSQLForPGODBC 重写 GetLimit,使其支持子查询。 4.getMyInt和getMyIntNull,获取数据方式改成GetDecimal,只有OcaenBaseForOracle 使用这两个方法,这是为了支持OcaenBaseForOracle 驱动2.0.9以上,请更新驱动到2.0.9以上
This commit is contained in:
@@ -72,6 +72,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
|
||||
{
|
||||
|
@@ -130,6 +130,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,11 +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;
|
||||
}
|
||||
}
|
||||
|
@@ -86,6 +86,10 @@ namespace SqlSugar
|
||||
{
|
||||
this.Context.Case.HasWhere = this.HasWhere;
|
||||
}
|
||||
if (this?.Context?.Case?.Num != 1)
|
||||
{
|
||||
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?.HasWhere == true)
|
||||
{
|
||||
this.Context.Case.HasWhere = this.HasWhere;
|
||||
}
|
||||
return this.Context.GetLimit();
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user