Browse Source

储能统计接口

lv.wenbin 10 months ago
parent
commit
d59cab0e80

+ 1 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/ElecPgSupplyHController.java

@@ -96,6 +96,7 @@ public class ElecPgSupplyHController extends BaseController
     public AjaxResult getSummeryByThisDay() {
         return success(pgSupplyHService.selectSupplyPvByDay());
     }
+
     /**
      * 新增电网供应计量-小时
      */

+ 3 - 4
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/ElecStoreController.java

@@ -51,10 +51,9 @@ public class ElecStoreController extends BaseController {
     /**
      * 查询储能计量-小时列表
      */
-    @GetMapping("/day/analyze")
-    public AjaxResult getDayAnalyze(@RequestParam(name = "date") String date,
-        @RequestParam(name = "areaCode", required = false) String areaCode) {
-        ElecStoreAnalyze analyze = elecStoreService.getDayAnalysis(date, areaCode);
+    @GetMapping("/day/statistics")
+    public AjaxResult getDayStatistics(@RequestParam(name = "date") String date) {
+        ElecStoreAnalyze analyze = elecStoreService.getDayStatistics(date);
         return success(analyze);
     }
 

+ 28 - 1
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/vo/ElecStoreAnalyze.java

@@ -10,8 +10,10 @@
  */
 package com.ruoyi.ems.domain.vo;
 
+import java.util.List;
+
 /**
- * <一句话功能简述>
+ * 储能分析
  * <功能详细描述>
  *
  * @author lvwenbin
@@ -20,4 +22,29 @@ package com.ruoyi.ems.domain.vo;
  * @since [产品/模块版本]
  */
 public class ElecStoreAnalyze {
+    /**
+     * 当日汇总
+     */
+    private ElecStoreSta daySum;
+
+    /**
+     * 小时汇总
+     */
+    private List<ElecStoreSta> hourSum;
+
+    public ElecStoreSta getDaySum() {
+        return daySum;
+    }
+
+    public void setDaySum(ElecStoreSta daySum) {
+        this.daySum = daySum;
+    }
+
+    public List<ElecStoreSta> getHourSum() {
+        return hourSum;
+    }
+
+    public void setHourSum(List<ElecStoreSta> hourSum) {
+        this.hourSum = hourSum;
+    }
 }

+ 74 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/vo/ElecStoreSta.java

@@ -0,0 +1,74 @@
+/*
+ * 文 件 名:  ElecStoreIndex
+ * 版    权:  浩鲸云计算科技股份有限公司
+ * 描    述:  <描述>
+ * 修 改 人:  lvwenbin
+ * 修改时间:  2024/9/29
+ * 跟踪单号:  <跟踪单号>
+ * 修改单号:  <修改单号>
+ * 修改内容:  <修改内容>
+ */
+package com.ruoyi.ems.domain.vo;
+
+/**
+ * 储能指标
+ * <功能详细描述>
+ *
+ * @author lvwenbin
+ * @version [版本号, 2024/9/29]
+ * @see [相关类/方法]
+ * @since [产品/模块版本]
+ */
+public class ElecStoreSta {
+    /**
+     * 时间
+     */
+    private String time;
+
+    /**
+     * 时间序列
+     */
+    private Integer timeIndex;
+
+    /**
+     * 充电电量
+     */
+    private Double chargeElecQuantity;
+
+    /**
+     * 放电电量
+     */
+    private Double dischargeElecQuantity;
+
+    public String getTime() {
+        return time;
+    }
+
+    public void setTime(String time) {
+        this.time = time;
+    }
+
+    public Integer getTimeIndex() {
+        return timeIndex;
+    }
+
+    public void setTimeIndex(Integer timeIndex) {
+        this.timeIndex = timeIndex;
+    }
+
+    public Double getChargeElecQuantity() {
+        return chargeElecQuantity;
+    }
+
+    public void setChargeElecQuantity(Double chargeElecQuantity) {
+        this.chargeElecQuantity = chargeElecQuantity;
+    }
+
+    public Double getDischargeElecQuantity() {
+        return dischargeElecQuantity;
+    }
+
+    public void setDischargeElecQuantity(Double dischargeElecQuantity) {
+        this.dischargeElecQuantity = dischargeElecQuantity;
+    }
+}

+ 10 - 12
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/ElecPgSupplyHMapper.java

@@ -14,15 +14,14 @@ import org.apache.ibatis.annotations.Param;
  * @author ruoyi
  * @date 2024-08-09
  */
-public interface ElecPgSupplyHMapper
-{
+public interface ElecPgSupplyHMapper {
     /**
      * 查询电网供应计量-小时
      *
      * @param id 电网供应计量-小时主键
      * @return 电网供应计量-小时
      */
-     ElecPgSupplyH selectPgSupplyHById(Long id);
+    ElecPgSupplyH selectPgSupplyHById(Long id);
 
     /**
      * 查询电网供应计量-小时列表
@@ -30,15 +29,14 @@ public interface ElecPgSupplyHMapper
      * @param elecPgSupplyH 电网供应计量-小时
      * @return 电网供应计量-小时集合
      */
-     List<ElecPgSupplyH> selectPgSupplyHList(ElecPgSupplyH elecPgSupplyH);
+    List<ElecPgSupplyH> selectPgSupplyHList(ElecPgSupplyH elecPgSupplyH);
 
-
-     List<ElecPgSupplyH> selectPgSupplyHAllArea(ElecPgSupplyH elecPgSupplyH);
+    List<ElecPgSupplyH> selectPgSupplyHAllArea(ElecPgSupplyH elecPgSupplyH);
 
     Map<String, Object> calThisDaySupply(@Param("thisDay") String thisDay);
 
     @MapKey("timeIndex")
-    Map<String, Map<String,Object>> calThisDaySupplyByH(@Param("thisDay") String thisDay);
+    Map<String, Map<String, Object>> calThisDaySupplyByH(@Param("thisDay") String thisDay);
 
     /**
      * 查询电网供应计量-小时列表
@@ -46,7 +44,7 @@ public interface ElecPgSupplyHMapper
      * @param queryIndex 查询对象
      * @return 电网供应计量-小时集合
      */
-     List<ElecPgSupplyH> selectPgSupplyH(QueryIndex queryIndex);
+    List<ElecPgSupplyH> selectPgSupplyH(QueryIndex queryIndex);
 
     /**
      * 新增电网供应计量-小时
@@ -54,7 +52,7 @@ public interface ElecPgSupplyHMapper
      * @param elecPgSupplyH 电网供应计量-小时
      * @return 结果
      */
-     int insertPgSupplyH(ElecPgSupplyH elecPgSupplyH);
+    int insertPgSupplyH(ElecPgSupplyH elecPgSupplyH);
 
     /**
      * 修改电网供应计量-小时
@@ -62,7 +60,7 @@ public interface ElecPgSupplyHMapper
      * @param elecPgSupplyH 电网供应计量-小时
      * @return 结果
      */
-     int updatePgSupplyH(ElecPgSupplyH elecPgSupplyH);
+    int updatePgSupplyH(ElecPgSupplyH elecPgSupplyH);
 
     /**
      * 删除电网供应计量-小时
@@ -70,7 +68,7 @@ public interface ElecPgSupplyHMapper
      * @param id 电网供应计量-小时主键
      * @return 结果
      */
-     int deletePgSupplyHById(Long id);
+    int deletePgSupplyHById(Long id);
 
     /**
      * 批量删除电网供应计量-小时
@@ -78,5 +76,5 @@ public interface ElecPgSupplyHMapper
      * @param ids 需要删除的数据主键集合
      * @return 结果
      */
-     int deletePgSupplyHByIds(Long[] ids);
+    int deletePgSupplyHByIds(Long[] ids);
 }

+ 31 - 15
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/EmsElecStoreHMapper.java

@@ -1,61 +1,77 @@
 package com.ruoyi.ems.mapper;
 
 import java.util.List;
+
 import com.ruoyi.ems.domain.ElecStoreH;
+import com.ruoyi.ems.domain.vo.ElecStoreSta;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 储能计量-小时Mapper接口
- * 
+ *
  * @author ruoyi
  * @date 2024-08-09
  */
-public interface EmsElecStoreHMapper
-{
+public interface EmsElecStoreHMapper {
     /**
      * 查询储能计量-小时
-     * 
+     *
      * @param id 储能计量-小时主键
      * @return 储能计量-小时
      */
-     ElecStoreH selectStoreHById(Long id);
+    ElecStoreH selectStoreHById(Long id);
+
+    /**
+     * 查询储能统计-按日期汇总
+     * @param date 日期
+     * @return 统计结果
+     */
+    ElecStoreSta selectStoreHSumDate(@Param("date") String date);
+
+    /**
+     * 查询储能统计-按小时汇总
+     * @param date 日期
+     * @return 统计结果
+     */
+    List<ElecStoreSta> selectStoreHSumHour(@Param("date") String date);
 
     /**
      * 查询储能计量-小时列表
-     * 
+     *
      * @param admEmsElecStoreH 储能计量-小时
      * @return 储能计量-小时集合
      */
-     List<ElecStoreH> selectStoreHList(ElecStoreH admEmsElecStoreH);
+    List<ElecStoreH> selectStoreHList(ElecStoreH admEmsElecStoreH);
 
     /**
      * 新增储能计量-小时
-     * 
+     *
      * @param admEmsElecStoreH 储能计量-小时
      * @return 结果
      */
-     int insertStoreH(ElecStoreH admEmsElecStoreH);
+    int insertStoreH(ElecStoreH admEmsElecStoreH);
 
     /**
      * 修改储能计量-小时
-     * 
+     *
      * @param admEmsElecStoreH 储能计量-小时
      * @return 结果
      */
-     int updateStoreH(ElecStoreH admEmsElecStoreH);
+    int updateStoreH(ElecStoreH admEmsElecStoreH);
 
     /**
      * 删除储能计量-小时
-     * 
+     *
      * @param id 储能计量-小时主键
      * @return 结果
      */
-     int deleteStoreHById(Long id);
+    int deleteStoreHById(Long id);
 
     /**
      * 批量删除储能计量-小时
-     * 
+     *
      * @param ids 需要删除的数据主键集合
      * @return 结果
      */
-     int deleteStoreHByIds(Long[] ids);
+    int deleteStoreHByIds(Long[] ids);
 }

+ 7 - 9
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IElecPgSupplyHService.java

@@ -12,15 +12,14 @@ import com.ruoyi.ems.domain.vo.QueryIndex;
  * @author ruoyi
  * @date 2024-08-09
  */
-public interface IElecPgSupplyHService
-{
+public interface IElecPgSupplyHService {
     /**
      * 查询电网供应计量-小时
      *
      * @param id 电网供应计量-小时主键
      * @return 电网供应计量-小时
      */
-     ElecPgSupplyH selectPgSupplyHById(Long id);
+    ElecPgSupplyH selectPgSupplyHById(Long id);
 
     /**
      * 查询电网供应计量-小时列表
@@ -28,7 +27,7 @@ public interface IElecPgSupplyHService
      * @param pgSupplyH 电网供应计量-小时
      * @return 电网供应计量-小时集合
      */
-     List<ElecPgSupplyH> selectPgSupplyHList(ElecPgSupplyH pgSupplyH);
+    List<ElecPgSupplyH> selectPgSupplyHList(ElecPgSupplyH pgSupplyH);
 
     /**
      * 查询电网供应计量-小时列表
@@ -38,7 +37,6 @@ public interface IElecPgSupplyHService
      */
     List<ElecPgSupplyH> selectPgSupplyH(QueryIndex queryIndex);
 
-
     Map<String, Object> selectSupplyPvByH();
 
     Map<String, Object> selectSupplyPvByDay();
@@ -49,7 +47,7 @@ public interface IElecPgSupplyHService
      * @param pgSupplyH 电网供应计量-小时
      * @return 结果
      */
-     int insertPgSupplyH(ElecPgSupplyH pgSupplyH);
+    int insertPgSupplyH(ElecPgSupplyH pgSupplyH);
 
     /**
      * 修改电网供应计量-小时
@@ -57,7 +55,7 @@ public interface IElecPgSupplyHService
      * @param pgSupplyH 电网供应计量-小时
      * @return 结果
      */
-     int updatePgSupplyH(ElecPgSupplyH pgSupplyH);
+    int updatePgSupplyH(ElecPgSupplyH pgSupplyH);
 
     /**
      * 批量删除电网供应计量-小时
@@ -65,7 +63,7 @@ public interface IElecPgSupplyHService
      * @param ids 需要删除的电网供应计量-小时主键集合
      * @return 结果
      */
-     int deletePgSupplyHByIds(Long[] ids);
+    int deletePgSupplyHByIds(Long[] ids);
 
     /**
      * 删除电网供应计量-小时信息
@@ -73,5 +71,5 @@ public interface IElecPgSupplyHService
      * @param id 电网供应计量-小时主键
      * @return 结果
      */
-     int deletePgSupplyHById(Long id);
+    int deletePgSupplyHById(Long id);
 }

+ 1 - 2
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IElecStoreService.java

@@ -23,10 +23,9 @@ public interface IElecStoreService {
     /**
      * 获取日分析
      * @param date 日期
-     * @param areaCode 区域编码
      * @return 日分析
      */
-    ElecStoreAnalyze getDayAnalysis(String date, String areaCode);
+    ElecStoreAnalyze getDayStatistics(String date);
 
     /**
      * 查询储能计量-小时列表

+ 24 - 16
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/ElecStoreServiceImpl.java

@@ -1,13 +1,14 @@
 package com.ruoyi.ems.service.impl;
 
-import java.util.List;
-
+import com.ruoyi.ems.domain.ElecStoreH;
 import com.ruoyi.ems.domain.vo.ElecStoreAnalyze;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
+import com.ruoyi.ems.domain.vo.ElecStoreSta;
 import com.ruoyi.ems.mapper.EmsElecStoreHMapper;
-import com.ruoyi.ems.domain.ElecStoreH;
 import com.ruoyi.ems.service.IElecStoreService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
 
 /**
  * 储能计量-小时Service业务层处理
@@ -34,44 +35,51 @@ public class ElecStoreServiceImpl implements IElecStoreService
     }
 
     @Override
-    public ElecStoreAnalyze getDayAnalysis(String date, String areaCode) {
-        return null;
+    public ElecStoreAnalyze getDayStatistics(String date) {
+        ElecStoreSta daySum = elecStoreHMapper.selectStoreHSumDate(date);
+        List<ElecStoreSta> hourSum = elecStoreHMapper.selectStoreHSumHour(date);
+
+        ElecStoreAnalyze analyze = new ElecStoreAnalyze();
+        analyze.setDaySum(daySum);
+        analyze.setHourSum(hourSum);
+
+        return analyze;
     }
 
     /**
      * 查询储能计量-小时列表
      * 
-     * @param admEmsElecStoreH 储能计量-小时
+     * @param elecStoreH 储能计量-小时
      * @return 储能计量-小时
      */
     @Override
-    public List<ElecStoreH> selectHourList(ElecStoreH admEmsElecStoreH)
+    public List<ElecStoreH> selectHourList(ElecStoreH elecStoreH)
     {
-        return elecStoreHMapper.selectStoreHList(admEmsElecStoreH);
+        return elecStoreHMapper.selectStoreHList(elecStoreH);
     }
 
     /**
      * 新增储能计量-小时
      * 
-     * @param admEmsElecStoreH 储能计量-小时
+     * @param elecStoreH 储能计量-小时
      * @return 结果
      */
     @Override
-    public int insertHour(ElecStoreH admEmsElecStoreH)
+    public int insertHour(ElecStoreH elecStoreH)
     {
-        return elecStoreHMapper.insertStoreH(admEmsElecStoreH);
+        return elecStoreHMapper.insertStoreH(elecStoreH);
     }
 
     /**
      * 修改储能计量-小时
      * 
-     * @param admEmsElecStoreH 储能计量-小时
+     * @param elecStoreH 储能计量-小时
      * @return 结果
      */
     @Override
-    public int updateHour(ElecStoreH admEmsElecStoreH)
+    public int updateHour(ElecStoreH elecStoreH)
     {
-        return elecStoreHMapper.updateStoreH(admEmsElecStoreH);
+        return elecStoreHMapper.updateStoreH(elecStoreH);
     }
 
     /**

+ 17 - 23
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/EmsPgSupplyHServiceImpl.java

@@ -22,13 +22,13 @@ import com.ruoyi.ems.service.IElecPgSupplyHService;
  * @date 2024-08-09
  */
 @Service
-public class EmsPgSupplyHServiceImpl implements IElecPgSupplyHService
-{
+public class EmsPgSupplyHServiceImpl implements IElecPgSupplyHService {
     @Autowired
     private ElecPgSupplyHMapper emsPgSupplyHMapper;
 
     @Autowired
     private PvSupplyHMapper pvSupplyHMapper;
+
     /**
      * 查询电网供应计量-小时
      *
@@ -36,32 +36,29 @@ public class EmsPgSupplyHServiceImpl implements IElecPgSupplyHService
      * @return 电网供应计量-小时
      */
     @Override
-    public ElecPgSupplyH selectPgSupplyHById(Long id)
-    {
+    public ElecPgSupplyH selectPgSupplyHById(Long id) {
         return emsPgSupplyHMapper.selectPgSupplyHById(id);
     }
 
     /**
      * 查询电网供应计量-小时列表
      *
-     * @param admEmsPgSupplyH 电网供应计量-小时
+     * @param elecPgSupplyH 电网供应计量-小时
      * @return 电网供应计量-小时
      */
     @Override
-    public List<ElecPgSupplyH> selectPgSupplyHList(ElecPgSupplyH admEmsPgSupplyH) {
-        if (StringUtils.isNotEmpty(admEmsPgSupplyH.getAreaCode())) {
-            return emsPgSupplyHMapper.selectPgSupplyHList(admEmsPgSupplyH);
+    public List<ElecPgSupplyH> selectPgSupplyHList(ElecPgSupplyH elecPgSupplyH) {
+        if (StringUtils.isNotEmpty(elecPgSupplyH.getAreaCode())) {
+            return emsPgSupplyHMapper.selectPgSupplyHList(elecPgSupplyH);
         }
-        return emsPgSupplyHMapper.selectPgSupplyHAllArea(admEmsPgSupplyH);
+        return emsPgSupplyHMapper.selectPgSupplyHAllArea(elecPgSupplyH);
     }
 
-
     @Override
     public List<ElecPgSupplyH> selectPgSupplyH(QueryIndex queryIndex) {
         return emsPgSupplyHMapper.selectPgSupplyH(queryIndex);
     }
 
-
     @Override
     public Map<String, Object> selectSupplyPvByH() {
         String thisDay = DateTimeUtil.currentDateTime(DateTimeUtil.DateFormatter.yyyy_MM_dd);
@@ -83,28 +80,27 @@ public class EmsPgSupplyHServiceImpl implements IElecPgSupplyHService
             put("pv", thisDayPv);
         }};
     }
+
     /**
      * 新增电网供应计量-小时
      *
-     * @param admEmsPgSupplyH 电网供应计量-小时
+     * @param elecPgSupplyH 电网供应计量-小时
      * @return 结果
      */
     @Override
-    public int insertPgSupplyH(ElecPgSupplyH admEmsPgSupplyH)
-    {
-        return emsPgSupplyHMapper.insertPgSupplyH(admEmsPgSupplyH);
+    public int insertPgSupplyH(ElecPgSupplyH elecPgSupplyH) {
+        return emsPgSupplyHMapper.insertPgSupplyH(elecPgSupplyH);
     }
 
     /**
      * 修改电网供应计量-小时
      *
-     * @param admEmsPgSupplyH 电网供应计量-小时
+     * @param elecPgSupplyH 电网供应计量-小时
      * @return 结果
      */
     @Override
-    public int updatePgSupplyH(ElecPgSupplyH admEmsPgSupplyH)
-    {
-        return emsPgSupplyHMapper.updatePgSupplyH(admEmsPgSupplyH);
+    public int updatePgSupplyH(ElecPgSupplyH elecPgSupplyH) {
+        return emsPgSupplyHMapper.updatePgSupplyH(elecPgSupplyH);
     }
 
     /**
@@ -114,8 +110,7 @@ public class EmsPgSupplyHServiceImpl implements IElecPgSupplyHService
      * @return 结果
      */
     @Override
-    public int deletePgSupplyHByIds(Long[] ids)
-    {
+    public int deletePgSupplyHByIds(Long[] ids) {
         return emsPgSupplyHMapper.deletePgSupplyHByIds(ids);
     }
 
@@ -126,8 +121,7 @@ public class EmsPgSupplyHServiceImpl implements IElecPgSupplyHService
      * @return 结果
      */
     @Override
-    public int deletePgSupplyHById(Long id)
-    {
+    public int deletePgSupplyHById(Long id) {
         return emsPgSupplyHMapper.deletePgSupplyHById(id);
     }
 }

+ 1 - 0
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/ElecPgSupplyHMapper.xml

@@ -49,6 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         pg.`time` DESC,
         pg.`time_index`
     </select>
+
     <select id="selectPgSupplyHAllArea" parameterType="com.ruoyi.ems.domain.ElecPgSupplyH" resultMap="PgSupplyHResult">
         SELECT facCategory.`code` facs_code,
         facCategory.`name` facs_name,

+ 36 - 0
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsElecStoreHMapper.xml

@@ -19,6 +19,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="dischargeElecQuantity"    column="discharge_elec_quantity"    />
     </resultMap>
 
+    <resultMap type="com.ruoyi.ems.domain.vo.ElecStoreSta" id="StoreHSumResult">
+        <result property="time"    column="time"    />
+        <result property="timeIndex"    column="time_index"    />
+        <result property="chargeElecQuantity"    column="charge_elec_quantity"    />
+        <result property="dischargeElecQuantity"    column="discharge_elec_quantity"    />
+    </resultMap>
+
     <sql id="selectStoreHVo">
         SELECT
             st.id,
@@ -47,7 +54,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="date != null "> and st.`date` = #{date}</if>
             <if test="chargeElecQuantity != null "> and st.charge_elec_quantity = #{chargeElecQuantity}</if>
             <if test="dischargeElecQuantity != null "> and st.discharge_elec_quantity = #{dischargeElecQuantity}</if>
+            <if test="startRecTime != null  and startRecTime != '' and endRecTime != null and endRecTime !=''">
+                and st.`record_time` &gt;= #{startRecTime} and st.`record_time` &lt;= #{endRecTime}
+            </if>
         </where>
+        ORDER BY st.`date` DESC,
+        st.`time` DESC,
+        st.`time_index`
     </select>
 
     <select id="selectStoreHById" parameterType="Long" resultMap="StoreHResult">
@@ -55,6 +68,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where st.id = #{id}
     </select>
 
+    <select id="selectStoreHSumDate" parameterType="java.lang.String" resultMap="StoreHSumResult">
+        SELECT
+            st.`date` as `time`,
+            sum(st.charge_elec_quantity) as charge_elec_quantity,
+            sum(st.discharge_elec_quantity) as discharge_elec_quantity
+        FROM
+            adm_ems_elec_store_h st
+        where st.`date` = #{date}
+        group by st.`date`
+    </select>
+
+    <select id="selectStoreHSumHour" parameterType="java.lang.String" resultMap="StoreHSumResult">
+        SELECT
+            st.`time`,
+            st.`time_index`,
+            sum(st.charge_elec_quantity) as charge_elec_quantity,
+            sum(st.discharge_elec_quantity) as discharge_elec_quantity
+        FROM
+            adm_ems_elec_store_h st
+        where st.`date` = #{date}
+        group by st.`time`
+    </select>
+
     <insert id="insertStoreH" parameterType="com.ruoyi.ems.domain.ElecStoreH" useGeneratedKeys="true" keyProperty="id">
         insert into adm_ems_elec_store_h
         <trim prefix="(" suffix=")" suffixOverrides=",">