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"