Browse Source

新增能源管理-能耗总览接口

lw 1 year ago
parent
commit
e7480ca5c9
16 changed files with 1070 additions and 3 deletions
  1. 13 1
      jeecg-boot-base-core/src/main/java/org/jeecg/common/util/DateUtils.java
  2. 2 0
      jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/JeecgSystemApplication.java
  3. 2 0
      module_base/src/main/java/org/jeecg/modules/elecfeeBase/mapper/ElecfeeBaseMapper.java
  4. 2 0
      module_base/src/main/java/org/jeecg/modules/energyItem/mapper/EnergyItemMapper.java
  5. 0 2
      module_base/src/main/java/org/jeecg/modules/energyPlan/service/impl/EnergyPlanServiceImpl.java
  6. 2 0
      module_ems/src/main/java/org/jeecg/modules/dataCurrent/mapper/DataCurrentMapper.java
  7. 2 0
      module_ems/src/main/java/org/jeecg/modules/dataElectricity/mapper/DataElectricityMapper.java
  8. 2 0
      module_ems/src/main/java/org/jeecg/modules/dataPower/mapper/DataPowerMapper.java
  9. 2 0
      module_ems/src/main/java/org/jeecg/modules/dataVoltage/mapper/DataVoltageMapper.java
  10. 111 0
      module_ems/src/main/java/org/jeecg/modules/emsStatistics/controller/EmsStatisticsController.java
  11. 58 0
      module_ems/src/main/java/org/jeecg/modules/emsStatistics/entity/EmsStatistics.java
  12. 248 0
      module_ems/src/main/java/org/jeecg/modules/emsStatistics/mapper/EmsStatisticsMapper.java
  13. 154 0
      module_ems/src/main/java/org/jeecg/modules/emsStatistics/mapper/xml/EmsStatisticsMapper.xml
  14. 93 0
      module_ems/src/main/java/org/jeecg/modules/emsStatistics/service/IEmsStatisticsService.java
  15. 377 0
      module_ems/src/main/java/org/jeecg/modules/emsStatistics/service/impl/IEmsStatisticsServiceImpl.java
  16. 2 0
      module_tpm/src/main/java/org/jeecg/modules/tpmEquipment/mapper/TpmEquipmentMapper.java

+ 13 - 1
jeecg-boot-base-core/src/main/java/org/jeecg/common/util/DateUtils.java

@@ -638,6 +638,18 @@ public class DateUtils extends PropertyEditorSupport {
         return Long.valueOf(DateUtils.yyyymmddhhmmss.get().format(new Date()));
         return Long.valueOf(DateUtils.yyyymmddhhmmss.get().format(new Date()));
     }
     }
 
 
+    public static String parseDateToStr(String format, Date date) {
+        return new SimpleDateFormat(format).format(date);
+    }
+
+    public static String getLastDay(String year, String month) {
+        Calendar cal= Calendar.getInstance();
+        cal.set(Calendar.YEAR ,Integer.parseInt(year));
+        cal.set(Calendar.MONTH ,Integer.parseInt(month)-1);
+        cal.set(Calendar.DAY_OF_MONTH ,cal.getActualMaximum(Calendar.DATE));
+        return new SimpleDateFormat("yyyy-MM-dd").format(cal.getTime());
+    }
+
     /**
     /**
      * String类型 转换为Date, 如果参数长度为10 转换格式”yyyy-MM-dd“ 如果参数长度为19 转换格式”yyyy-MM-dd
      * String类型 转换为Date, 如果参数长度为10 转换格式”yyyy-MM-dd“ 如果参数长度为19 转换格式”yyyy-MM-dd
      * HH:mm:ss“ * @param text String类型的时间值
      * HH:mm:ss“ * @param text String类型的时间值
@@ -684,4 +696,4 @@ public class DateUtils extends PropertyEditorSupport {
         return null;
         return null;
     }
     }
 
 
-}
+}

+ 2 - 0
jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/JeecgSystemApplication.java

@@ -8,6 +8,7 @@ import org.springframework.boot.builder.SpringApplicationBuilder;
 import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
 import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
 import org.springframework.context.ConfigurableApplicationContext;
 import org.springframework.context.ConfigurableApplicationContext;
 import org.springframework.core.env.Environment;
 import org.springframework.core.env.Environment;
+import org.springframework.scheduling.annotation.EnableAsync;
 import org.springframework.scheduling.annotation.EnableScheduling;
 import org.springframework.scheduling.annotation.EnableScheduling;
 
 
 import java.net.InetAddress;
 import java.net.InetAddress;
@@ -20,6 +21,7 @@ import java.net.UnknownHostException;
 @Slf4j
 @Slf4j
 @SpringBootApplication
 @SpringBootApplication
 @EnableScheduling
 @EnableScheduling
+@EnableAsync
 //@EnableAutoConfiguration(exclude={MongoAutoConfiguration.class})
 //@EnableAutoConfiguration(exclude={MongoAutoConfiguration.class})
 public class JeecgSystemApplication extends SpringBootServletInitializer {
 public class JeecgSystemApplication extends SpringBootServletInitializer {
 
 

+ 2 - 0
module_base/src/main/java/org/jeecg/modules/elecfeeBase/mapper/ElecfeeBaseMapper.java

@@ -2,6 +2,7 @@ package org.jeecg.modules.elecfeeBase.mapper;
 
 
 import java.util.List;
 import java.util.List;
 
 
+import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.elecfeeBase.entity.ElecfeeBase;
 import org.jeecg.modules.elecfeeBase.entity.ElecfeeBase;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -12,6 +13,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  * @Date:   2024-01-23
  * @Date:   2024-01-23
  * @Version: V1.0
  * @Version: V1.0
  */
  */
+@Mapper
 public interface ElecfeeBaseMapper extends BaseMapper<ElecfeeBase> {
 public interface ElecfeeBaseMapper extends BaseMapper<ElecfeeBase> {
 
 
 }
 }

+ 2 - 0
module_base/src/main/java/org/jeecg/modules/energyItem/mapper/EnergyItemMapper.java

@@ -2,6 +2,7 @@ package org.jeecg.modules.energyItem.mapper;
 
 
 import java.util.List;
 import java.util.List;
 
 
