From 90a1495b9d765c9e1d48f689dbcf977cbdb2768e Mon Sep 17 00:00:00 2001
From: dengzedong <dengzedong@email>
Date: 星期二, 31 十二月 2024 17:23:13 +0800
Subject: [PATCH] 模型结果修改为存在唯一索引则修改,不存在插入。避免死锁问题

---
 iailab-module-model/iailab-module-model-biz/src/main/resources/mapper/mcs/MmItemResultDao.xml |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/iailab-module-model/iailab-module-model-biz/src/main/resources/mapper/mcs/MmItemResultDao.xml b/iailab-module-model/iailab-module-model-biz/src/main/resources/mapper/mcs/MmItemResultDao.xml
index ec7a065..a0a6838 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/resources/mapper/mcs/MmItemResultDao.xml
+++ b/iailab-module-model/iailab-module-model-biz/src/main/resources/mapper/mcs/MmItemResultDao.xml
@@ -28,5 +28,13 @@
         VALUES (#{entity.id},#{entity.outputid},#{entity.predicttime},#{entity.jsonvalue},#{entity.cumulant})
     </insert>
 
+    <insert id="saveOrUpdateItemResult" parameterType="com.iailab.module.model.mcs.pre.entity.MmItemResultEntity">
+        INSERT INTO t_mm_item_result (id,outputid, datatime, datavalue) VALUES
+        <foreach item="item" collection="list" separator=",">
+            (#{item.id},#{item.outputid},#{item.datatime},#{item.datavalue})
+        </foreach>
+            ON DUPLICATE KEY UPDATE datavalue = VALUES(datavalue)
+    </insert>
+
 
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3