Browse Source

-

pull/12/MERGE
sunkaixuan 7 years ago
parent
commit
9d95675112
  1. 1
      Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/SqlBuilderProvider.cs
  2. 8
      Src/Asp.Net/SqlSugar/Interface/ISqlBuilder.cs
  3. 2
      Src/Asp.Net/SqlSugar/SqlSugarClient.cs

1
Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/SqlBuilderProvider.cs

@ -110,6 +110,7 @@ namespace SqlSugar
public abstract string SqlTranslationRight { get; } public abstract string SqlTranslationRight { get; }
public virtual string SqlFalse { get { return "1=2 "; } } public virtual string SqlFalse { get { return "1=2 "; } }
public virtual string SqlDateNow { get { return "GETDATE()"; } } public virtual string SqlDateNow { get { return "GETDATE()"; } }
public virtual string SqlSelectAll { get { return "*"; } }
#endregion #endregion
} }
} }

8
Src/Asp.Net/SqlSugar/Interface/ISqlBuilder.cs

@ -1,7 +1,9 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data; using System.Data;
using System.Dynamic;
using System.Linq; using System.Linq;
using System.Linq.Expressions;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace SqlSugar namespace SqlSugar
@ -12,8 +14,7 @@ namespace SqlSugar
CommandType CommandType { get; set; } CommandType CommandType { get; set; }
String AppendWhereOrAnd(bool isWhere, string sqlString); String AppendWhereOrAnd(bool isWhere, string sqlString);
string AppendHaving(string sqlString); string AppendHaving(string sqlString);
string SqlTranslationLeft { get; }
string SqlTranslationRight { get; }
SqlQueryBuilder SqlQueryBuilder { get; set; } SqlQueryBuilder SqlQueryBuilder { get; set; }
QueryBuilder QueryBuilder { get; set; } QueryBuilder QueryBuilder { get; set; }
InsertBuilder InsertBuilder { get; set; } InsertBuilder InsertBuilder { get; set; }
@ -23,6 +24,9 @@ namespace SqlSugar
string SqlParameterKeyWord { get; } string SqlParameterKeyWord { get; }
string SqlFalse { get; } string SqlFalse { get; }
string SqlDateNow { get; } string SqlDateNow { get; }
string SqlTranslationLeft { get; }
string SqlTranslationRight { get; }
string SqlSelectAll { get; }
string GetTranslationTableName(string name); string GetTranslationTableName(string name);
string GetTranslationColumnName(string entityName, string propertyName); string GetTranslationColumnName(string entityName, string propertyName);

2
Src/Asp.Net/SqlSugar/SqlSugarClient.cs

@ -333,7 +333,7 @@ namespace SqlSugar
var allParameters = allItems.SelectMany(it => it.Value).ToArray(); var allParameters = allItems.SelectMany(it => it.Value).ToArray();
var resulut = base.Context.Queryable<ExpandoObject>().AS(UtilMethods.GetPackTable(allSql, "unionTable")); var resulut = base.Context.Queryable<ExpandoObject>().AS(UtilMethods.GetPackTable(allSql, "unionTable"));
resulut.AddParameters(allParameters); resulut.AddParameters(allParameters);
return resulut.Select<T>("*"); return resulut.Select<T>(sqlBuilder.SqlSelectAll);
} }
public virtual ISugarQueryable<T> UnionAll<T>(List<ISugarQueryable<T>> queryables) where T : class, new() public virtual ISugarQueryable<T> UnionAll<T>(List<ISugarQueryable<T>> queryables) where T : class, new()
{ {

Loading…
Cancel
Save