+import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.energyItem.entity.EnergyItem;
 import org.jeecg.modules.energyItem.entity.EnergyItem;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -12,6 +13,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  * @Date:   2024-01-23
  * @Date:   2024-01-23
  * @Version: V1.0
  * @Version: V1.0
  */
  */
+@Mapper
 public interface EnergyItemMapper extends BaseMapper<EnergyItem> {
 public interface EnergyItemMapper extends BaseMapper<EnergyItem> {
 
 
 }
 }

+ 0 - 2
module_base/src/main/java/org/jeecg/modules/energyPlan/service/impl/EnergyPlanServiceImpl.java

@@ -1,7 +1,5 @@
 package org.jeecg.modules.energyPlan.service.impl;
 package org.jeecg.modules.energyPlan.service.impl;
 
 
-import org.apache.catalina.core.ApplicationContext;
-import org.apache.naming.factory.BeanFactory;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.modules.energyPlan.dto.TimeRangeEnergyPlan;
 import org.jeecg.modules.energyPlan.dto.TimeRangeEnergyPlan;
 import org.jeecg.modules.energyPlan.entity.EnergyPlan;
 import org.jeecg.modules.energyPlan.entity.EnergyPlan;

+ 2 - 0
module_ems/src/main/java/org/jeecg/modules/dataCurrent/mapper/DataCurrentMapper.java

@@ -2,6 +2,7 @@ package org.jeecg.modules.dataCurrent.mapper;
 
 
 import java.util.List;
 import java.util.List;
 
 
+import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.dataCurrent.entity.DataCurrent;
 import org.jeecg.modules.dataCurrent.entity.DataCurrent;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -12,6 +13,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  * @Date:   2024-01-19
  * @Date:   2024-01-19
  * @Version: V1.0
  * @Version: V1.0
  */
  */
+@Mapper
 public interface DataCurrentMapper extends BaseMapper<DataCurrent> {
 public interface DataCurrentMapper extends BaseMapper<DataCurrent> {
 
 
 }
 }

+ 2 - 0
module_ems/src/main/java/org/jeecg/modules/dataElectricity/mapper/DataElectricityMapper.java

@@ -2,6 +2,7 @@ package org.jeecg.modules.dataElectricity.mapper;
 
 
 import java.util.List;
 import java.util.List;
 
 
+import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.dataElectricity.entity.DataElectricity;
 import org.jeecg.modules.dataElectricity.entity.DataElectricity;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -12,6 +13,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  * @Date:   2024-01-19
  * @Date:   2024-01-19
  * @Version: V1.0
  * @Version: V1.0
  */
  */
+@Mapper
 public interface DataElectricityMapper extends BaseMapper<DataElectricity> {
 public interface DataElectricityMapper extends BaseMapper<DataElectricity> {
 
 
 }
 }

+ 2 - 0
module_ems/src/main/java/org/jeecg/modules/dataPower/mapper/DataPowerMapper.java

@@ -2,6 +2,7 @@ package org.jeecg.modules.dataPower.mapper;
 
 
 import java.util.List;
 import java.util.List;
 
 
+import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.dataPower.entity.DataPower;
 import org.jeecg.modules.dataPower.entity.DataPower;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -12,6 +13,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  * @Date:   2024-01-19
  * @Date:   2024-01-19
  * @Version: V1.0
  * @Version: V1.0
  */
  */
+@Mapper
 public interface DataPowerMapper extends BaseMapper<DataPower> {
 public interface DataPowerMapper extends BaseMapper<DataPower> {
 
 
 }
 }

+ 2 - 0
module_ems/src/main/java/org/jeecg/modules/dataVoltage/mapper/DataVoltageMapper.java

@@ -2,6 +2,7 @@ package org.jeecg.modules.dataVoltage.mapper;
 
 
 import java.util.List;
 import java.util.List;
 
 
+import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.dataVoltage.entity.DataVoltage;
 import org.jeecg.modules.dataVoltage.entity.DataVoltage;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -12,6 +13,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  * @Date:   2024-01-19
  * @Date:   2024-01-19
  * @Version: V1.0
  * @Version: V1.0
  */
  */
+@Mapper
 public interface DataVoltageMapper extends BaseMapper<DataVoltage> {
 public interface DataVoltageMapper extends BaseMapper<DataVoltage> {
 
 
 }
 }

+ 111 - 0
module_ems/src/main/java/org/jeecg/modules/emsStatistics/controller/EmsStatisticsController.java

