From 20efabdfd18d86a59f23a0435fb7ad14c38695f1 Mon Sep 17 00:00:00 2001 From: wws <18630710203@163.com> Date: Thu, 9 Nov 2023 17:26:23 +0800 Subject: [PATCH] =?UTF-8?q?=E7=82=B9=E6=A3=80-=E5=B7=A1=E6=A3=80-=E4=BF=9D?= =?UTF-8?q?=E5=85=BB-=E6=A3=80=E6=9F=A5=E9=A1=B9=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../op/device/mapper/EquPlanDetailMapper.java | 7 ++ .../device/mapper/EquPlanEquSpareMapper.java | 6 + .../device/mapper/EquPlanStandardMapper.java | 7 ++ .../service/impl/DevicePDAServiceImpl.java | 34 ++++-- .../service/impl/EquOrderServiceImpl.java | 105 ++++++++++++++++-- .../service/impl/EquPlanServiceImpl.java | 16 +-- .../impl/EquUpkeepOrderServiceImpl.java | 18 --- .../service/impl/EquUpkeepServiceImpl.java | 4 +- .../mapper/device/EquOrderDetailMapper.xml | 7 +- .../mapper/device/EquOrderEquMapper.xml | 7 +- .../mapper/device/EquOrderEquSpareMapper.xml | 9 +- .../mapper/device/EquOrderMapper.xml | 4 +- .../mapper/device/EquOrderPersonMapper.xml | 7 +- .../mapper/device/EquOrderStandardMapper.xml | 7 +- .../mapper/device/EquPlanDetailMapper.xml | 13 ++- .../mapper/device/EquPlanEquMapper.xml | 2 +- .../mapper/device/EquPlanEquSpareMapper.xml | 5 + .../mapper/device/EquPlanStandardMapper.xml | 8 +- 18 files changed, 197 insertions(+), 69 deletions(-) diff --git a/op-modules/op-device/src/main/java/com/op/device/mapper/EquPlanDetailMapper.java b/op-modules/op-device/src/main/java/com/op/device/mapper/EquPlanDetailMapper.java index 6253ac2b..57f8330f 100644 --- a/op-modules/op-device/src/main/java/com/op/device/mapper/EquPlanDetailMapper.java +++ b/op-modules/op-device/src/main/java/com/op/device/mapper/EquPlanDetailMapper.java @@ -77,4 +77,11 @@ public interface EquPlanDetailMapper { * @param planCode */ void delEquPlanDetailByPlanCode(String planCode); + + /** + * 通过parentCode查询检查项信息 + * @param code + * @return + */ + List selectEquPlanDetailListByParentCode(String code); } diff --git a/op-modules/op-device/src/main/java/com/op/device/mapper/EquPlanEquSpareMapper.java b/op-modules/op-device/src/main/java/com/op/device/mapper/EquPlanEquSpareMapper.java index e2c839f3..aaef78e5 100644 --- a/op-modules/op-device/src/main/java/com/op/device/mapper/EquPlanEquSpareMapper.java +++ b/op-modules/op-device/src/main/java/com/op/device/mapper/EquPlanEquSpareMapper.java @@ -64,4 +64,10 @@ public interface EquPlanEquSpareMapper { * @param planCode */ void deleteEquPlanEquSpareByPlanCode(String planCode); + + /** + * 逻辑删除 + * @param planCode + */ + void delEquPlanEquSpareByPlanCode(String planCode); } diff --git a/op-modules/op-device/src/main/java/com/op/device/mapper/EquPlanStandardMapper.java b/op-modules/op-device/src/main/java/com/op/device/mapper/EquPlanStandardMapper.java index 561ba164..962d8ff2 100644 --- a/op-modules/op-device/src/main/java/com/op/device/mapper/EquPlanStandardMapper.java +++ b/op-modules/op-device/src/main/java/com/op/device/mapper/EquPlanStandardMapper.java @@ -77,4 +77,11 @@ public interface EquPlanStandardMapper { * @param planCode */ void delEquPlanStandardByPlanCode(String planCode); + + /** + * 通过parentCode获取标准信息 + * @param code + * @return + */ + List selectEquPlanStandardListByParentCode(String code); } diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/DevicePDAServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/DevicePDAServiceImpl.java index 9bce7eef..e443d1d0 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/DevicePDAServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/DevicePDAServiceImpl.java @@ -59,7 +59,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService { /** - * 获取今日巡检任务工单list + * 获取今日巡检任务工单list-状态不为已完成 * * @return */ @@ -145,7 +145,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService { @DS("#header.poolName") public AjaxResult updateInspectionRecord(EquOrder equOrder) { - boolean checkRepair = false; + boolean hasError = false; EquOrderEqu equ = equOrder.getEqu(); List detailList = equ.getDetailList(); @@ -176,12 +176,12 @@ public class DevicePDAServiceImpl implements IDevicePDAService { int up = standard.getActualValue().compareTo(standard.getDetailUpLimit()); int down = standard.getActualValue().compareTo(standard.getDetailDownLimit()); if (!(up != 1 && down != -1)) { - checkRepair = true; + hasError = true; } }else { - // 未达标 + // TODO 未达标 if (standard.getDetailReach().equals("1")) { - checkRepair = true; + hasError = true; } } @@ -198,7 +198,17 @@ public class DevicePDAServiceImpl implements IDevicePDAService { equOrder.setPlanPerson(SecurityContextHolder.getUserName()); equOrder.setPlanPerson(SecurityContextHolder.getUserName()); - if (checkRepair) { + boolean checkRepair = false; + + if (equOrder.getRepairCode() == null){ + checkRepair = true; + }else { + if (equOrder.getRepairCode().isEmpty()){ + checkRepair = true; + } + } + + if (checkRepair && hasError) { // 获取故障报修流水号 EquRepairOrder equRepairOrder = new EquRepairOrder(); String serialNum = String.format("%03d", equRepairOrderMapper.selectOrderCodeSerialNumber()); @@ -213,6 +223,16 @@ public class DevicePDAServiceImpl implements IDevicePDAService { equRepairOrder.setCreateTime(DateUtils.getNowDate()); equRepairOrder.setCreateBy(SecurityUtils.getUsername()); equRepairOrder.setOrderStatus("待审核"); + // 报修来源 + if (equOrder.getPlanType().equals("inspection")){ + equRepairOrder.setOrderSource("巡检"); + } + if (equOrder.getPlanType().equals("spotInspection")){ + equRepairOrder.setOrderSource("点检"); + } + if (equOrder.getPlanType().equals("maintenance")){ + equRepairOrder.setOrderSource("保养"); + } HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); String key = "#header.poolName"; equRepairOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_","")); @@ -221,7 +241,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService { // 更新工单信息 equOrderMapper.updateEquOrder(equOrder); - return success(equOrder); + return success(); } //////////////////////报修 diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquOrderServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquOrderServiceImpl.java index 6511b4b2..53a1923b 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquOrderServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquOrderServiceImpl.java @@ -6,14 +6,22 @@ import java.util.List; import com.baomidou.dynamic.datasource.annotation.DS; import com.op.common.core.context.SecurityContextHolder; +import com.op.common.core.domain.BaseFileData; import com.op.common.core.utils.DateUtils; +import com.op.common.core.utils.StringUtils; +import com.op.common.core.utils.uuid.IdUtils; import com.op.common.core.web.domain.AjaxResult; +import com.op.common.security.utils.SecurityUtils; import com.op.device.domain.*; import com.op.device.mapper.*; import com.op.system.api.domain.SysUser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.op.device.service.IEquOrderService; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; import static com.op.common.core.web.domain.AjaxResult.success; @@ -39,6 +47,8 @@ public class EquOrderServiceImpl implements IEquOrderService { private PersonMapper personMapper; @Autowired private EquOrderEquSpareMapper equOrderEquSpareMapper; + @Autowired + private EquRepairOrderMapper equRepairOrderMapper; /** * 查询计划工单 @@ -125,25 +135,102 @@ public class EquOrderServiceImpl implements IEquOrderService { @Override @DS("#header.poolName") public AjaxResult updateEquOrder(EquOrder equOrder) { - // 更新工单信息 - equOrder.setOrderStart(equOrder.getTimeArray().get(0)); - equOrder.setOrderEnd(equOrder.getTimeArray().get(1)); - equOrder.setUpdateTime(DateUtils.getNowDate()); - equOrder.setUpdateBy(SecurityContextHolder.getUserName()); - equOrder.setPlanPerson(SecurityContextHolder.getUserName()); - equOrderMapper.updateEquOrder(equOrder); + boolean hasError = false; - // 更新标准信息 EquOrderEqu equ = equOrder.getEqu(); List detailList = equ.getDetailList(); for (EquOrderDetail detail : detailList) { List standardList = detail.getStandardList(); for (EquOrderStandard standard : standardList) { - standard.setUpdateBy(SecurityContextHolder.getUserName()); + + //上传附件 + if (StringUtils.isNotEmpty(standard.getPicturePath())) { + String[] ids = standard.getPicturePath().split(","); + List files = new ArrayList<>(); + BaseFileData file = null; + for (String id : ids) { + file = new BaseFileData(); + file.setFileId(IdUtils.fastSimpleUUID()); + file.setFileName(id.split("&fileName=")[1]); + file.setFileAddress(id); + file.setSourceId(standard.getId()); + file.setCreateBy(SecurityUtils.getUsername()); + file.setCreateTime(new Date()); + files.add(file); + } + equOrderStandardMapper.insertBaseFileBatch(files); + } + + // 校验标准信息-是否申请报修 + if (standard.getStandardType().equals("quantify")) { + int up = standard.getActualValue().compareTo(standard.getDetailUpLimit()); + int down = standard.getActualValue().compareTo(standard.getDetailDownLimit()); + if (!(up != 1 && down != -1)) { + hasError = true; + } + }else { + // TODO 未达标 + if (standard.getDetailReach().equals("1")) { + hasError = true; + } + } + + // 更新标准 standard.setUpdateTime(DateUtils.getNowDate()); equOrderStandardMapper.updateEquOrderStandard(standard); } } + + // 更新工单信息 + equOrder.setOrderStatus("1"); // 状态为已完成 + equOrder.setUpdateTime(DateUtils.getNowDate()); + equOrder.setUpdateBy(SecurityContextHolder.getUserName()); + equOrder.setPlanPerson(SecurityContextHolder.getUserName()); + equOrder.setPlanPerson(SecurityContextHolder.getUserName()); + + boolean checkRepair = false; + + if (equOrder.getRepairCode() == null){ + checkRepair = true; + }else { + if (equOrder.getRepairCode().isEmpty()){ + checkRepair = true; + } + } + + if (checkRepair && hasError ) { + // 获取故障报修流水号 + EquRepairOrder equRepairOrder = new EquRepairOrder(); + String serialNum = String.format("%03d", equRepairOrderMapper.selectOrderCodeSerialNumber()); + String equipmentCode = equOrder.getEquipmentCode(); + //报修单号 + equRepairOrder.setOrderCode("BX"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum); + //在主表中存入报修单号信息 + equOrder.setRepairCode(equRepairOrder.getOrderCode()); + + //新增报修记录 + equRepairOrder.setOrderId(IdUtils.fastSimpleUUID()); + equRepairOrder.setCreateTime(DateUtils.getNowDate()); + equRepairOrder.setCreateBy(SecurityUtils.getUsername()); + // 报修来源 + if (equOrder.getPlanType().equals("inspection")){ + equRepairOrder.setOrderSource("巡检"); + } + if (equOrder.getPlanType().equals("spotInspection")){ + equRepairOrder.setOrderSource("点检"); + } + if (equOrder.getPlanType().equals("maintenance")){ + equRepairOrder.setOrderSource("保养"); + } + equRepairOrder.setOrderStatus("待审核"); + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + String key = "#header.poolName"; + equRepairOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_","")); + equRepairOrderMapper.insertEquRepairOrder(equRepairOrder); + } + + // 更新工单信息 + equOrderMapper.updateEquOrder(equOrder); return success(); } diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquPlanServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquPlanServiceImpl.java index 2dbc138a..3ec0f2e7 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquPlanServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquPlanServiceImpl.java @@ -202,6 +202,8 @@ public class EquPlanServiceImpl implements IEquPlanService { equPlanDetailMapper.delEquPlanDetailByPlanCode(equPlan.getPlanCode()); equPlanEquMapper.delEquPlanEquByPlanCode(equPlan.getPlanCode()); equPlanStandardMapper.delEquPlanStandardByPlanCode(equPlan.getPlanCode()); + // TODO 有问题没有删除成功 + equPlanEquSpareMapper.delEquPlanEquSpareByPlanCode(equPlan.getPlanCode()); } return success(); } @@ -343,16 +345,10 @@ public class EquPlanServiceImpl implements IEquPlanService { for (EquPlanEqu equipment : equipmentList) { // 获取检查项list - EquPlanDetail selectDetail = new EquPlanDetail(); - selectDetail.setParentCode(equipment.getCode()); - selectDetail.setPlanCode(equPlan.getPlanCode()); - List detailList = equPlanDetailMapper.selectEquPlanDetailList(selectDetail); + List detailList = equPlanDetailMapper.selectEquPlanDetailListByParentCode(equipment.getCode()); for (EquPlanDetail detail : detailList) { // 获取标准list - EquPlanStandard selectStandard = new EquPlanStandard(); - selectStandard.setParentCode(detail.getCode()); - selectStandard.setPlanCode(equPlan.getPlanCode()); - List standardList = equPlanStandardMapper.selectEquPlanStandardList(selectStandard); + List standardList = equPlanStandardMapper.selectEquPlanStandardListByParentCode(detail.getCode()); for (EquPlanStandard standard : standardList) { standard.setShowFlag(true); } @@ -433,7 +429,7 @@ public class EquPlanServiceImpl implements IEquPlanService { if (item != null) { item.setId(IdUtils.fastSimpleUUID()); item.setPlanCode(equPlan.getPlanCode()); - item.setCode("C" + equPlan.getPlanCode() + String.format("%02d", ++itemCodeTemp)); + item.setCode("C" + equipment.getCode() + String.format("%02d", ++itemCodeTemp)); item.setParentCode(equipment.getCode()); item.setCreateBy(SecurityContextHolder.getUserName()); item.setCreateTime(DateUtils.getNowDate()); @@ -458,7 +454,7 @@ public class EquPlanServiceImpl implements IEquPlanService { standard.setId(IdUtils.fastSimpleUUID()); standard.setParentCode(item.getCode()); standard.setPlanCode(equPlan.getPlanCode()); - standard.setCode("D" + equPlan.getPlanCode() + String.format("%02d", ++detailCodeTemp)); + standard.setCode("D" + item.getCode() + String.format("%02d", ++detailCodeTemp)); standard.setCreateBy(SecurityContextHolder.getUserName()); standard.setCreateTime(DateUtils.getNowDate()); standard.setUpdateBy(SecurityContextHolder.getUserName()); diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquUpkeepOrderServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquUpkeepOrderServiceImpl.java index c76e5cef..62c92cb8 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquUpkeepOrderServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquUpkeepOrderServiceImpl.java @@ -209,24 +209,6 @@ public class EquUpkeepOrderServiceImpl implements IEquUpkeepOrderService { @Override @DS("#header.poolName") public AjaxResult updateEquOrder(EquOrder equOrder) { - // 更新保养工单信息 - equOrder.setOrderStart(equOrder.getTimeArray().get(0)); - equOrder.setOrderEnd(equOrder.getTimeArray().get(1)); - equOrder.setUpdateBy(SecurityContextHolder.getUserName()); - equOrder.setUpdateTime(DateUtils.getNowDate()); - equOrderMapper.updateEquOrder(equOrder); - - // 更新标准信息 - EquOrderEqu equ = equOrder.getEqu(); - List detailList = equ.getDetailList(); - for (EquOrderDetail detail : detailList) { - List standardList = detail.getStandardList(); - for (EquOrderStandard standard : standardList) { - standard.setUpdateBy(SecurityContextHolder.getUserName()); - standard.setUpdateTime(DateUtils.getNowDate()); - equOrderStandardMapper.updateEquOrderStandard(standard); - } - } return success(); } diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquUpkeepServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquUpkeepServiceImpl.java index bf0be342..090c41ea 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquUpkeepServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquUpkeepServiceImpl.java @@ -265,7 +265,7 @@ public class EquUpkeepServiceImpl implements IEquUpkeepService { if (item != null) { item.setId(IdUtils.fastSimpleUUID()); item.setPlanCode(equPlan.getPlanCode()); - item.setCode("C" + equPlan.getPlanCode() + String.format("%02d", ++itemCodeTemp)); + item.setCode("C" + equipment.getCode() + String.format("%02d", ++itemCodeTemp)); item.setParentCode(equipment.getCode()); item.setCreateBy(SecurityContextHolder.getUserName()); item.setCreateTime(DateUtils.getNowDate()); @@ -290,7 +290,7 @@ public class EquUpkeepServiceImpl implements IEquUpkeepService { standard.setId(IdUtils.fastSimpleUUID()); standard.setParentCode(item.getCode()); standard.setPlanCode(equPlan.getPlanCode()); - standard.setCode("D" + equPlan.getPlanCode() + String.format("%02d", ++detailCodeTemp)); + standard.setCode("D" + item.getCode() + String.format("%02d", ++detailCodeTemp)); standard.setCreateBy(SecurityContextHolder.getUserName()); standard.setCreateTime(DateUtils.getNowDate()); standard.setUpdateBy(SecurityContextHolder.getUserName()); diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquOrderDetailMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquOrderDetailMapper.xml index 9146edf7..969eb0fa 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquOrderDetailMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquOrderDetailMapper.xml @@ -44,22 +44,23 @@ and attr1 = #{attr1} and attr2 = #{attr2} and attr3 = #{attr3} + and del_flag = '0' diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquOrderEquMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquOrderEquMapper.xml index 13a9e0d3..1461f653 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquOrderEquMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquOrderEquMapper.xml @@ -38,17 +38,18 @@ and attr1 = #{attr1} and attr2 = #{attr2} and attr3 = #{attr3} + and del_flag = '0' @@ -107,7 +108,7 @@ update_by = #{updateBy}, update_time = #{updateTime}, - where id = #{id} + where id = #{id} and del_flag = '0' diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquOrderEquSpareMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquOrderEquSpareMapper.xml index d3771813..33e4447f 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquOrderEquSpareMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquOrderEquSpareMapper.xml @@ -42,22 +42,23 @@ and attr1 = #{attr1} and attr2 = #{attr2} and attr3 = #{attr3} + and del_flag = '0' @@ -122,7 +123,7 @@ update_by = #{updateBy}, update_time = #{updateTime}, - where id = #{id} + where id = #{id} and del_flag = '0' diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquOrderMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquOrderMapper.xml index e9b0ebe5..e445d71b 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquOrderMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquOrderMapper.xml @@ -85,7 +85,7 @@ - where order_id = #{orderId} + where order_id = #{orderId} and del_flag = '0' @@ -96,7 +97,7 @@ update_by = #{updateBy}, update_time = #{updateTime}, - where id = #{id} + where id = #{id} and del_flag = '0' diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquOrderStandardMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquOrderStandardMapper.xml index 8ef09295..34cd2420 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquOrderStandardMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquOrderStandardMapper.xml @@ -62,17 +62,18 @@ and repair_reach = #{repairReach} and repair_value = #{repairValue} and repair_picture = #{repairPicture} + and del_flag = '0' @@ -183,7 +184,7 @@ repair_value = #{repairValue}, repair_picture = #{repairPicture}, - where id = #{id} + where id = #{id} and del_flag = '0' diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquPlanDetailMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquPlanDetailMapper.xml index 15ffb1eb..7ab78a50 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquPlanDetailMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquPlanDetailMapper.xml @@ -48,17 +48,24 @@ and attr1 = #{attr1} and attr2 = #{attr2} and attr3 = #{attr3} + and del_flag = '0' + ORDER BY item_name + + @@ -132,7 +139,7 @@ update_by = #{updateBy}, update_time = #{updateTime}, - where id = #{id} + where id = #{id} and del_flag = '0' diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquPlanEquMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquPlanEquMapper.xml index a8e0cfec..4db0ccfb 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquPlanEquMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquPlanEquMapper.xml @@ -108,7 +108,7 @@ update_by = #{updateBy}, update_time = #{updateTime}, - where id = #{id} + where id = #{id} and del_flag = '0' diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquPlanEquSpareMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquPlanEquSpareMapper.xml index e6197090..25e17ae8 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquPlanEquSpareMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquPlanEquSpareMapper.xml @@ -129,4 +129,9 @@ delete from equ_plan_equ_spare where plan_code = #{planCode} + + + update equ_plan_equ_spare set del_flag = '1' where plan_code = #{planCode} and del_flag = '0' + + \ No newline at end of file diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquPlanStandardMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquPlanStandardMapper.xml index 621b0a0c..759f2caf 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquPlanStandardMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquPlanStandardMapper.xml @@ -48,6 +48,7 @@ and attr3 = #{attr3} and del_flag = '0' + ORDER BY standard_name - where plan_code = #{planCode} and del_flag ='0' + where plan_code = #{planCode} and del_flag ='0' ORDER BY standard_name + + +