From 06803eb96090fdcf3b403322a578b488186b5889 Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Fri, 31 May 2024 16:39:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=87=8D=E8=A6=81=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E6=96=87=E4=BB=B6=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/mapper/DcEventImportantFileMapper.java | 11 +++++++++++ .../service/impl/DcEventImportantFileServiceImpl.java | 4 ++++ .../mapper/business/DcEventImportantFileMapper.xml | 3 +++ 3 files changed, 18 insertions(+) diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcEventImportantFileMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcEventImportantFileMapper.java index b0a4af04..fe605623 100644 --- a/zc-business/src/main/java/com/zc/business/mapper/DcEventImportantFileMapper.java +++ b/zc-business/src/main/java/com/zc/business/mapper/DcEventImportantFileMapper.java @@ -4,6 +4,7 @@ import java.util.List; import com.ruoyi.common.core.domain.AjaxResult; import com.zc.business.domain.DcEventImportantFile; +import org.apache.ibatis.annotations.Param; /** * 重要事件文件内容Mapper接口 @@ -61,6 +62,16 @@ public interface DcEventImportantFileMapper */ int deleteDcEventImportantFileByEventIds(String[] ids); + + /** + * 删除重要事件文件内容 + * + * @param eventId 事件id + * @param type 类型 + * @return 结果 + */ + int deleteDcEventImportantFile(@Param("eventId") String eventId, @Param("type") String type); + /** * 获取重要事件状态 * diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java index dffd4471..e19764b3 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java @@ -86,6 +86,10 @@ public class DcEventImportantFileServiceImpl implements IDcEventImportantFileSer if (StringUtils.isEmpty(dcEventImportantFile.getEventId())){ return AjaxResult.error("事件id不能为空!"); } + if ("1".equals(dcEventImportantFile.getType()) || "3".equals(dcEventImportantFile.getType())){ + dcEventImportantFileMapper.deleteDcEventImportantFile(dcEventImportantFile.getEventId(),dcEventImportantFile.getType()); + } + dcEventImportantFileMapper.selectDcEventImportantFileList(dcEventImportantFile); int i = dcEventImportantFileMapper.insertDcEventImportantFile(dcEventImportantFile); if (i > 0){ if (StringUtils.isNotEmpty(dcEventImportantFile.getStatus()) && "1".equals(dcEventImportantFile.getStatus())) { diff --git a/zc-business/src/main/resources/mapper/business/DcEventImportantFileMapper.xml b/zc-business/src/main/resources/mapper/business/DcEventImportantFileMapper.xml index f292981c..5e80d5f0 100644 --- a/zc-business/src/main/resources/mapper/business/DcEventImportantFileMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcEventImportantFileMapper.xml @@ -111,4 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{id} + + delete from dc_event_important_file where event_id = #{eventId} and type = #{type} + \ No newline at end of file