Files
xgy-oa/klp-ems/src/main/java/com/klp/ems/mapper/EmsEnergyConsumptionMapper.java
2025-12-09 16:43:45 +08:00

66 lines
2.4 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.klp.ems.mapper;
import com.klp.ems.domain.EmsEnergyConsumption;
import com.klp.ems.domain.bo.TimeRangeWithMetersBo;
import com.klp.ems.domain.bo.EmsEnergyConsumptionBo;
import com.klp.ems.domain.vo.EmsEnergyConsumptionVo;
import com.klp.common.core.mapper.BaseMapperPlus;
import com.klp.ems.domain.vo.SummaryDailyVo;
import com.klp.ems.domain.vo.SummaryMonthlyVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 能耗记录Mapper接口
*
* @author Joshi
* @date 2025-09-28
*/
public interface EmsEnergyConsumptionMapper extends BaseMapperPlus<EmsEnergyConsumptionMapper, EmsEnergyConsumption, EmsEnergyConsumptionVo> {
List<SummaryDailyVo> selectDailySummary(@Param("startDate") String startDate, @Param("endDate") String endDate);
List<SummaryMonthlyVo> selectMonthlySummary(@Param("year") String year);
/**
* 统计某个时间区间的用能合计
*/
Double sumConsumptionBetween(String startTime, String endTime);
/**
* 统计某个时间区间、指定设备集合的用能合计
*/
Double sumConsumptionBetweenWithMeters(TimeRangeWithMetersBo range);
List<SummaryDailyVo> selectDailySummaryWithMeters(TimeRangeWithMetersBo range);
List<SummaryMonthlyVo> selectMonthlySummaryWithMeters(TimeRangeWithMetersBo range);
EmsEnergyConsumption selectLatestBefore(@Param("meterId") Long meterId, @Param("endTime") String endTime);
List<EmsEnergyConsumption> selectOverlapRange(@Param("meterId") Long meterId,
@Param("startTime") String startTime,
@Param("endTime") String endTime);
EmsEnergyConsumption selectCoveringRange(@Param("meterId") Long meterId,
@Param("startTime") String startTime,
@Param("endTime") String endTime);
/**
* 查询指定计量表最近的两条抄表记录按endTime倒序
*/
List<EmsEnergyConsumption> selectLatestTwoReadings(@Param("meterId") Long meterId);
/**
* 获取能耗统计信息用SQL聚合函数计算
*/
Map<String, Object> getStatistics(EmsEnergyConsumptionBo bo);
/**
* 查询最近一次抄表的时间范围
*/
com.klp.ems.domain.vo.LatestMeterReadTimeVo selectLatestMeterReadTime();
}