change(ems): 重构获取指定能源类型设备数量的方法名称

- 修改函数名称,提高代码可读性
- 更新 API路径,使用更具描述性的命名
- 调整 mapper XML 中的 SQL 查询
- 同步更新相关控制器、服务和 mapper 接口中的方法名称
IOT
zch 1 month ago
parent 9b807f0b02
commit c688d07e46

@ -119,8 +119,8 @@ public class EmsBaseMonitorInfoController extends BaseController
* @param energyType * @param energyType
* @return * @return
*/ */
@PostMapping("/getEnergyTypeCount/{energyType}") @PostMapping("/getMonitorCountByEnergyType/{energyType}")
public int getEnergyTypeCount(@PathVariable("energyType")String energyType){ public int getMonitorCountByEnergyType(@PathVariable("energyType")String energyType){
return emsBaseMonitorInfoService.getEnergyTypeCount(energyType); return emsBaseMonitorInfoService.getMonitorCountByEnergyType(energyType);
} }
} }

@ -71,5 +71,5 @@ public interface EmsBaseMonitorInfoMapper
* @param energyType * @param energyType
* @return * @return
*/ */
public int getEnergyTypeCount(String energyType); public int getMonitorCountByEnergyType(String energyType);
} }

@ -92,5 +92,5 @@ public interface IEmsBaseMonitorInfoService
* @param energyType * @param energyType
* @return * @return
*/ */
public int getEnergyTypeCount(String energyType); public int getMonitorCountByEnergyType(String energyType);
} }

@ -207,8 +207,8 @@ public class EmsBaseMonitorInfoServiceImpl implements IEmsBaseMonitorInfoService
* @return * @return
*/ */
@Override @Override
public int getEnergyTypeCount(String energyType){ public int getMonitorCountByEnergyType(String energyType){
return emsBaseMonitorInfoMapper.getEnergyTypeCount(energyType); return emsBaseMonitorInfoMapper.getMonitorCountByEnergyType(energyType);
} }
} }

@ -172,7 +172,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
</delete> </delete>
<select id="getEnergyTypeCount" parameterType="String" resultType="java.lang.Integer"> <select id="getMonitorCountByEnergyType" parameterType="String" resultType="java.lang.Integer">
select count(1) from ems_base_monitor_info where monitor_type = #{energyType} select count(1) from ems_base_monitor_info where monitor_type = #{energyType}
</select> </select>
</mapper> </mapper>

@ -52,10 +52,10 @@ export function getMonitorInfoTree(data) {
}) })
} }
//获取指定能源类型的设备数量。
export function getEnergyTypeCount(energyType) { export function getMonitorCountByEnergyType(energyType) {
return request({ return request({
url: '/ems/base/baseMonitorInfo/getEnergyTypeCount/' + energyType, url: '/ems/base/baseMonitorInfo/getMonitorCountByEnergyType/' + energyType,
method: 'post' method: 'post'
}) })
} }

Loading…
Cancel
Save