mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 18:22:23 +08:00
Update split date
This commit is contained in:
@@ -1556,7 +1556,7 @@ namespace SqlSugar
|
|||||||
Check.ExceptionEasy(splitColumn==null,"[SplitFieldAttribute] need to be added to the table field", "需要在分表字段加上属性[SplitFieldAttribute]");
|
Check.ExceptionEasy(splitColumn==null,"[SplitFieldAttribute] need to be added to the table field", "需要在分表字段加上属性[SplitFieldAttribute]");
|
||||||
var columnName = this.SqlBuilder.GetTranslationColumnName(splitColumn.DbColumnName);
|
var columnName = this.SqlBuilder.GetTranslationColumnName(splitColumn.DbColumnName);
|
||||||
var sqlParameterKeyWord = this.SqlBuilder.SqlParameterKeyWord;
|
var sqlParameterKeyWord = this.SqlBuilder.SqlParameterKeyWord;
|
||||||
return this.Where($" {columnName}>={sqlParameterKeyWord}spBeginTime AND {columnName}<= {sqlParameterKeyWord}spEndTime",new { spBeginTime = beginTime , spEndTime = endTime}).SplitTable(tas => {
|
var result= this.Where($" {columnName}>={sqlParameterKeyWord}spBeginTime AND {columnName}<= {sqlParameterKeyWord}spEndTime",new { spBeginTime = beginTime , spEndTime = endTime}).SplitTable(tas => {
|
||||||
var result = tas;
|
var result = tas;
|
||||||
var type= this.EntityInfo.Type.GetCustomAttribute<SplitTableAttribute>();
|
var type= this.EntityInfo.Type.GetCustomAttribute<SplitTableAttribute>();
|
||||||
Check.ExceptionEasy(type == null, $"{this.EntityInfo.EntityName}need SplitTableAttribute", $"{this.EntityInfo.EntityName}需要特性 SplitTableAttribute");
|
Check.ExceptionEasy(type == null, $"{this.EntityInfo.EntityName}need SplitTableAttribute", $"{this.EntityInfo.EntityName}需要特性 SplitTableAttribute");
|
||||||
@@ -1596,6 +1596,17 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
});
|
});
|
||||||
|
if (splitColumn.SqlParameterDbType is System.Data.DbType)
|
||||||
|
{
|
||||||
|
foreach (var item in this.QueryBuilder.Parameters)
|
||||||
|
{
|
||||||
|
if (item.ParameterName.IsContainsIn("spBeginTime", "spEndTime"))
|
||||||
|
{
|
||||||
|
item.DbType =(System.Data.DbType)splitColumn.SqlParameterDbType;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
public ISugarQueryable<T> SplitTable(Func<List<SplitTableInfo>, IEnumerable<SplitTableInfo>> getTableNamesFunc)
|
public ISugarQueryable<T> SplitTable(Func<List<SplitTableInfo>, IEnumerable<SplitTableInfo>> getTableNamesFunc)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user