mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-05 17:37:58 +08:00
Synchronization code
This commit is contained in:
parent
98d715bbd4
commit
e61e8194d6
@ -1203,6 +1203,7 @@ namespace SqlSugar
|
||||
public ISugarQueryable<T> SplitTable(DateTime beginTime, DateTime endTime)
|
||||
{
|
||||
var splitColumn = this.EntityInfo.Columns.FirstOrDefault(it => it.PropertyInfo.GetCustomAttribute<SplitFieldAttribute>() != null);
|
||||
Check.ExceptionEasy(splitColumn==null,"[SplitFieldAttribute] need to be added to the table field", "需要在分表字段加上属性[SplitFieldAttribute]");
|
||||
var columnName = this.SqlBuilder.GetTranslationColumnName(splitColumn.DbColumnName);
|
||||
var sqlParameterKeyWord = this.SqlBuilder.SqlParameterKeyWord;
|
||||
return this.Where($" {columnName}>={sqlParameterKeyWord}spBeginTime AND {columnName}<= {sqlParameterKeyWord}spEndTime",new { spBeginTime = beginTime , spEndTime = endTime}).SplitTable(tas => {
|
||||
|
@ -102,7 +102,7 @@ namespace SqlSugar
|
||||
|
||||
public string GetWhere(string fieldName,string conditionalType,int? parameterIndex=null)
|
||||
{
|
||||
return string.Format(" {0} {1} {2}{3} ",fieldName,conditionalType,this.SqlParameterKeyWord,fieldName+ parameterIndex);
|
||||
return string.Format(" {0} {1} {2}{3} ",this.GetTranslationColumnName(fieldName),conditionalType,this.SqlParameterKeyWord,fieldName+ parameterIndex);
|
||||
}
|
||||
public virtual string GetUnionAllSql(List<string> sqlList)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user