Browse Source

数据管理-需量分析-统计图数据查询

jichaobo 3 years ago
parent
commit
6f8cba4239

+ 21 - 0
fiveep-controller/src/main/java/com/bizmatics/controller/web/ConsumeEnergyConfigController.java

@@ -0,0 +1,21 @@
+package com.bizmatics.controller.web;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.stereotype.Controller;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author ya
+ * @since 2021-10-13
+ */
+@Controller
+@RequestMapping("/consumeEnergyConfig")
+public class ConsumeEnergyConfigController {
+
+}
+

+ 36 - 3
fiveep-controller/src/main/java/com/bizmatics/controller/web/HtAnalogDataController.java

@@ -107,23 +107,56 @@ public class HtAnalogDataController {
     }
     }
 
 
 
 
+    /**
+     *数据管理-同比分析报表-统计图数据查询
+     * @param dataManagementVO
+     * @return
+     */
     @GetMapping("yearOnYearList")
     @GetMapping("yearOnYearList")
     public ApiResult<List<CommonIcoVO>> yearOnYearList(@RequestBody DataManagementVO dataManagementVO) {
     public ApiResult<List<CommonIcoVO>> yearOnYearList(@RequestBody DataManagementVO dataManagementVO) {
         return ApiResult.success(htAnalogDataService.yearOnYearList(dataManagementVO));
         return ApiResult.success(htAnalogDataService.yearOnYearList(dataManagementVO));
     }
     }
 
 
 
 
+    /**
+     *数据管理-环比分析报表-统计图数据查询
+     * @param dataManagementVO
+     * @return
+     */
     @GetMapping("ringRatioList")
     @GetMapping("ringRatioList")
     public ApiResult<List<CommonIcoOneVO>> ringRatioList(@RequestBody DataManagementVO dataManagementVO) {
     public ApiResult<List<CommonIcoOneVO>> ringRatioList(@RequestBody DataManagementVO dataManagementVO) {
         return ApiResult.success(htAnalogDataService.ringRatioList(dataManagementVO));
         return ApiResult.success(htAnalogDataService.ringRatioList(dataManagementVO));
     }
     }
 
 
+    /**
+     *数据管理-用能月报-统计图数据查询
+     * @param deviceCode 设备编号
+     * @param cycle 1.日报表 2.月报表 3.年报表
+     * @param startTime 开始时间
+     * @param endTime 结束时间
+     * @return
+     */
     @GetMapping("monthlyReport")
     @GetMapping("monthlyReport")
     public ApiResult<List<CommonIcoVO>> monthlyReport(@RequestParam String deviceCode,
     public ApiResult<List<CommonIcoVO>> monthlyReport(@RequestParam String deviceCode,
-                                                         @RequestParam int cycle,
-                                                         @RequestParam String startTime,
-                                                         @RequestParam String endTime) {
+                                                      @RequestParam int cycle,
+                                                      @RequestParam String startTime,
+                                                      @RequestParam String endTime) {
         return ApiResult.success(htAnalogDataService.monthlyReport(deviceCode, cycle, startTime, endTime));
         return ApiResult.success(htAnalogDataService.monthlyReport(deviceCode, cycle, startTime, endTime));
     }
     }
+
+    /**
+     * 数据管理-需量分析-统计图数据查询
+     * @param deviceCode 设备编号
+     * @param cycle 1.电费结算周期 2.自然月
+     * @param monthDate 时间 xxxx-xx
+     * @return
+     */
+    @GetMapping("demandAnalysis")
+    public ApiResult<List<CommonIcoVO>> demandAnalysis(@RequestParam String deviceCode,
+                                                       @RequestParam int cycle,
+                                                       @RequestParam String monthDate) {
+        return ApiResult.success(htAnalogDataService.demandAnalysis(deviceCode, monthDate, cycle));
+
+    }
 }
 }
 
 

