Update Core

This commit is contained in:
sunkaixuan 2017-08-09 13:42:33 +08:00
parent 29f0f60163
commit 461a55f3fa
14 changed files with 16 additions and 22 deletions

View File

@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.2.3.3")]
[assembly: AssemblyFileVersion("4.2.3.3")]
[assembly: AssemblyVersion("4.3.2.3")]
[assembly: AssemblyFileVersion("4.3.2.3")]

View File

@ -2,7 +2,7 @@
<package >
<metadata>
<id>sqlSugar</id>
<version>4.2.3.2</version>
<version>4.3.2.3</version>
<title>SqlSugar Best ORM Fastest ORM Simple Easy ORM</title>
<authors>sun kaixuan</authors>
<owners>landa</owners>

View File

@ -398,18 +398,10 @@ namespace SqlSugar
public virtual int Count()
{
InitMapping();
QueryBuilder.IsCount = true;
var sql = string.Empty;
if (QueryBuilder.PartitionByValue.IsValuable())
{
sql = QueryBuilder.ToSqlString();
sql = QueryBuilder.ToCountSql(sql);
}
else
{
QueryBuilder.IsCount = true;
sql = QueryBuilder.ToSqlString();
}
sql = QueryBuilder.ToSqlString();
sql = QueryBuilder.ToCountSql(sql);
var reval = Context.Ado.GetInt(sql, QueryBuilder.Parameters.ToArray());
RestoreMapping();
QueryBuilder.IsCount = false;

View File

@ -247,9 +247,12 @@ namespace SqlSugar
}
var isRowNumber = Skip != null || Take != null;
var rowNumberString = string.Format(",ROW_NUMBER() OVER({0}) AS RowIndex ", GetOrderByString);
sql.AppendFormat(SqlTemplate, GetSelectValue, GetTableNameString, GetWhereValueString, GetGroupByString + HavingInfos, (!isRowNumber && this.OrderByValue.IsValuable()) ? GetOrderByString : null);
string groupByValue = GetGroupByString + HavingInfos;
string orderByValue = (!isRowNumber && this.OrderByValue.IsValuable()) ? GetOrderByString : null;
if (this.IsCount) { orderByValue = null; }
sql.AppendFormat(SqlTemplate, GetSelectValue, GetTableNameString, GetWhereValueString, groupByValue, orderByValue);
sql.Replace("{$:OrderByString:$}", isRowNumber ? (this.IsCount ? null : rowNumberString) : null);
if (IsCount) { return sql.ToString(); }
if (this.IsCount) { return sql.ToString(); }
var result = ToPageSql(sql.ToString(), this.Take, this.Skip);
if (ExternalPageIndex > 0)
{
@ -333,7 +336,6 @@ namespace SqlSugar
{
get
{
if (this.IsCount) return "COUNT(1) AS [Count] ";
string reval = string.Empty;
if (this.SelectValue == null || this.SelectValue is string)
{

View File

@ -19,5 +19,5 @@ using System.Runtime.InteropServices;
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("1c022a5c-4e4d-4026-a8a3-f659b9740a1a")]
[assembly: AssemblyVersion("4.2.2.3")]
[assembly: AssemblyFileVersion("4.2.2.3")]
[assembly: AssemblyVersion("4.3.2.3")]
[assembly: AssemblyFileVersion("4.3.2.3")]

View File

@ -66,6 +66,7 @@ namespace SqlSugar
new KeyValuePair<string, CSharpDataType>("geometry",CSharpDataType.byteArray),
new KeyValuePair<string, CSharpDataType>("multilinestring",CSharpDataType.byteArray),
new KeyValuePair<string, CSharpDataType>("polygon",CSharpDataType.byteArray),
new KeyValuePair<string, CSharpDataType>("mediumblob",CSharpDataType.byteArray),
new KeyValuePair<string, CSharpDataType>("varchar",CSharpDataType.Guid),
};

View File

@ -70,7 +70,6 @@ namespace SqlSugar
{
get
{
if (this.IsCount) return "COUNT(1) AS `Count` ";
string reval = string.Empty;
if (this.SelectValue == null || this.SelectValue is string)
{

View File

@ -20,6 +20,7 @@ namespace SqlSugar
new KeyValuePair<string, CSharpDataType>("char",CSharpDataType.@string),
new KeyValuePair<string, CSharpDataType>("ntext",CSharpDataType.@string),
new KeyValuePair<string, CSharpDataType>("nchar",CSharpDataType.@string),
new KeyValuePair<string, CSharpDataType>("hierarchyid",CSharpDataType.@string),
new KeyValuePair<string, CSharpDataType>("bigint",CSharpDataType.@long),
new KeyValuePair<string, CSharpDataType>("bit",CSharpDataType.@bool),
new KeyValuePair<string, CSharpDataType>("datetime",CSharpDataType.DateTime),

View File

@ -70,7 +70,6 @@ namespace SqlSugar
{
get
{
if (this.IsCount) return "COUNT(1) AS `Count` ";
string reval = string.Empty;
if (this.SelectValue == null || this.SelectValue is string)
{

View File

@ -2,7 +2,7 @@
<package >
<metadata>
<id>sqlSugarCore</id>
<version>4.2.3.1</version>
<version>4.2.3.3</version>
<authors>sunkaixuan</authors>
<owners>Landa</owners>
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>