@@ -0,0 +1,111 @@
+package org.jeecg.modules.emsStatistics.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.modules.emsStatistics.service.IEmsStatisticsService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Map;
+
+@Api(tags = "能耗管理")
+@RestController
+@RequestMapping("/emsStatistics")
+public class EmsStatisticsController {
+
+    @Autowired
+    private IEmsStatisticsService emsStatisticsService;
+
+    /**
+     * 能耗总览
+     */
+    @ApiOperation("能耗总览")
+    @GetMapping(value = "/energyOverview")
+    public Result<Map<String, Object>> energyOverview(String spaceId) {
+        return emsStatisticsService.energyOverview(spaceId);
+    }
+
+    /**
+     * 需量分析
+     */
+    @ApiOperation("需量分析")
+    @GetMapping("/demandanalysis")
+    public Result<Object> demandAnalysis(String spaceId, String beginTime, String endTime) {
+        return emsStatisticsService.DemandAnalysis(spaceId, beginTime, endTime);
+    }
+
+    /**
+     * 节能分析
+     */
+    @ApiOperation("节能分析")
+    @GetMapping("/savinganalysis")
+    public Result<Object> savingAnalysis(String spaceId, String yearMonth) {
+        return emsStatisticsService.savingAnalysis(spaceId, yearMonth);
+    }
+
+    /**
+     * 能耗排名
+     */
+    @ApiOperation("能耗排名")
+    @GetMapping("/ranking")
+    public Result<Object> ranking(String spaceId, String beginTime, String endTime) {
+        return emsStatisticsService.ranking(spaceId, beginTime, endTime);
+    }
+
+    /**
+     * 分项能耗
+     */
+    @ApiOperation("分项能耗")
+    @GetMapping("/itemizedenergy")
+    public Result<Object> itemizedEnergy(String spaceId, String day) {
+        return emsStatisticsService.itemizedEnergy(spaceId, day);
+    }
+
+    /**
+     * 用能平衡分析
+     */
+    @ApiOperation("用能平衡分析")
+    @GetMapping("/energybalanceanalysis")
+    public Result<Object> energyBalanceAnalysis() {
+        return emsStatisticsService.energyBalanceAnalysis();
+    }
+
+    /**
+     * 峰平谷分析
+     */
+    @ApiOperation("峰平谷分析")
+    @GetMapping("/peakvalleyanalysis")
+    public Result<Object> peakValleyAnalysis() {
+        return emsStatisticsService.peakValleyAnalysis();
+    }
+
+    /**
+     * 能耗定额
+     */
+    @ApiOperation("能耗定额")
+    @GetMapping("/energyauota")
+    public Result<Object> energyQuota() {
+        return emsStatisticsService.energyQuota();
+    }
+
+    /**
+     * 能流分析
+     */
+    @ApiOperation("能流分析")
+    @GetMapping("/energyflowAnalysis")
+    public Result<Object> energyFlowAnalysis(String spaceId, String beginTime, String endTime) {
+        return emsStatisticsService.energyFlowAnalysis(spaceId, beginTime, endTime);
+    }
+
+    /**
+     * 查询设备详情(按日期查询电量、电量、电压、功率)
+     */
+    @ApiOperation("查询设备详情(按日期查询电量、电量、电压、功率)")
+    @GetMapping("/searchEquipmentDetail")
+    public Result<Object> searchEquipmentDetail(String equipmentid, String day, String tagtype) {
+        return emsStatisticsService.searchEquipmentDetail(equipmentid, day, tagtype);
+    }
+}

+ 58 - 0
module_ems/src/main/java/org/jeecg/modules/emsStatistics/entity/EmsStatistics.java

@@ -0,0 +1,58 @@
+package org.jeecg.modules.emsStatistics.entity;
+
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+@ApiModel(value="能耗总览统计", description="能耗总览统计")
+public class EmsStatistics {
+    /** 设备id */
+    private String equipmentid;
+
+    /** 设备名称 */
+    private String equipmentname;
+
+    /** 所属年*/
+    private Integer year;
+
+    /** 所属月*/
+    private Integer month;
+
+    /** 所属周*/
+    private Integer week;
+
+    /** 日期*/
+    private String day;
+
+    /** 年月*/
+    private String yearmonth;
+
+    /** 周几*/
+    private Integer dayofweek;
+
+    /**发生次数*/
+    private Integer howManyTimes;
+
+    /**发生次数2*/
+    private Integer howManyTimes2;
+
+    /**值*/
+    private float howManyValue;
+
+    /**值2*/
+    private float howManyValue2;
+
+    /**查询ids*/
+    private List<String> ids;
+
+    /** 类别 */
+    private String type;
+
+    /**其它值1*/
+    private float otherValue;
+
+    /**其它值2*/
+    private float otherValue2;
+}

+ 248 - 0
module_ems/src/main/java/org/jeecg/modules/emsStatistics/mapper/EmsStatisticsMapper.java

