From 4043a2fe2103c7960b74acbccdcc876d11f83f0f Mon Sep 17 00:00:00 2001
From: chenzx <m15572880737@163.com>
Date: 星期三, 11 十二月 2024 18:40:16 +0800
Subject: [PATCH] czx20241211接口更新

---
 GasolineBlend.DAL/TreeDiagramRecordDAL.cs |   23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/GasolineBlend.DAL/TreeDiagramRecordDAL.cs b/GasolineBlend.DAL/TreeDiagramRecordDAL.cs
index 52e4464..ac1be69 100644
--- a/GasolineBlend.DAL/TreeDiagramRecordDAL.cs
+++ b/GasolineBlend.DAL/TreeDiagramRecordDAL.cs
@@ -24,8 +24,6 @@
                 return connection.Query<TreeDiagramRecord>(sql).ToList();
             }
         }
-
-
         public bool AddTreeDiagramRecord(TreeDiagramRecord treeDiagramRecord)
         {
             using (IDbConnection connection = new MySqlConnection(connectionString))
@@ -45,6 +43,27 @@
                 return affectedRows > 0;
             }
         }
+        public bool UpdateTreeDiagramRecord(TreeDiagramRecord treeDiagramRecord)
+        {
+            using (IDbConnection connection = new MySqlConnection(connectionString))
+            {
+                var sql = @"
+                update treediagramrecord 
+                set content=@Content,
+                modificationtime=NOW()
+                where companyname=@CompanyName";
+
+                var parameters = new
+                {
+                    CompanyName = treeDiagramRecord.CompanyName,
+                    Content = treeDiagramRecord.Content
+                };
+
+                connection.Open(); // 鎵撳紑鏁版嵁搴撹繛鎺�
+                int affectedRows = connection.Execute(sql, parameters); // 鎵ц鏇存柊鎿嶄綔
+                return affectedRows > 0;
+            }
+        }
 
     }
 }

--
Gitblit v1.8.0