mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-21 23:49:33 +08:00
Add Check
This commit is contained in:
parent
ebde9695a6
commit
f2ff6843a5
@ -1041,6 +1041,7 @@ namespace SqlSugar
|
|||||||
return this.Where($" {columnName}>={sqlParameterKeyWord}spBeginTime AND {columnName}<= {sqlParameterKeyWord}spEndTime",new { spBeginTime = beginTime , spEndTime = endTime}).SplitTable(tas => {
|
return 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");
|
||||||
if (SplitType.Month == type.SplitType)
|
if (SplitType.Month == type.SplitType)
|
||||||
{
|
{
|
||||||
result = result.Where(y => y.Date >= beginTime.ToString("yyyy-MM").ObjToDate() && y.Date <= endTime.Date.ToString("yyyy-MM").ObjToDate().AddMonths(1).AddDays(-1)).ToList();
|
result = result.Where(y => y.Date >= beginTime.ToString("yyyy-MM").ObjToDate() && y.Date <= endTime.Date.ToString("yyyy-MM").ObjToDate().AddMonths(1).AddDays(-1)).ToList();
|
||||||
|
Loading…
Reference in New Issue
Block a user