@@ -0,0 +1,248 @@
+package org.jeecg.modules.emsStatistics.mapper;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.emsStatistics.entity.EmsStatistics;
+
+import java.util.List;
+
+/**
+ * 能源分析
+ *
+ * @author ruoyi
+ * @date 2022-04-02
+ */
+@Mapper
+public interface EmsStatisticsMapper {
+    /**
+     * 某月top5用电量
+     *
+     * @param emsStatistics 参数:年、月
+     * @return 分析统计
+     */
+    public List<EmsStatistics> selectMonthElectricity(EmsStatistics emsStatistics);
+
+    /**
+     * 某月某设备用电量
+     *
+     * @param emsStatistics 参数:年、月、设备ID
+     * @return 分析统计
+     */
+    public EmsStatistics selectMonthEquipElectricity(EmsStatistics emsStatistics);
+
+    /**
+     * 获取某个月的需量信息
+     *
+     * @param emsStatistics 参数:年、月
+     * @return 分析统计
+     */
+    public List<EmsStatistics> selectMonthDemand(EmsStatistics emsStatistics);
+
+    /**
+     * 获取环境信息(二氧化碳排放、温度、湿度)
+     *
+     * @param emsStatistics 参数:年、月
+     * @return 分析统计
+     */
+    public List<EmsStatistics> selectEnvironment(EmsStatistics emsStatistics);
+
+    /**
+     * 能源消耗总标煤
+     *
+     * @param emsStatistics 参数:年、月
+     * @return 分析统计
+     */
+    public List<EmsStatistics> selectKgceMonth(EmsStatistics emsStatistics);
+
+    /**
+     * 能源消耗总标煤-依据配电室的电表来计算
+     *
+     * @param emsStatistics 参数:年、月
+     * @return 分析统计
+     */
+    public List<EmsStatistics> selectKgceMonthTotal(EmsStatistics emsStatistics);
+
+    /**
+     * 总用电趋势
+     *
+     * @param emsStatistics 参数:年、月
+     * @return 分析统计
+     */
+    public List<EmsStatistics> selectItemElectricityMonth(EmsStatistics emsStatistics);
+
+    /**
+     * 最大需量查询
+     *
+     * @param ids 多个设备ID
+     * @param yearMonth 年月
+     * @return 分析统计
+     */
+    public Float SelectMaxDmand(@Param("ids") List<Long> ids, @Param("yearmonth") String yearMonth);
+
+    /**
+     * 实际用能、计划用能、累计节能
+     *
+     * @param ids 多个设备ID
+     * @param yearMonth 年月
+     * @return 分析统计
+     */
+    public List<EmsStatistics> selectEnergyConsum(@Param("ids") List<Long> ids, @Param("yearMonth") String yearMonth);
+
+    /**
+     * 依据多个设备的ID获取某天的计划用能
+     *
+     * @param ids 多个设备ID
+     * @param day 天
+     * @return 分析统计
+     */
+    public List<EmsStatistics> selectEnergyByDay(@Param("ids") List<Long> ids, @Param("day") String day);
+
+    /**
+     * 依据多个设备ID和开始结束年月获取能耗排名
+     *
+     * @param ids 多个设备ID
+     * @param beginTime 开始年月
+     * @param endTime 结束年月
+     * @return 分析统计
+     */
+    public List<EmsStatistics> selectRankByEquipmentAndYearmonth(@Param("ids") List<Long> ids,
+                                                                  @Param("beginTime") String beginTime,
+                                                                  @Param("endTime") String endTime);
+
+    /**
+     * 依据设备ID和年月获取能耗总量
+     *
+     * @param equipmentid 设备ID
+     * @param beginTime 开始年月
+     * @param endTime 结束年月
+     * @return 分析统计
+     */
+    public Float selectAllElecByEquipmentAndYearmonth(@Param("equipmentid") Long equipmentid,
+                                                     @Param("beginTime") String beginTime,
+                                                     @Param("endTime") String endTime);
+
+    /**
+     * 依据个设备的ID和日期获取能耗分项
+     *
+     * @param ids 设备ID
+     * @param day 日期
+     * @return 分析统计
+     */
+    public List<EmsStatistics> selectItemByEquipidAndDay(@Param("ids") List<String> ids, @Param("day") String day);
+
+    /**
+     * 依据个设备的ID和日期获取能耗分项-依据配电室的电表来计算
+     *
+     * @param ids 设备ID
+     * @param day 日期
+     * @return 分析统计
+     */
+    public List<EmsStatistics> selectItemByEquipidAndDayTotal(@Param("ids") List<String> ids, @Param("day") String day);
+
+    /**
+     * 依据个设备的ID和年、周获取能耗分项
+     *
+     * @param ids 设备ID
+     * @param year 年
+     * @param week 周
+     * @return 分析统计
+     */
+    public List<EmsStatistics> selectItemByEquipidAndYearweek(@Param("ids") List<Long> ids,
+                                                            @Param("year") Integer year,
+                                                            @Param("week") Integer week);
+
+    /**
+     * 依据个设备的ID和年、周获取能耗分项-依据配电室的电表来计算
+     *
+     * @param ids 设备ID
+     * @param year 年
+     * @param week 周
+     * @return 分析统计
+     */
+    public List<EmsStatistics> selectItemByEquipidAndYearweekTotal(@Param("ids") List<Long> ids,
+                                                              @Param("year") Integer year,
+                                                              @Param("week") Integer week);
+
+    /**
+     * 依据个设备的ID和年、月获取能耗分项
+     *
+     * @param ids 设备ID
+     * @param year 年
+     * @param month 月
+     * @return 分析统计
+     */
+    public List<EmsStatistics> selectItemByEquipidAndYearmonth(@Param("ids") List<Long> ids,
+                                                              @Param("year") Integer year,
+                                                              @Param("month") Integer month);
+
+    /**
+     * 依据个设备的ID和年、月获取能耗分项-依据配电室的电表来计算
+     *
+     * @param ids 设备ID
+     * @param year 年
+     * @param month 月
+     * @return 分析统计
+     */
+    public List<EmsStatistics> selectItemByEquipidAndYearmonthTotal(@Param("ids") List<Long> ids,
+                                                               @Param("year") Integer year,
+                                                               @Param("month") Integer month);
+
+    /**
+     * 依据多个设备的ID和日期、开始结束时间获取能耗分项
+     *
+     * @param ids 设备ID
+     * @param day 天
+     * @param beginTime 开始时间
+     * @param beginTime 结束时间
+     * @return 分析统计
+     */
+    public List<EmsStatistics> selectItemByEquipidAndDaytime(@Param("ids") List<Long> ids,
+                                                            @Param("day") String day,
+                                                            @Param("beginTime") String beginTime,
+                                                            @Param("endTime") String endTime);
+
+    /**
+     * 依据多个设备的ID和日期、开始结束时间获取能耗分项-依据配电室的电表来计算
+     *
+     * @param ids 设备ID
+     * @param day 天
+     * @param beginTime 开始时间
+     * @param beginTime 结束时间
+     * @return 分析统计
+     */
+    public List<EmsStatistics> selectItemByEquipidAndDaytimeTotal(@Param("ids") List<Long> ids,
+                                                                 @Param("day") String day,
+                                                                 @Param("beginTime") String beginTime,
+                                                                 @Param("endTime") String endTime);
+
+    /**
+     * 依据多个设备的ID、能耗分项ID、开始结束日期获取能耗分项
+     *
+     * @param ids 设备ID
+     * @param energyitemid 能耗分项ID
+     * @param beginTime 开始日期
+     * @param beginTime 结束日期
+     * @return 分析统计
+     */
+    public List<EmsStatistics> selectElecByEquipAndItem(@Param("ids") List<Long> ids,
+                                                         @Param("energyitemid") Long energyitemid,
+                                                         @Param("beginTime") String beginTime,
+                                                         @Param("endTime") String endTime);
+
+    /**
+     * 查询分析统计
+     *
+     * @param
+     * @return 分析统计
+     */
+    public List<EmsStatistics> selectHowManyTimesGroupByMonth();
+
+    /**
+     * 查询分析统计
+     *
+     * @param
+     * @return 分析统计
+     */
+    public List<EmsStatistics> selectHowManyTimesGroupByYear();
+
+}

+ 154 - 0
module_ems/src/main/java/org/jeecg/modules/emsStatistics/mapper/xml/EmsStatisticsMapper.xml

