Browse Source

Update code

pull/19/head
sunkaixuan 3 years ago
parent
commit
a8634b3d5d
  1. 7
      Src/Asp.NetCore2/SqlSugar/Abstract/FastestProvider/Private.cs
  2. 1
      Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs

7
Src/Asp.NetCore2/SqlSugar/Abstract/FastestProvider/Private.cs

@ -165,6 +165,13 @@ namespace SqlSugar
{
dr[column.ColumnName] = DBNull.Value;
}
if (column.DataType==UtilConstants.BoolType&&this.context.CurrentConnectionConfig.DbType.IsIn(DbType.MySql, DbType.MySqlConnector))
{
if (Convert.ToBoolean(dr[column.ColumnName]) == false)
{
dr[column.ColumnName] = DBNull.Value;
}
}
}
tempDataTable.Rows.Add(dr);
}

1
Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs

@ -1041,6 +1041,7 @@ namespace SqlSugar
return this.Where($" {columnName}>={sqlParameterKeyWord}spBeginTime AND {columnName}<= {sqlParameterKeyWord}spEndTime",new { spBeginTime = beginTime , spEndTime = endTime}).SplitTable(tas => {
var result = tas;
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)
{
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…
Cancel
Save