From 7998c255ce88e6c4a59346cf01ebeb754a17c117 Mon Sep 17 00:00:00 2001 From: wenjy Date: Sun, 24 Apr 2022 10:05:28 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E4=BC=A0=E6=84=9F=E5=99=A8?= =?UTF-8?q?=E6=8A=A5=E8=AD=A6=E7=B1=BB=E5=9E=8B=E7=BC=96=E8=BE=91=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E6=A0=91=E5=BD=A2=E7=BB=93=E6=9E=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/base/BaseAlarmTypeController.java | 11 +++++++++-- .../resources/mapper/system/BaseAlarmTypeMapper.xml | 4 ++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseAlarmTypeController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseAlarmTypeController.java index 65fdc98..edaf5c3 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseAlarmTypeController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseAlarmTypeController.java @@ -139,11 +139,18 @@ public class BaseAlarmTypeController extends BaseController * 选择传感器报警类型树 */ @GetMapping(value = { "/selectAlarmTypeTree/{objId}", "/selectAlarmTypeTree/" }) - public String selectAlarmTypeTree(@PathVariable(value = "objId", required = false) Long objId, ModelMap mmap) + public String selectAlarmTypeTree(@PathVariable(value = "objId", required = false) String objId, ModelMap mmap) { + if (StringUtils.isNotNull(objId)) { - mmap.put("baseAlarmType", baseAlarmTypeService.selectBaseAlarmTypeByObjId(objId)); + BaseAlarmType baseAlarmType = new BaseAlarmType(); + baseAlarmType.setAlarmtypeId(objId); + List baseAlarmTypes = baseAlarmTypeService.selectBaseAlarmTypeList(baseAlarmType); + if(baseAlarmTypes.size() > 0){ + mmap.put("baseAlarmType", baseAlarmTypeService.selectBaseAlarmTypeByObjId(baseAlarmTypes.get(0).getObjId())); + } + } return prefix + "/tree"; } diff --git a/ruoyi-system/src/main/resources/mapper/system/BaseAlarmTypeMapper.xml b/ruoyi-system/src/main/resources/mapper/system/BaseAlarmTypeMapper.xml index 198ecf3..3c89301 100644 --- a/ruoyi-system/src/main/resources/mapper/system/BaseAlarmTypeMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/BaseAlarmTypeMapper.xml @@ -33,9 +33,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"