@@ -0,0 +1,154 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.emsStatistics.mapper.EmsStatisticsMapper">
+
+
+    <select id="selectMonthElectricity" resultType="org.jeecg.modules.emsStatistics.entity.EmsStatistics">
+        select equipmentid,equipmentname,year,month,ifnull(sum(electricityvalue),0) as howManyValue
+        from ems_data_electricity_day
+        where year=#{year} and month=#{month}
+        and equipmentid in
+        <foreach collection="ids" item="item" open="(" close=")" separator=",">
+            #{item}
+        </foreach>
+        group by equipmentid
+        order by howManyValue desc
+        limit 5;
+    </select>
+    <select id="selectMonthEquipElectricity" resultType="org.jeecg.modules.emsStatistics.entity.EmsStatistics">
+        select equipmentid,equipmentname,year,month,ifnull(sum(electricityvalue),0) as howManyValue2
+        from ems_data_electricity_day
+        where year=#{year} and month=#{month} and equipmentid=#{equipmentid}
+        limit 1;
+    </select>
+    <select id="selectMonthDemand" resultType="org.jeecg.modules.emsStatistics.entity.EmsStatistics">
+        select '需量峰值' as type, max(tagvalue) as howManyValue
+        from ems_data_demand
+        where year=#{year} and month=#{month}
+        union
+        select a.* from (
+                            select '即时需量' as type, tagvalue as howManyValue
+                            from ems_data_demand
+                            where year=#{year} and month=#{month}
+                            order by id desc
+                            limit 1
+                        ) as a
+        union
+        select b.* from (
+                            select '目标需量' as type, kva as howManyValue
+                            from base_elecfee_base
+                            where begintime &lt;= now() and ifnull(endtime, now()) &gt;= now()
+                            order by id desc
+                            limit 1
+                        ) as b
+    </select>
+    <select id="selectEnvironment" resultType="org.jeecg.modules.emsStatistics.entity.EmsStatistics">
+        select 'CO2排放' as type, round(max(electricityvalue)*(select co2 from base_energy_type where name='电' limit 1), 3) as howManyValue
+        from ems_data_electricity_day
+        where year=#{year} and month=#{month}
+        and equipmentid in
+        <foreach collection="ids" item="item" open="(" close=")" separator=",">
+            #{item}
+        </foreach>
+        union
+        select a.* from (
+        select '室外湿度' as type, tagvalue as howManyValue
+        from tpm_tag where tagtype='1'
+        order by id
+        limit 1
+        ) as a
+        union
+        select b.* from (
+        select '室外温度' as type, tagvalue as howManyValue
+        from tpm_tag where tagtype='0'
+        order by id
+        limit 1
+        ) as b
+    </select>
+    <select id="selectKgceMonthTotal" resultType="org.jeecg.modules.emsStatistics.entity.EmsStatistics">
+        select 290016788021249 as energyitemid,'动力用电' as type,round(ifnull(sum(e.electricityvalue),0)*y.kgce,3) as howManyValue
+        from ems_data_electricity_day as e,base_energy_type as y
+        where e.year=#{year} and e.month=#{month} and e.equipmentid in (301156930748417,301156962205697) and y.name='电'
+        union
+        select 290016823672833 as energyitemid,'空调用电' as type,round(ifnull(sum(e.electricityvalue),0)*y.kgce,3) as howManyValue
+        from ems_data_electricity_day as e,base_energy_type as y
+        where e.year=#{year} and e.month=#{month} and e.equipmentid in (301156947525633) and y.name='电'
+        union
+        select 290016857227265 as energyitemid,'其它用电' as type,
+               round((
+                             (
+                                 select ifnull(sum(electricityvalue),0)
+                                 from ems_data_electricity_day
+                                 where equipmentid in (301156882513921) and year=#{year} and month=#{month}
+                             ) -
+                             (
+                                 select ifnull(sum(electricityvalue),0)
+                                 from ems_data_electricity_day
+                                 where equipmentid in (301156930748417,301156962205697) and year=#{year} and month=#{month}
+                             ) -
+                             (
+                                 select ifnull(sum(electricityvalue),0)
+                                 from ems_data_electricity_day
+                                 where equipmentid in (301156947525633) and year=#{year} and month=#{month}
+                             )
+                         )*y.kgce,3) as howManyValue
+        from base_energy_type as y
+        where y.name='电'
+    </select>
+    <select id="selectKgceMonth" resultType="org.jeecg.modules.emsStatistics.entity.EmsStatistics">
+        select t.energyitemid,i.energyitemname as type,round(ifnull(sum(e.electricityvalue),0)*y.kgce,3) as howManyValue
+        from ems_data_electricity_day as e,tpm_tag as t,base_energy_item as i,base_energy_type as y
+        where e.tagid=t.id and t.energyitemid=i.id and e.year=#{year} and e.month=#{month}
+        and i.energytypeid=y.id and y.name='电'
+        and e.equipmentid in
+        <foreach collection="ids" item="item" open="(" close=")" separator=",">
+            #{item}
+        </foreach>
+        group by t.energyitemid
+    </select>
+    <select id="selectItemByEquipidAndDayTotal"
+            resultType="org.jeecg.modules.emsStatistics.entity.EmsStatistics">
+        select 290016788021249 as energyitemid,'动力用电' as equipmentname, '能耗分项' as type,ifnull(sum(e.electricityvalue),0) as howManyValue
+        from ems_data_electricity_day as e
+        where e.day=#{day} and e.equipmentid in (301156930748417,301156962205697)
+        union
+        select 290016823672833 as energyitemid,'空调用电' as equipmentname, '能耗分项' as type,ifnull(sum(e.electricityvalue),0) as howManyValue
+        from ems_data_electricity_day as e
+        where e.day=#{day} and e.equipmentid in (301156947525633)
+        union
+        select 290016857227265 as energyitemid,'其它用电' as equipmentname, '能耗分项' as type,
+               (
+                   select ifnull(sum(electricityvalue),0)
+                   from ems_data_electricity_day
+                   where equipmentid in (301156882513921) and day=#{day}
+               ) -
+               (
+                   select ifnull(sum(electricityvalue),0)
+                   from ems_data_electricity_day
+                   where equipmentid in (301156930748417,301156962205697) and day=#{day}
+               ) -
+               (
+                   select ifnull(sum(electricityvalue),0)
+                   from ems_data_electricity_day
+                   where equipmentid in (301156947525633) and day=#{day}
+               ) as howManyValue
+    </select>
+    <select id="selectItemByEquipidAndDay" resultType="org.jeecg.modules.emsStatistics.entity.EmsStatistics">
+        select t.energyitemid as equipmentid,i.energyitemname as equipmentname, '能耗分项' as type,ifnull(sum(e.electricityvalue),0) as howManyValue
+        from ems_data_electricity_day as e,tpm_tag as t,base_energy_item as i,base_energy_type as y
+        where e.tagid=t.id t.energyitemid=i.energyitemid and e.day=#{day}
+        and i.energytypeid=y.energytypeid and y.name='电'
+        and e.equipmentid in (
+        select equipmentid
+        from tpm_equipment_status
+        )
+        and e.equipmentid in
+        <foreach collection="ids" item="item" open="(" close=")" separator=",">
+            #{item}
+        </foreach>
+        group by t.energyitemid
+        order by t.energyitemid asc
+    </select>
+</mapper>

