feat(ems): 新增能耗统计分析功能

- 新增环比分析、同比分析接口与实现
- 支持按设备、能源类型、区域(含子区域)过滤统计
- 实现日、周、月、年维度的数据汇总与对比计算
- 扩展 Mapper 层支持带设备列表的时间区间查询
- 新增多个 VO 类用于封装分析结果数据结构
- 完善 Controller 接口接收过滤参数并调用服务层
-优化区域递归查找逻辑以支持层级结构查询
- 提供工具方法处理空值与比率计算
- 添加新的 BO 类用于传递查询与范围参数
- 更新配置文件注释但未启用新路由规则
This commit is contained in:
JR
2025-09-30 18:46:57 +08:00
parent 29c0c7bb73
commit c927ce247b
14 changed files with 562 additions and 27 deletions

View File

@@ -23,5 +23,21 @@
<result property="remark" column="remark"/>
</resultMap>
<select id="selectMeterIds" parameterType="com.klp.ems.domain.bo.MeterFilterBo" resultType="java.lang.Long">
SELECT meter_id
FROM ems_meter
WHERE del_flag = '0'
<if test="meterId != null">
AND meter_id = #{meterId}
</if>
<if test="energyTypeId != null">
AND energy_type_id = #{energyTypeId}
</if>
<if test="locationIds != null and locationIds.size() > 0">
AND location_id IN
<foreach collection="locationIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</select>
</mapper>