+ 98 - 0
fiveep-model/src/main/java/com/bizmatics/model/ConsumeEnergyConfig.java

@@ -0,0 +1,98 @@
+package com.bizmatics.model;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author ya
+ * @since 2021-10-13
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class ConsumeEnergyConfig implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 能源配置表主键ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 能源类型:1.电 2.水 3.气 4.汽 5.煤 6.冷 7.热 8.光伏 9.火电 10.水电 11.风电 12.其他
+     */
+    private Integer energyType;
+
+    /**
+     * 设备名称
+     */
+    private String deviceName;
+
+    /**
+     * 监控设备
+     */
+    private String deviceCode;
+
+    /**
+     * 站点ID
+     */
+    private Integer siteId;
+
+    /**
+     * 变量:1.正有功电度 2.负有功电度 3.正无功电度 4.负无功电度
+     */
+    private Integer variable;
+
+    /**
+     * 计量级别:1站点级 2.其他
+     */
+    private Integer meteringLevel;
+
+    /**
+     * 支路
+     */
+    private String accessRd;
+
+    /**
+     * 分项
+     */
+    private String subItem;
+
+    /**
+     * 部门
+     */
+    private String department;
+
+    /**
+     * 分区
+     */
+    private String partition;
+
+    /**
+     * 使能标识(0 不生效,1 生效)
+     */
+    private Integer enable;
+
+    /**
+     * 创建人
+     */
+    private String creator;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime creatorTime;
+
+
+}

+ 16 - 0
fiveep-persistence/src/main/java/com/bizmatics/persistence/mapper/ConsumeEnergyConfigMapper.java

@@ -0,0 +1,16 @@
+package com.bizmatics.persistence.mapper;
+
+import com.bizmatics.model.ConsumeEnergyConfig;
+import com.bizmatics.common.mvc.base.CrudMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author ya
+ * @since 2021-10-13
+ */
+public interface ConsumeEnergyConfigMapper extends CrudMapper<ConsumeEnergyConfig> {
+
+}

+ 3 - 0
fiveep-persistence/src/main/java/com/bizmatics/persistence/mapper/HtAnalogDataMapper.java

@@ -103,4 +103,7 @@ public interface HtAnalogDataMapper extends CrudMapper<HtAnalogData> {
                                        @Param("cycle") int cycle,
                                        @Param("cycle") int cycle,
                                        @Param("sign") int sign);
                                        @Param("sign") int sign);
 
 
+    List<HtAnalogDataVo> demandAnalysisList(@Param("deviceCode") String deviceCode,
+                                            @Param("monthDate") String monthDate);
+
 }
 }

+ 23 - 0
fiveep-persistence/src/main/resources/mapper/mysql/ConsumeEnergyConfigMapper.xml

@@ -0,0 +1,23 @@
+<?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="com.bizmatics.persistence.mapper.ConsumeEnergyConfigMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.bizmatics.model.ConsumeEnergyConfig">
+        <id column="id" property="id" />
+        <result column="energy_type" property="energyType" />
+        <result column="device_name" property="deviceName" />
+        <result column="device_code" property="deviceCode" />
+        <result column="site_id" property="siteId" />
+        <result column="variable" property="variable" />
+        <result column="metering_level" property="meteringLevel" />
+        <result column="access_rd" property="accessRd" />
+        <result column="sub_item" property="subItem" />
+        <result column="department" property="department" />
+        <result column="partition" property="partition" />
+        <result column="enable" property="enable" />
+        <result column="creator" property="creator" />
+        <result column="creator_time" property="creatorTime" />
+    </resultMap>
+
+</mapper>

+ 18 - 0
fiveep-persistence/src/main/resources/mapper/mysql/HtAnalogDataMapper.xml

@@ -270,6 +270,7 @@
         b.id,
         b.id,
         a.minid,
         a.minid,
         b.Epp,
         b.Epp,