+ 93 - 0
module_ems/src/main/java/org/jeecg/modules/emsStatistics/service/IEmsStatisticsService.java

@@ -0,0 +1,93 @@
+package org.jeecg.modules.emsStatistics.service;
+
+import org.jeecg.common.api.vo.Result;
+
+import java.util.Map;
+
+public interface IEmsStatisticsService {
+    /**
+     * 能耗总览
+     *
+     * @param spaceId 区域ID
+     * @return 分析统计
+     */
+    Result<Map<String,Object>> energyOverview(String spaceId);
+
+    /**
+     * 需量分析
+     *
+     * @param spaceId 区域ID
+     * @param beginTime 开始年月
+     * @param endTime 结束年月
+     * @return 分析统计
+     */
+    Result<Object> DemandAnalysis(String spaceId, String beginTime, String endTime);
+
+    /**
+     * 节能分析
+     *
+     * @param spaceId 区域ID
+     * @param yearMonth 年月
+     */
+    Result<Object> savingAnalysis(String spaceId, String yearMonth);
+
+    /**
+     * 能耗排名
+     *
+     * @param spaceId 区域ID
+     * @param beginTime 开始年月
+     * @param endTime 结束年月
+     * @return 分析统计
+     */
+    Result<Object> ranking(String spaceId, String beginTime, String endTime);
+
+    /**
+     * 分项能耗
+     *
+     * @param spaceId 区域ID
+     * @param day 某天
+     * @return 分析统计
+     */
+    Result<Object> itemizedEnergy(String spaceId, String day);
+
+    /**
+     * 用能平衡分析
+     *
+     * @return 分析统计
+     */
+    Result<Object> energyBalanceAnalysis();
+
+    /**
+     * 峰平谷分析
+     *
+     * @return 分析统计
+     */
+    Result<Object> peakValleyAnalysis();
+
+    /**
+     * 能耗定额
+     *
+     * @return 分析统计
+     */
+    Result<Object> energyQuota();
+
+    /**
+     * 能流分析
+     *
+     * @param spaceId 区域ID
+     * @param beginTime 开始日期
+     * @param endTime 结束日期
+     * @return 分析统计
+     */
+    Result<Object> energyFlowAnalysis(String spaceId, String beginTime, String endTime);
+
+    /**
+     * 查询设备详情(按日期查询电量、电量、电压、功率)
+     *
+     * @param equipmentid 设备ID
+     * @param day 日期
+     * @param tagtype 类型
+     * @return 分析统计
+     */
+    Result<Object> searchEquipmentDetail(String equipmentid, String day, String tagtype);
+}

+ 377 - 0
module_ems/src/main/java/org/jeecg/modules/emsStatistics/service/impl/IEmsStatisticsServiceImpl.java

