mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-23 04:23:47 +08:00
Update Insetable page
This commit is contained in:
@@ -18,6 +18,10 @@ namespace SqlSugar
|
|||||||
|
|
||||||
public int ExecuteCommand()
|
public int ExecuteCommand()
|
||||||
{
|
{
|
||||||
|
if (DataList.Count() == 1 && DataList.First() == null)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
if (PageSize == 0) { PageSize = 1000; }
|
if (PageSize == 0) { PageSize = 1000; }
|
||||||
var result = 0;
|
var result = 0;
|
||||||
this.Context.Utilities.PageEach(DataList, PageSize, pageItem =>
|
this.Context.Utilities.PageEach(DataList, PageSize, pageItem =>
|
||||||
@@ -28,6 +32,10 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
public async Task<int> ExecuteCommandAsync()
|
public async Task<int> ExecuteCommandAsync()
|
||||||
{
|
{
|
||||||
|
if (DataList.Count() == 1 && DataList.First() == null)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
if (PageSize == 0) { PageSize = 1000; }
|
if (PageSize == 0) { PageSize = 1000; }
|
||||||
var result = 0;
|
var result = 0;
|
||||||
await this.Context.Utilities.PageEachAsync(DataList, PageSize,async pageItem =>
|
await this.Context.Utilities.PageEachAsync(DataList, PageSize,async pageItem =>
|
||||||
@@ -39,6 +47,10 @@ namespace SqlSugar
|
|||||||
|
|
||||||
public List<long> ExecuteReturnSnowflakeIdList()
|
public List<long> ExecuteReturnSnowflakeIdList()
|
||||||
{
|
{
|
||||||
|
if (DataList.Count() == 1 && DataList.First() == null)
|
||||||
|
{
|
||||||
|
return new List<long>();
|
||||||
|
}
|
||||||
if (PageSize == 0) { PageSize = 1000; }
|
if (PageSize == 0) { PageSize = 1000; }
|
||||||
var result = new List<long>();
|
var result = new List<long>();
|
||||||
this.Context.Utilities.PageEach(DataList, PageSize, pageItem =>
|
this.Context.Utilities.PageEach(DataList, PageSize, pageItem =>
|
||||||
@@ -49,6 +61,10 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
public async Task<List<long>> ExecuteReturnSnowflakeIdListAsync()
|
public async Task<List<long>> ExecuteReturnSnowflakeIdListAsync()
|
||||||
{
|
{
|
||||||
|
if (DataList.Count() == 1 && DataList.First() == null)
|
||||||
|
{
|
||||||
|
return new List<long>();
|
||||||
|
}
|
||||||
if (PageSize == 0) { PageSize = 1000; }
|
if (PageSize == 0) { PageSize = 1000; }
|
||||||
var result = new List<long>();
|
var result = new List<long>();
|
||||||
await this.Context.Utilities.PageEachAsync(DataList, PageSize,async pageItem =>
|
await this.Context.Utilities.PageEachAsync(DataList, PageSize,async pageItem =>
|
||||||
|
@@ -474,6 +474,7 @@ namespace SqlSugar
|
|||||||
result.TableName = this.InsertBuilder.AsName;
|
result.TableName = this.InsertBuilder.AsName;
|
||||||
result.IsEnableDiffLogEvent = this.IsEnableDiffLogEvent;
|
result.IsEnableDiffLogEvent = this.IsEnableDiffLogEvent;
|
||||||
result.DiffModel = this.diffModel;
|
result.DiffModel = this.diffModel;
|
||||||
|
if(this.InsertBuilder.DbColumnInfoList.Any())
|
||||||
result.InsertColumns = this.InsertBuilder.DbColumnInfoList.GroupBy(it => it.TableId).First().Select(it=>it.DbColumnName).ToList();
|
result.InsertColumns = this.InsertBuilder.DbColumnInfoList.GroupBy(it => it.TableId).First().Select(it=>it.DbColumnName).ToList();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user