From 4e87995e9955d6ea9e15b3d01bc60fe5f2b649a4 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Sat, 10 Jun 2023 20:41:26 +0800 Subject: [PATCH] Synchronization code --- .../Oracle/SqlBuilder/OracleInsertBuilder.cs | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/Src/Asp.NetCore2/SqlSugar/Realization/Oracle/SqlBuilder/OracleInsertBuilder.cs b/Src/Asp.NetCore2/SqlSugar/Realization/Oracle/SqlBuilder/OracleInsertBuilder.cs index cfc87c7ca..70a52abb1 100644 --- a/Src/Asp.NetCore2/SqlSugar/Realization/Oracle/SqlBuilder/OracleInsertBuilder.cs +++ b/Src/Asp.NetCore2/SqlSugar/Realization/Oracle/SqlBuilder/OracleInsertBuilder.cs @@ -91,7 +91,7 @@ namespace SqlSugar batchInsetrSql.Append("("); batchInsetrSql.Append(columnsString); - if (identities.HasValue()) + if (identities.HasValue()&& this.IsOffIdentity==false) { batchInsetrSql.Append("," + string.Join(",", identities.Select(it => Builder.GetTranslationColumnName(it.DbColumnName)))); } @@ -101,20 +101,23 @@ namespace SqlSugar batchInsetrSql.Append("("); insertColumns = string.Join(",", item.Select(it => GetDbColumn(it, FormatValue(it.Value, it.PropertyName)))); batchInsetrSql.Append(insertColumns); - if (identities.HasValue()) + if (this.IsOffIdentity == false) { - batchInsetrSql.Append(","); - foreach (var idn in identities) + if (identities.HasValue()) { - var seqvalue = this.OracleSeqInfoList[idn.OracleSequenceName]; - this.OracleSeqInfoList[idn.OracleSequenceName] = this.OracleSeqInfoList[idn.OracleSequenceName] + 1; - if (identities.Last() == idn) + batchInsetrSql.Append(","); + foreach (var idn in identities) { - batchInsetrSql.Append(seqvalue); - } - else - { - batchInsetrSql.Append(seqvalue + ","); + var seqvalue = this.OracleSeqInfoList[idn.OracleSequenceName]; + this.OracleSeqInfoList[idn.OracleSequenceName] = this.OracleSeqInfoList[idn.OracleSequenceName] + 1; + if (identities.Last() == idn) + { + batchInsetrSql.Append(seqvalue); + } + else + { + batchInsetrSql.Append(seqvalue + ","); + } } } }