diff --git a/ruoyi-ems/src/main/java/com/ruoyi/ems/base/controller/EmsBaseMonitorInfoController.java b/ruoyi-ems/src/main/java/com/ruoyi/ems/base/controller/EmsBaseMonitorInfoController.java index c7ec706..61e02a5 100644 --- a/ruoyi-ems/src/main/java/com/ruoyi/ems/base/controller/EmsBaseMonitorInfoController.java +++ b/ruoyi-ems/src/main/java/com/ruoyi/ems/base/controller/EmsBaseMonitorInfoController.java @@ -119,8 +119,8 @@ public class EmsBaseMonitorInfoController extends BaseController * @param energyType 需要查询的能源类型。 * @return 返回指定能源类型的数量。 */ - @PostMapping("/getEnergyTypeCount/{energyType}") - public int getEnergyTypeCount(@PathVariable("energyType")String energyType){ - return emsBaseMonitorInfoService.getEnergyTypeCount(energyType); + @PostMapping("/getMonitorCountByEnergyType/{energyType}") + public int getMonitorCountByEnergyType(@PathVariable("energyType")String energyType){ + return emsBaseMonitorInfoService.getMonitorCountByEnergyType(energyType); } } diff --git a/ruoyi-ems/src/main/java/com/ruoyi/ems/base/mapper/EmsBaseMonitorInfoMapper.java b/ruoyi-ems/src/main/java/com/ruoyi/ems/base/mapper/EmsBaseMonitorInfoMapper.java index 2eaeb99..b75c826 100644 --- a/ruoyi-ems/src/main/java/com/ruoyi/ems/base/mapper/EmsBaseMonitorInfoMapper.java +++ b/ruoyi-ems/src/main/java/com/ruoyi/ems/base/mapper/EmsBaseMonitorInfoMapper.java @@ -71,5 +71,5 @@ public interface EmsBaseMonitorInfoMapper * @param energyType 需要查询的能源类型。 * @return 返回指定能源类型的数量。 */ - public int getEnergyTypeCount(String energyType); + public int getMonitorCountByEnergyType(String energyType); } diff --git a/ruoyi-ems/src/main/java/com/ruoyi/ems/base/service/IEmsBaseMonitorInfoService.java b/ruoyi-ems/src/main/java/com/ruoyi/ems/base/service/IEmsBaseMonitorInfoService.java index 63687d7..0da94d1 100644 --- a/ruoyi-ems/src/main/java/com/ruoyi/ems/base/service/IEmsBaseMonitorInfoService.java +++ b/ruoyi-ems/src/main/java/com/ruoyi/ems/base/service/IEmsBaseMonitorInfoService.java @@ -92,5 +92,5 @@ public interface IEmsBaseMonitorInfoService * @param energyType 需要查询的能源类型。 * @return 返回指定能源类型的数量。 */ - public int getEnergyTypeCount(String energyType); + public int getMonitorCountByEnergyType(String energyType); } diff --git a/ruoyi-ems/src/main/java/com/ruoyi/ems/base/service/impl/EmsBaseMonitorInfoServiceImpl.java b/ruoyi-ems/src/main/java/com/ruoyi/ems/base/service/impl/EmsBaseMonitorInfoServiceImpl.java index 5a0ac7b..848f269 100644 --- a/ruoyi-ems/src/main/java/com/ruoyi/ems/base/service/impl/EmsBaseMonitorInfoServiceImpl.java +++ b/ruoyi-ems/src/main/java/com/ruoyi/ems/base/service/impl/EmsBaseMonitorInfoServiceImpl.java @@ -207,8 +207,8 @@ public class EmsBaseMonitorInfoServiceImpl implements IEmsBaseMonitorInfoService * @return 返回指定能源类型的数量。 */ @Override - public int getEnergyTypeCount(String energyType){ - return emsBaseMonitorInfoMapper.getEnergyTypeCount(energyType); + public int getMonitorCountByEnergyType(String energyType){ + return emsBaseMonitorInfoMapper.getMonitorCountByEnergyType(energyType); } } diff --git a/ruoyi-ems/src/main/resources/mapper/ems/base/EmsBaseMonitorInfoMapper.xml b/ruoyi-ems/src/main/resources/mapper/ems/base/EmsBaseMonitorInfoMapper.xml index fff4856..2577fad 100644 --- a/ruoyi-ems/src/main/resources/mapper/ems/base/EmsBaseMonitorInfoMapper.xml +++ b/ruoyi-ems/src/main/resources/mapper/ems/base/EmsBaseMonitorInfoMapper.xml @@ -172,7 +172,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select count(1) from ems_base_monitor_info where monitor_type = #{energyType} diff --git a/ruoyi-ui/src/api/ems/base/baseMonitorInfo.js b/ruoyi-ui/src/api/ems/base/baseMonitorInfo.js index 9354921..82835e1 100644 --- a/ruoyi-ui/src/api/ems/base/baseMonitorInfo.js +++ b/ruoyi-ui/src/api/ems/base/baseMonitorInfo.js @@ -52,10 +52,10 @@ export function getMonitorInfoTree(data) { }) } - -export function getEnergyTypeCount(energyType) { +//获取指定能源类型的设备数量。 +export function getMonitorCountByEnergyType(energyType) { return request({ - url: '/ems/base/baseMonitorInfo/getEnergyTypeCount/' + energyType, + url: '/ems/base/baseMonitorInfo/getMonitorCountByEnergyType/' + energyType, method: 'post' }) }