mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-02 20:02:47 +08:00
Update Core
This commit is contained in:
parent
29f0f60163
commit
461a55f3fa
@ -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")]
|
||||
|
@ -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>
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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")]
|
||||
|
@ -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),
|
||||
};
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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),
|
||||
|
@ -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)
|
||||
{
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user