This commit is contained in:
sunkaixuan
2017-08-30 15:53:49 +08:00
parent 0de0aa0a09
commit d493778fad
4 changed files with 5 additions and 5 deletions

View File

@@ -238,7 +238,7 @@ namespace SqlSugar
string orderByValue = (!isRowNumber && this.OrderByValue.IsValuable()) ? GetOrderByString : null;
if (this.IsCount) { orderByValue = null; }
sql.AppendFormat(SqlTemplate, GetSelectValue, GetTableNameString, GetWhereValueString, groupByValue, orderByValue);
sql.Replace(UtilConstants.OrderReplace, isRowNumber ? (this.IsCount ? null : rowNumberString) : null);
sql.Replace(UtilConstants.ReplaceKey, isRowNumber ? (this.IsCount ? null : rowNumberString) : null);
if (this.IsCount) { this.OrderByValue = oldOrderBy; return sql.ToString(); }
var result = ToPageSql(sql.ToString(), this.Take, this.Skip);
if (ExternalPageIndex > 0)

View File

@@ -17,7 +17,7 @@ namespace SqlSugar
{
get
{
return "SELECT {0}{"+UtilConstants.OrderReplace+"} FROM {1}{2}{3}{4}";
return "SELECT {0}{"+UtilConstants.ReplaceKey+"} FROM {1}{2}{3}{4}";
}
}
public override string ToSqlString()
@@ -37,7 +37,7 @@ namespace SqlSugar
string orderByValue = (!isRowNumber && this.OrderByValue.IsValuable()) ? GetOrderByString : 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);
sql.Replace(UtilConstants.ReplaceKey, isRowNumber ? (this.IsCount ? null : rowNumberString) : null);
if (this.IsCount) { return sql.ToString(); }
var result = ToPageSql(sql.ToString(), this.Take, this.Skip);
if (ExternalPageIndex > 0)

View File

@@ -12,7 +12,7 @@ namespace SqlSugar
{
get
{
return "SELECT {0}{"+UtilConstants.OrderReplace+"} FROM {1}{2}{3}{4}";
return "SELECT {0}{"+UtilConstants.ReplaceKey+"} FROM {1}{2}{3}{4}";
}
}
}

View File

@@ -10,7 +10,7 @@ namespace SqlSugar
public const char DotChar = '.';
internal const string Space = " ";
internal const string AssemblyName = "SqlSugar";
internal const string OrderReplace = "{662E689B-17A1-4D06-9D27-F29EAB8BC3D6}";
internal const string ReplaceKey = "{662E689B-17A1-4D06-9D27-F29EAB8BC3D6}";
internal static Type IntType = typeof(int);
internal static Type LongType = typeof(long);