diff --git a/op-modules/op-device/src/main/java/com/op/device/mapper/EquCheckItemDetailMapper.java b/op-modules/op-device/src/main/java/com/op/device/mapper/EquCheckItemDetailMapper.java index d9715e33..f741f429 100644 --- a/op-modules/op-device/src/main/java/com/op/device/mapper/EquCheckItemDetailMapper.java +++ b/op-modules/op-device/src/main/java/com/op/device/mapper/EquCheckItemDetailMapper.java @@ -72,4 +72,10 @@ public interface EquCheckItemDetailMapper { * @return */ List selectEquCheckItemDetailByParentCode(String itemCode); + + /** + * 通过检查项id删除标准信息 + * @param itemId + */ + void deleteEquCheckItemDetailByItemId(String itemId); } diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquCheckItemServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquCheckItemServiceImpl.java index 0f8114bd..c32af306 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquCheckItemServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquCheckItemServiceImpl.java @@ -205,6 +205,9 @@ public class EquCheckItemServiceImpl implements IEquCheckItemService { @Override @DS("#header.poolName") public int deleteEquCheckItemByItemIds(String[] itemIds) { + for (String data : itemIds) { + equCheckItemDetailMapper.deleteEquCheckItemDetailByItemId(data); + } return equCheckItemMapper.deleteEquCheckItemByItemIds(itemIds); } @@ -217,6 +220,8 @@ public class EquCheckItemServiceImpl implements IEquCheckItemService { @Override @DS("#header.poolName") public int deleteEquCheckItemByItemId(String itemId) { + // 通过id删除标准信息 + equCheckItemDetailMapper.deleteEquCheckItemDetailByItemId(itemId); return equCheckItemMapper.deleteEquCheckItemByItemId(itemId); } } diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquCheckItemDetailMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquCheckItemDetailMapper.xml index 9d7aba5b..41fc3985 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquCheckItemDetailMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquCheckItemDetailMapper.xml @@ -47,22 +47,24 @@ and updated_by = #{updatedBy} and detail_code = #{detailCode} + and del_flag = '0' @@ -127,17 +129,24 @@ updated_by = #{updatedBy}, detail_code = #{detailCode}, - where detail_id = #{detailId} + where detail_id = #{detailId} and del_flag = '0' - delete from equ_check_item_detail where detail_id = #{detailId} + update equ_check_item_detail set del_flag = '1' where detail_id = #{detailId} - delete from equ_check_item_detail where detail_id in + update equ_check_item_detail set del_flag = '1' where detail_id in #{detailId} + + + update equ_check_item_detail + set del_flag = '1' + where parent_code = ( + select item_code from equ_check_item where item_id = #{itemId} ) + \ No newline at end of file diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquCheckItemMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquCheckItemMapper.xml index bc5fa342..06687e34 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquCheckItemMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquCheckItemMapper.xml @@ -47,23 +47,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and CONVERT(date,updated_time) >= #{updateTimeStart} and #{updateTimeEnd} >= CONVERT(date,updated_time) and updated_by like concat('%', #{updatedBy}, '%') + and del_flag = '0' + ORDER BY created_time DESC @@ -125,15 +127,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" updated_time = #{updatedTime}, updated_by = #{updatedBy}, - where item_id = #{itemId} + where item_id = #{itemId} and del_flag = '0' - delete from equ_check_item where item_id = #{itemId} + update equ_check_item set del_flag = '1' where item_id = #{itemId} - delete from equ_check_item where item_id in + update equ_check_item set del_flag = '1' where item_id in #{itemId}