OceanBaseForOracle和TDSQLForPGODBC,同步修改Oracle和PGSQL的改动

This commit is contained in:
guoshun.du
2025-04-01 14:00:26 +08:00
parent 3e29e86961
commit 4ccc7fe70a
6 changed files with 230 additions and 44 deletions

View File

@@ -56,7 +56,7 @@ namespace SqlSugar.OceanBaseForOracle
else
{
var bigSize = 500;
if (groupList.Count < bigSize)
if (groupList.Count < bigSize || this.Context?.CurrentConnectionConfig?.MoreSettings?.EnableOracleIdentity == true)
{
string result = Small(identities, groupList, columnsString);
return result;
@@ -76,7 +76,7 @@ namespace SqlSugar.OceanBaseForOracle
var sql = Small(identities, groupListPasge, columnsString);
this.Context.Ado.ExecuteCommand(sql, this.Parameters);
});
if (identities != null & identities.Count > 0 && this.OracleSeqInfoList != null && this.OracleSeqInfoList.Any())
if (identities != null && identities.Count > 0 && this.OracleSeqInfoList != null && this.OracleSeqInfoList.Any())
{
return $"SELECT {this.OracleSeqInfoList.First().Value - 1} FROM DUAL";
}

View File

@@ -22,8 +22,16 @@ namespace SqlSugar.OceanBaseForOracle
sb.AppendLine(string.Join("\r\n", groupList.Select(t =>
{
var updateTable = string.Format("UPDATE {0} SET", base.GetTableNameStringNoWith);
var setValues = string.Join(",", t.Where(s => !s.IsPrimarykey).Select(m => GetOracleUpdateColums(m)).ToArray());
var setValues = string.Join(",", t.Where(s => !s.IsPrimarykey).Where(s => OldPrimaryKeys == null || !OldPrimaryKeys.Contains(s.DbColumnName)).Select(m => GetOracleUpdateColums(m)).ToArray());
var pkList = t.Where(s => s.IsPrimarykey).ToList();
if (this.IsWhereColumns && this.PrimaryKeys?.Any() == true)
{
var whereColumns = pkList.Where(it => this.PrimaryKeys?.Any(p => p.EqualCase(it.PropertyName) || p.EqualCase(it.DbColumnName)) == true).ToList();
if (whereColumns.Any())
{
pkList = whereColumns;
}
}
List<string> whereList = new List<string>();
foreach (var item in pkList)
{
@@ -40,7 +48,7 @@ namespace SqlSugar.OceanBaseForOracle
private string GetOracleUpdateColums(DbColumnInfo m)
{
return string.Format("\"{0}\"={1}", m.DbColumnName.ToUpper(IsUppper), base.GetDbColumn(m, FormatValue(m.Value, m.IsPrimarykey, m.PropertyName)));
return string.Format("\"{0}\"={1} ", m.DbColumnName.ToUpper(IsUppper), base.GetDbColumn(m, FormatValue(m.Value, m.IsPrimarykey, m.PropertyName)));
}
int i = 0;
public object FormatValue(object value, bool isPrimaryKey, string name)