This commit is contained in:
sunkaixuan 2017-08-28 15:43:51 +08:00
parent 31c178a235
commit 1c41076ed8
2 changed files with 3 additions and 2 deletions

View File

@ -236,10 +236,10 @@ 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; this.OrderByValue = oldOrderBy; }
if (this.IsCount) { orderByValue = null; }
sql.AppendFormat(SqlTemplate, GetSelectValue, GetTableNameString, GetWhereValueString, groupByValue, orderByValue);
sql.Replace(UtilConstants.OrderReplace, isRowNumber ? (this.IsCount ? null : rowNumberString) : null);
if (this.IsCount) { return sql.ToString(); }
if (this.IsCount) { this.OrderByValue = oldOrderBy; return sql.ToString(); }
var result = ToPageSql(sql.ToString(), this.Take, this.Skip);
if (ExternalPageIndex > 0)
{

View File

@ -42,6 +42,7 @@ namespace SqlSugar
new KeyValuePair<string, CSharpDataType>("nvarchar2",CSharpDataType.@string),
new KeyValuePair<string, CSharpDataType>("text",CSharpDataType.@string),
new KeyValuePair<string, CSharpDataType>("char",CSharpDataType.@string),
new KeyValuePair<string, CSharpDataType>("nchar",CSharpDataType.@string),
new KeyValuePair<string, CSharpDataType>("num",CSharpDataType.@string),
new KeyValuePair<string, CSharpDataType>("tinyint",CSharpDataType.@byte),