From 66eada5a3172f949292030af9643af4d32fc5a00 Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Wed, 17 Apr 2024 17:13:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E4=BE=A7=E9=87=8D=E8=A6=81?= =?UTF-8?q?=E7=B4=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/service/impl/DcEventImportantServiceImpl.java | 6 +++++- .../resources/mapper/business/DcEventImportantMapper.xml | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantServiceImpl.java index b4611cd3..0c951f7d 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantServiceImpl.java @@ -64,7 +64,11 @@ public class DcEventImportantServiceImpl implements IDcEventImportantService @Override public int updateDcEventImportant(DcEventImportant dcEventImportant) { - return dcEventImportantMapper.updateDcEventImportant(dcEventImportant); + int i = dcEventImportantMapper.updateDcEventImportant(dcEventImportant); + if (i < 1){ + i = dcEventImportantMapper.insertDcEventImportant(dcEventImportant); + } + return i; } /** diff --git a/zc-business/src/main/resources/mapper/business/DcEventImportantMapper.xml b/zc-business/src/main/resources/mapper/business/DcEventImportantMapper.xml index 2e61910a..700322c0 100644 --- a/zc-business/src/main/resources/mapper/business/DcEventImportantMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcEventImportantMapper.xml @@ -105,7 +105,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" chemicals_name = #{chemicalsName}, leakage_level = #{leakageLevel}, - where id = #{id} + where event_id = #{eventId}