mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-31 15:56:25 +08:00
-
This commit is contained in:
parent
8600287654
commit
a296f55b4f
@ -236,7 +236,7 @@ namespace SqlSugar
|
||||
var rowNumberString = string.Format(",ROW_NUMBER() OVER({0}) AS RowIndex ", GetOrderByString);
|
||||
string groupByValue = GetGroupByString + HavingInfos;
|
||||
string orderByValue = (!isRowNumber && this.OrderByValue.IsValuable()) ? GetOrderByString : null;
|
||||
if (this.IsCount) { orderByValue = null; }
|
||||
if (this.IsCount) { orderByValue = null; this.OrderByValue = oldOrderBy; }
|
||||
sql.AppendFormat(SqlTemplate, GetSelectValue, GetTableNameString, GetWhereValueString, groupByValue, orderByValue);
|
||||
sql.Replace(UtilConstants.OrderReplace, isRowNumber ? (this.IsCount ? null : rowNumberString) : null);
|
||||
if (this.IsCount) { return sql.ToString(); }
|
||||
|
@ -35,7 +35,7 @@ namespace SqlSugar
|
||||
var rowNumberString = string.Format(",ROW_NUMBER() OVER({0}) AS RowIndex ", GetOrderByString);
|
||||
string groupByValue = GetGroupByString + HavingInfos;
|
||||
string orderByValue = (!isRowNumber && this.OrderByValue.IsValuable()) ? GetOrderByString : null;
|
||||
if (this.IsCount) { orderByValue = null; }
|
||||
if (this.IsCount) { orderByValue = null; this.OrderByValue = oldOrderBy; }
|
||||
sql.AppendFormat(SqlTemplate, GetSelectValue, GetTableNameString, GetWhereValueString, groupByValue, orderByValue);
|
||||
sql.Replace(UtilConstants.OrderReplace, isRowNumber ? (this.IsCount ? null : rowNumberString) : null);
|
||||
if (this.IsCount) { return sql.ToString(); }
|
||||
|
Loading…
Reference in New Issue
Block a user