@@ -0,0 +1,377 @@
+package org.jeecg.modules.emsStatistics.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.util.DateUtils;
+import org.jeecg.modules.baseSpace.entity.Space;
+import org.jeecg.modules.baseSpace.service.ISpaceService;
+import org.jeecg.modules.dataCurrent.mapper.DataCurrentMapper;
+import org.jeecg.modules.dataElectricity.mapper.DataElectricityMapper;
+import org.jeecg.modules.dataPower.mapper.DataPowerMapper;
+import org.jeecg.modules.dataVoltage.mapper.DataVoltageMapper;
+import org.jeecg.modules.elecfeeBase.mapper.ElecfeeBaseMapper;
+import org.jeecg.modules.emsStatistics.entity.EmsStatistics;
+import org.jeecg.modules.emsStatistics.mapper.EmsStatisticsMapper;
+import org.jeecg.modules.emsStatistics.service.IEmsStatisticsService;
+import org.jeecg.modules.energyItem.mapper.EnergyItemMapper;
+import org.jeecg.modules.tpmEquipment.entity.TpmEquipment;
+import org.jeecg.modules.tpmEquipment.mapper.TpmEquipmentMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.text.SimpleDateFormat;
+import java.time.LocalDate;
+import java.time.temporal.IsoFields;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service
+public class IEmsStatisticsServiceImpl implements IEmsStatisticsService {
+
+    @Autowired
+    private EmsStatisticsMapper emsStatisticsMapper;
+
+    @Autowired
+    private ISpaceService spaceService;
+
+    @Autowired
+    private TpmEquipmentMapper equipmentMapper;
+
+    @Autowired
+    private DataElectricityMapper electricityMapper;
+
+    @Autowired
+    private EnergyItemMapper energyItemMapper;
+
+    @Autowired
+    private ElecfeeBaseMapper elecfeeBaseMapper;
+
+    @Autowired
+    private DataCurrentMapper dataCurrentMapper;
+
+    @Autowired
+    private DataVoltageMapper dataVoltageMapper;
+
+    @Autowired
+    private DataPowerMapper dataPowerMapper;
+
+    /**
+     * 能耗总览
+     *
+     * @param spaceId 区域ID
+     * @return 分析统计
+     */
+    @Override
+    public Result<Map<String, Object>> energyOverview(String spaceId) {
+        HashMap<String, Object> map = new HashMap<>();
+        Calendar calendar = Calendar.getInstance();
+        // 设置当前的时间戳
+        calendar.setTime(new Date());
+        // 设置星期一为一周开始的第一天
+        calendar.setFirstDayOfWeek(Calendar.MONDAY);
+        // 获得当前日期所属周
+        LocalDate localDate = LocalDate.parse(new SimpleDateFormat("yyyy-MM-dd").format(new Date()));
+        int week = localDate.get(IsoFields.WEEK_OF_WEEK_BASED_YEAR);
+
+        // 获得当前日期所属月
+        int month = calendar.get(Calendar.MONTH) + 1;
+        // 获得当前日期所属年
+        int year = calendar.get(Calendar.YEAR);
+
+        // 上个月
+        Calendar calendarLast = Calendar.getInstance();
+        calendarLast.setTime(new Date());
+        calendarLast.add(Calendar.MONTH, -1);
+        // 获得上个月
+        int monthLast = calendarLast.get(Calendar.MONTH) + 1;
+        // 获得上个月所属年
+        int yearLast = calendarLast.get(Calendar.YEAR);
+
+        // 正常查询参数(只包括年、月)
+        EmsStatistics statisticsParams = new EmsStatistics();
+        statisticsParams.setEquipmentid(spaceId);
+        statisticsParams.setYear(year);
+        statisticsParams.setMonth(month);
+
+        //区域基本信息
+        Space space = spaceService.getById(spaceId);
+        if (Objects.isNull(space)) space = new Space();
+        map.put("energySpace", space);
+
+        // 本月用电top5
+        LambdaQueryWrapper<TpmEquipment> eq = new LambdaQueryWrapper<TpmEquipment>()
+                .eq(TpmEquipment::getSpaceid, spaceId)
+                .select(TpmEquipment::getId);
+        List<TpmEquipment> equipments = equipmentMapper.selectList(eq);
+        List<String> equipmentids = new ArrayList<>();
+        if (equipments != null && !equipments.isEmpty()) {
+            equipmentids = equipments.stream().map(TpmEquipment::getId).collect(Collectors.toList());
+        }
+        // 设置区域下的所有的设备信息
+        statisticsParams.setIds(equipmentids);
+        // 如果选择的是整个厂区的,需要去掉配电室几个
+        if ("AREA0002".equals(space.getSerialnum())) {
+            equipmentids.remove("301156882513921L");
+            equipmentids.remove("301156930748417L");
+            equipmentids.remove("301156947525633L");
+            equipmentids.remove("301156962205697L");
+        }
+
+        List<EmsStatistics> topStatistics = new ArrayList<>();
+        if (equipmentids.size() > 0) {
+            topStatistics = emsStatisticsMapper.selectMonthElectricity(statisticsParams);
+        }
+        // top5上个月的用电量
+        if (topStatistics != null && topStatistics.size() > 0) {
+            for (EmsStatistics topStatistic : topStatistics) {
+                EmsStatistics top5LastParams = new EmsStatistics();
+                top5LastParams.setYear(yearLast);
+                top5LastParams.setMonth(monthLast);
+                top5LastParams.setEquipmentid(topStatistic.getEquipmentid());
+                EmsStatistics lastValue = emsStatisticsMapper.selectMonthEquipElectricity(top5LastParams);
+                if (lastValue != null) {
+                    topStatistic.setHowManyValue2(lastValue.getHowManyValue2());
+                }
+            }
+            map.put("top5Statistics", topStatistics);
+        } else {
+            map.put("top5Statistics", new ArrayList<>());
+        }
+
+        // 用电需量
+        List<EmsStatistics> demandStatistics = emsStatisticsMapper.selectMonthDemand(statisticsParams);
+        if (demandStatistics == null || demandStatistics.isEmpty()) {
+            demandStatistics = new ArrayList<>();
+            EmsStatistics demand = new EmsStatistics();
+
+            demand.setType("需量峰值");
+            demand.setHowManyValue(0);
+            demandStatistics.add(demand);
+
+            demand.setType("即时需量");
+            demand.setHowManyValue(0);
+            demandStatistics.add(demand);
+
+            demand.setType("目标需量");
+            demand.setHowManyValue(0);
+            demandStatistics.add(demand);
+        }
+
+        if (demandStatistics.size() < 3) {
+
+            List<EmsStatistics> demands1 = demandStatistics.stream().filter(sta -> "需量峰值".equals(sta.getType())).collect(Collectors.toList());
+            if (demands1.size() < 1) {
+                EmsStatistics demand = new EmsStatistics();
+                demand.setType("需量峰值");
+                demand.setHowManyValue(0);
+                demandStatistics.add(demand);
+            }
+
+            List<EmsStatistics> demands2 = demandStatistics.stream().filter(sta -> "即时需量".equals(sta.getType())).collect(Collectors.toList());
+            if (demands2.size() < 1) {
+                EmsStatistics demand = new EmsStatistics();
+                demand.setType("即时需量");
+                demand.setHowManyValue(0);
+                demandStatistics.add(demand);
+            }
+
+            List<EmsStatistics> demands3 = demandStatistics.stream().filter(sta -> "目标需量".equals(sta.getType())).collect(Collectors.toList());
+            if (demands3.size() < 1) {
+                EmsStatistics demand = new EmsStatistics();
+                demand.setType("目标需量");
+                demand.setHowManyValue(0);
+                demandStatistics.add(demand);
+            }
+        }
+        map.put("demandStatistics", demandStatistics);
+
+        // 环境信息
+        List<EmsStatistics> environmentStatistics = new ArrayList<>();
+        // 如果选择的是整个厂区的,则只需要获取总控的二氧化碳信息即可
+        if ("AREA0002".equals(space.getSerialnum())) {
+            EmsStatistics statisticsParams1 = new EmsStatistics();
+            List<String> equip1 = new ArrayList<>();
+            equip1.add("301156882513921L");
+            statisticsParams1.setIds(equip1);
+            statisticsParams1.setYear(year);
+            statisticsParams1.setMonth(month);
+            environmentStatistics = emsStatisticsMapper.selectEnvironment(statisticsParams1);
+        }
+        else if (equipmentids.size() > 0) {
+            environmentStatistics = emsStatisticsMapper.selectEnvironment(statisticsParams);
+        }
+        map.put("environmentStatistics", environmentStatistics);
+
+        // 能源消耗总标煤
+        List<EmsStatistics> kgceStatistics = new ArrayList<>();
+
+        // 如果选择的是整个厂区、配电室的,则只需要获取配电室的几个表的信息即可
+        if ("AREA0002".equals(space.getSerialnum()) || "AREA0015".equals(space.getSerialnum())) {
+            kgceStatistics = emsStatisticsMapper.selectKgceMonthTotal(statisticsParams);
+        }
+        else if (equipmentids.size() > 0) {
+            kgceStatistics = emsStatisticsMapper.selectKgceMonth(statisticsParams);
+        }
+        map.put("kgceStatistics", kgceStatistics);
+
+        // 总用电趋势图
+        String yearMonth = DateUtils.parseDateToStr("yyyy-MM", new Date());
+        String thisdate = DateUtils.getLastDay(yearMonth.substring(0,4), yearMonth.substring(5));
+        int lastDay = Integer.parseInt(thisdate.substring(8));
+
+        List<String> daysplitStr = new ArrayList<>(); // 天数拆分
+        List<Float> dongli = new ArrayList<>();
+        List<Float> zhaoming = new ArrayList<>();
+        List<Float> kongtiao = new ArrayList<>();
+        List<Float> qita = new ArrayList<>();
+
+
+        for(int i = 1; i < lastDay; i++) {
+            String day = i < 10 ? "0" + i : String.valueOf(i);
+            daysplitStr.add(day);
+            dongli.add(0f);
+            zhaoming.add(0f);
+            kongtiao.add(0f);
+            qita.add(0f);
+            List<EmsStatistics> dayStatis = null;
+            // 如果选择的是整个厂区、配电室的,则只需要获取配电室的几个表的信息即可
+            if ("AREA0002".equals(space.getSerialnum()) || "AREA0015".equals(space.getSerialnum())) {
+                dayStatis = emsStatisticsMapper.selectItemByEquipidAndDayTotal(equipmentids,yearMonth + "-" + day);
+            }
+            else if (equipmentids.size() > 0) {
+                dayStatis = emsStatisticsMapper.selectItemByEquipidAndDay(equipmentids,yearMonth + "-" + day);
+            }
+            if (dayStatis != null && dayStatis.size() > 0) {
+                for (EmsStatistics daysta : dayStatis) {
+                    switch (daysta.getEquipmentname()) {
+                        case "动力用电":
+                            dongli.set(i - 1, daysta.getHowManyValue());
+                            break;
+                        case "照明用电":
+                            zhaoming.set(i - 1, daysta.getHowManyValue());
+                            break;
+                        case "空调用电":
+                            kongtiao.set(i - 1, daysta.getHowManyValue());
+                            break;
+                        case "其它用电":
+                            qita.set(i - 1, daysta.getHowManyValue());
+                            break;
+                    }
+                }
+            }
+        }
+        map.put("daysplit", daysplitStr);
+        map.put("dongli", dongli);
+        map.put("zhaoming", zhaoming);
+        map.put("kongtiao", kongtiao);
+        map.put("qita", qita);
+        return Result.ok(map);
+    }
+
+    /**
+     * 需量分析
+     *
+     * @param spaceId   区域ID
+     * @param beginTime 开始年月
+     * @param endTime   结束年月
+     * @return 分析统计
+     */
+    @Override
+    public Result<Object> DemandAnalysis(String spaceId, String beginTime, String endTime) {
+        return null;
+    }
+
+    /**
+     * 节能分析
+     *
+     * @param spaceId   区域ID
+     * @param yearMonth 年月
+     */
+    @Override
+    public Result<Object> savingAnalysis(String spaceId, String yearMonth) {
+        return null;
+    }
+
+    /**
+     * 能耗排名
+     *
+     * @param spaceId   区域ID
+     * @param beginTime 开始年月
+     * @param endTime   结束年月
+     * @return 分析统计
+     */
+    @Override
+    public Result<Object> ranking(String spaceId, String beginTime, String endTime) {
+        return null;
+    }
+
+    /**
+     * 分项能耗
+     *
+     * @param spaceId 区域ID
+     * @param day     某天
+     * @return 分析统计
+     */
+    @Override
+    public Result<Object> itemizedEnergy(String spaceId, String day) {
+        return null;
+    }
+
+    /**
+     * 用能平衡分析
+     *
+     * @return 分析统计
+     */
+    @Override
+    public Result<Object> energyBalanceAnalysis() {
+        return null;
+    }
+
+    /**
+     * 峰平谷分析
+     *
+     * @return 分析统计
+     */
+    @Override
+    public Result<Object> peakValleyAnalysis() {
+        return null;
+    }
+
+    /**
+     * 能耗定额
+     *
+     * @return 分析统计
+     */
+    @Override
+    public Result<Object> energyQuota() {
+        return null;
+    }
+
+    /**
+     * 能流分析
+     *
+     * @param spaceId   区域ID
+     * @param beginTime 开始日期
+     * @param endTime   结束日期
+     * @return 分析统计
+     */
+    @Override
+    public Result<Object> energyFlowAnalysis(String spaceId, String beginTime, String endTime) {
+        return null;
+    }
+
+    /**
+     * 查询设备详情(按日期查询电量、电量、电压、功率)
+     *
+     * @param equipmentid 设备ID
+     * @param day         日期
+     * @param tagtype     类型
+     * @return 分析统计
+     */
+    @Override
+    public Result<Object> searchEquipmentDetail(String equipmentid, String day, String tagtype) {
+        return null;
+    }
+
+
+}

+ 2 - 0
module_tpm/src/main/java/org/jeecg/modules/tpmEquipment/mapper/TpmEquipmentMapper.java

@@ -2,6 +2,7 @@ package org.jeecg.modules.tpmEquipment.mapper;
 
 
 import java.util.List;
 import java.util.List;
 
 
+import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.tpmEquipment.entity.TpmEquipment;
 import org.jeecg.modules.tpmEquipment.entity.TpmEquipment;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -12,6 +13,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  * @Date:   2024-01-10
  * @Date:   2024-01-10
  * @Version: V1.0
  * @Version: V1.0
  */
  */
+@Mapper
 public interface TpmEquipmentMapper extends BaseMapper<TpmEquipment> {
 public interface TpmEquipmentMapper extends BaseMapper<TpmEquipment> {
 
 
 }
 }