mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-30 04:45:54 +08:00
Update 达梦
This commit is contained in:
parent
4968700623
commit
1b8ee8d973
@ -19,6 +19,12 @@ namespace SqlSugar
|
||||
}
|
||||
public override string ToSqlString()
|
||||
{
|
||||
var isDistinctPage = IsDistinct && (Take > 1 || Skip > 1);
|
||||
if (isDistinctPage)
|
||||
{
|
||||
return OffsetPage();
|
||||
}
|
||||
|
||||
string oldOrderBy = this.OrderByValue;
|
||||
string externalOrderBy = oldOrderBy;
|
||||
var isIgnoreOrderBy = this.IsCount && this.PartitionByValue.IsNullOrEmpty();
|
||||
@ -55,6 +61,16 @@ namespace SqlSugar
|
||||
}
|
||||
return result;
|
||||
}
|
||||
private string OffsetPage()
|
||||
{
|
||||
var skip = this.Skip ?? 1;
|
||||
var take = this.Take;
|
||||
this.Skip = null;
|
||||
this.Take = null;
|
||||
this.Offset = null;
|
||||
var pageSql = $"SELECT * FROM ( SELECT PAGETABLE1.*,ROWNUM PAGEINDEX FROM( {this.ToSqlString()}) PAGETABLE1 WHERE ROWNUM<={skip + take}) WHERE PAGEINDEX>={(skip == 0 ? skip : (skip + 1))}";
|
||||
return pageSql;
|
||||
}
|
||||
public override string ToPageSql(string sql, int? take, int? skip, bool isExternal = false)
|
||||
{
|
||||
string temp = isExternal ? ExternalPageTempalte : PageTempalte;
|
||||
|
Loading…
Reference in New Issue
Block a user