mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-19 06:29:33 +08:00
Synchronization code
This commit is contained in:
parent
8c44c9574e
commit
9748e1e67d
@ -48,6 +48,38 @@ namespace SqlSugar
|
||||
return string.Format(SqlTemplate, GetTableNameString, columnsString, columnParametersString);
|
||||
}
|
||||
else
|
||||
{
|
||||
var bigSize = 500;
|
||||
if (groupList.Count < bigSize)
|
||||
{
|
||||
string result = Small(identities, groupList, columnsString);
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
string result = Big(identities, groupList, columnsString);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
private string Big(List<EntityColumnInfo> identities, List<IGrouping<int, DbColumnInfo>> groupList, string columnsString)
|
||||
{
|
||||
this.Context.Utilities.PageEach(groupList, 100, groupListPasge =>
|
||||
{
|
||||
var sql = Small(identities, groupListPasge, columnsString);
|
||||
this.Context.Ado.ExecuteCommand(sql);
|
||||
});
|
||||
if (identities!=null&identities.Count > 0&& this.OracleSeqInfoList!=null&& this.OracleSeqInfoList.Any())
|
||||
{
|
||||
return $"SELECT {this.OracleSeqInfoList.First().Value-1} FROM DUAL";
|
||||
}
|
||||
else
|
||||
{
|
||||
return $"SELECT {groupList.Count} FROM DUAL";
|
||||
}
|
||||
}
|
||||
|
||||
private string Small(List<EntityColumnInfo> identities, List<IGrouping<int, DbColumnInfo>> groupList, string columnsString)
|
||||
{
|
||||
StringBuilder batchInsetrSql = new StringBuilder();
|
||||
batchInsetrSql.AppendLine("INSERT ALL");
|
||||
@ -99,7 +131,7 @@ namespace SqlSugar
|
||||
var result = batchInsetrSql.ToString();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
public object FormatValue(object value,string name)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user