From deb811bc771d93cc171637aba618b1295153c8e6 Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Wed, 25 Sep 2024 14:07:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tiobon.Core.Services/Ghre/Ghre_TeacherServices.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Tiobon.Core.Services/Ghre/Ghre_TeacherServices.cs b/Tiobon.Core.Services/Ghre/Ghre_TeacherServices.cs index 475b80fb..9264c3b0 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_TeacherServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_TeacherServices.cs @@ -210,8 +210,12 @@ FROM (SELECT A.*, entity.StaffId = null; } - var id = await base.Add(entity); + var sql = $"SELECT MAX(id)+1 FROM Ghre_Teacher WHERE Id !='{id}'"; + var id1 = await Db.Ado.GetLongAsync(sql); + sql = $"UPDATE Ghre_Teacher SET Id={id1} WHERE Id ='{id}'"; + await Db.Ado.ExecuteCommandAsync(sql); + id = id1; if (entity.TeacherAttachments != null && entity.TeacherAttachments.Any()) { @@ -324,7 +328,7 @@ FROM (SELECT A.*, } var result = await BaseDal.Update(entities); - return ServiceResult.OprateSuccess("执行成功!"); + return ServiceResult.OprateSuccess("执行成功!"); } } \ No newline at end of file