+        b.Demand,
         freezingTime AS freezingTimes
         freezingTime AS freezingTimes
         FROM
         FROM
         (
         (
@@ -300,6 +301,7 @@
             b.id,
             b.id,
             a.minid,
             a.minid,
             b.Epp,
             b.Epp,
+            b.Demand,
             FROM_UNIXTIME(
             FROM_UNIXTIME(
             UNIX_TIMESTAMP(b.dataTime),
             UNIX_TIMESTAMP(b.dataTime),
             '%Y-%m'
             '%Y-%m'
@@ -339,6 +341,7 @@
             b.id,
             b.id,
             a.minid,
             a.minid,
             b.Epp,
             b.Epp,
+            b.Demand,
             FROM_UNIXTIME(
             FROM_UNIXTIME(
             UNIX_TIMESTAMP(b.dataTime),
             UNIX_TIMESTAMP(b.dataTime),
             '%Y-%m'
             '%Y-%m'
@@ -375,6 +378,21 @@
         </if>
         </if>
     </select>
     </select>
 
 
+    <select id="demandAnalysisList" resultType="com.bizmatics.model.vo.HtAnalogDataVo">
+        SELECT
+        MAX(Demand) as Demand,
+        freezingTime AS freezingTimes
+        FROM
+        ht_analog_data
+            <where>
+                and deviceName = #{deviceCode}
+                <if test="monthDate != null and monthDate != ''">
+                    and freezingTime LIKE CONCAT(CONCAT('%', #{monthDate}), '%')
+                </if>
+            </where>
+            GROUP BY freezingTime;
+    </select>
+
 
 
     <select id="yearOnYearThree" resultType="com.bizmatics.model.vo.HtAnalogDataVo">
     <select id="yearOnYearThree" resultType="com.bizmatics.model.vo.HtAnalogDataVo">
         select
         select

+ 16 - 0
fiveep-service/src/main/java/com/bizmatics/service/ConsumeEnergyConfigService.java

@@ -0,0 +1,16 @@
+package com.bizmatics.service;
+
+import com.bizmatics.model.ConsumeEnergyConfig;
+import com.bizmatics.common.mvc.base.CrudService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author ya
+ * @since 2021-10-13
+ */
+public interface ConsumeEnergyConfigService extends CrudService<ConsumeEnergyConfig> {
+
+}

+ 2 - 0
fiveep-service/src/main/java/com/bizmatics/service/HtAnalogDataService.java

@@ -78,5 +78,7 @@ public interface HtAnalogDataService extends CrudService<HtAnalogData> {
 
 
     List<CommonIcoVO> monthlyReport(String deviceCode, int cycle, String startTime, String endTime);
     List<CommonIcoVO> monthlyReport(String deviceCode, int cycle, String startTime, String endTime);
 
 
+    List<CommonIcoVO> demandAnalysis(String deviceCode, String monthDate, int cycle);
+
 
 
 }
 }

+ 20 - 0
fiveep-service/src/main/java/com/bizmatics/service/impl/ConsumeEnergyConfigServiceImpl.java

@@ -0,0 +1,20 @@
+package com.bizmatics.service.impl;
+
+import com.bizmatics.model.ConsumeEnergyConfig;
+import com.bizmatics.persistence.mapper.ConsumeEnergyConfigMapper;
+import com.bizmatics.service.ConsumeEnergyConfigService;
+import com.bizmatics.common.mvc.base.AbstractCrudService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author ya
+ * @since 2021-10-13
+ */
+@Service
+public class ConsumeEnergyConfigServiceImpl extends AbstractCrudService<ConsumeEnergyConfigMapper, ConsumeEnergyConfig> implements ConsumeEnergyConfigService {
+
+}

File diff suppressed because it is too large
+ 484 - 299
fiveep-service/src/main/java/com/bizmatics/service/impl/HtAnalogDataServiceImpl.java


Some files were not shown because too many files changed in this diff