From 7f0c0e84629f0ebe5e455c6c797ae0c47528c8de Mon Sep 17 00:00:00 2001 From: mashuai Date: Mon, 23 Sep 2024 13:20:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/bonus/base/mapper/TbBdDeviceRecordMapper.java | 7 +++++++ .../com/bonus/base/service/impl/TbBdRecordServiceImpl.java | 4 ++-- .../main/resources/mapper/base/TbBdDeviceRecordMapper.xml | 5 +++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/bonus-modules/bonus-base/src/main/java/com/bonus/base/mapper/TbBdDeviceRecordMapper.java b/bonus-modules/bonus-base/src/main/java/com/bonus/base/mapper/TbBdDeviceRecordMapper.java index ffa5ba8..abac1b2 100644 --- a/bonus-modules/bonus-base/src/main/java/com/bonus/base/mapper/TbBdDeviceRecordMapper.java +++ b/bonus-modules/bonus-base/src/main/java/com/bonus/base/mapper/TbBdDeviceRecordMapper.java @@ -43,4 +43,11 @@ public interface TbBdDeviceRecordMapper { * @return */ List getDeviceList(TbBdDeviceVo tbBdDeviceVo); + + /** + * 删除边带设备管理信息 + * @param id + * @return + */ + int deleteById(Long id); } \ No newline at end of file diff --git a/bonus-modules/bonus-base/src/main/java/com/bonus/base/service/impl/TbBdRecordServiceImpl.java b/bonus-modules/bonus-base/src/main/java/com/bonus/base/service/impl/TbBdRecordServiceImpl.java index 40f48fb..97cabe0 100644 --- a/bonus-modules/bonus-base/src/main/java/com/bonus/base/service/impl/TbBdRecordServiceImpl.java +++ b/bonus-modules/bonus-base/src/main/java/com/bonus/base/service/impl/TbBdRecordServiceImpl.java @@ -45,7 +45,7 @@ public class TbBdRecordServiceImpl implements TbBdRecordService{ //先清除设备绑定记录id,在进行删除 int result = 0; //根据前端传入的id,删除设备绑定记录 - result += tbBdDeviceRecordMapper.updateById(id); + result += tbBdDeviceRecordMapper.deleteById(id); result += tbBdRecordMapper.deleteByPrimaryKey(id); if (result > 0) { return AjaxResult.success(ExceptionEnum.SUCCESS.getMsg(), result); @@ -138,7 +138,7 @@ public class TbBdRecordServiceImpl implements TbBdRecordService{ } int result = 0; //根据前端传入的id,删除设备绑定记录 - result += tbBdDeviceRecordMapper.updateById(record.getId()); + result += tbBdDeviceRecordMapper.deleteById(record.getId()); //插入前对手机号进行sm4加密 record.setRelPhone(Sm4Utils.encode(record.getRelPhone())); //初始状态赋值待审核 diff --git a/bonus-modules/bonus-base/src/main/resources/mapper/base/TbBdDeviceRecordMapper.xml b/bonus-modules/bonus-base/src/main/resources/mapper/base/TbBdDeviceRecordMapper.xml index d382a79..fd664c8 100644 --- a/bonus-modules/bonus-base/src/main/resources/mapper/base/TbBdDeviceRecordMapper.xml +++ b/bonus-modules/bonus-base/src/main/resources/mapper/base/TbBdDeviceRecordMapper.xml @@ -182,12 +182,14 @@ #{item.id,jdbcType=BIGINT} + update tb_bd_device_record set record_id = null where record_id = #{id} + delete from tb_bd_device_record where id in @@ -196,6 +198,9 @@ + + delete from tb_bd_device_record where record_id = #{id} +