Forráskód Böngészése

监测参数查询(未完)

LLL 1 éve%!(EXTRA string=óta)
szülő
commit
54c2897e39
29 módosított fájl, 448 hozzáadás és 88 törlés
  1. 10 4
      module_ems/src/main/java/org/jeecg/modules/dataCurrent/mapper/DataCurrentMapper.java
  2. 20 0
      module_ems/src/main/java/org/jeecg/modules/dataCurrent/mapper/xml/DataCurrentMapper.xml
  3. 10 0
      module_ems/src/main/java/org/jeecg/modules/dataCurrent/service/IDataCurrentService.java
  4. 15 0
      module_ems/src/main/java/org/jeecg/modules/dataCurrent/service/impl/DataCurrentServiceImpl.java
  5. 31 0
      module_ems/src/main/java/org/jeecg/modules/dataCurrent/vo/DataCurrentVO.java
  6. 10 4
      module_ems/src/main/java/org/jeecg/modules/dataDemand/mapper/DataDemandMapper.java
  7. 17 0
      module_ems/src/main/java/org/jeecg/modules/dataDemand/mapper/xml/DataDemandMapper.xml
  8. 10 0
      module_ems/src/main/java/org/jeecg/modules/dataDemand/service/IDataDemandService.java
  9. 15 0
      module_ems/src/main/java/org/jeecg/modules/dataDemand/service/impl/DataDemandServiceImpl.java
  10. 23 0
      module_ems/src/main/java/org/jeecg/modules/dataDemand/vo/DataDemandVO.java
  11. 11 4
      module_ems/src/main/java/org/jeecg/modules/dataElectricity/mapper/DataElectricityMapper.java
  12. 16 0
      module_ems/src/main/java/org/jeecg/modules/dataElectricity/mapper/xml/DataElectricityMapper.xml
  13. 7 0
      module_ems/src/main/java/org/jeecg/modules/dataElectricity/service/IDataElectricityService.java
  14. 10 0
      module_ems/src/main/java/org/jeecg/modules/dataElectricity/service/impl/DataElectricityServiceImpl.java
  15. 23 0
      module_ems/src/main/java/org/jeecg/modules/dataElectricity/vo/DataElectricityVO.java
  16. 9 4
      module_ems/src/main/java/org/jeecg/modules/dataPower/mapper/DataPowerMapper.java
  17. 16 0
      module_ems/src/main/java/org/jeecg/modules/dataPower/mapper/xml/DataPowerMapper.xml
  18. 9 0
      module_ems/src/main/java/org/jeecg/modules/dataPower/service/IDataPowerService.java
  19. 15 0
      module_ems/src/main/java/org/jeecg/modules/dataPower/service/impl/DataPowerServiceImpl.java
  20. 23 0
      module_ems/src/main/java/org/jeecg/modules/dataPower/vo/DataPowerVO.java
  21. 12 40
      module_ems/src/main/java/org/jeecg/modules/dataVoltage/controller/DataVoltageController.java
  22. 6 7
      module_ems/src/main/java/org/jeecg/modules/dataVoltage/mapper/DataVoltageMapper.java
  23. 14 4
      module_ems/src/main/java/org/jeecg/modules/dataVoltage/mapper/xml/DataVoltageMapper.xml
  24. 4 4
      module_ems/src/main/java/org/jeecg/modules/dataVoltage/service/IDataVoltageService.java
  25. 5 6
      module_ems/src/main/java/org/jeecg/modules/dataVoltage/service/impl/DataVoltageServiceImpl.java
  26. 9 9
      module_ems/src/main/java/org/jeecg/modules/dataVoltage/vo/DataVoltageVO.java
  27. 71 0
      module_ems/src/main/java/org/jeecg/modules/paramquery/controller/ParamQueryDataConotroller.java
  28. 6 2
      module_ems/src/main/java/org/jeecg/modules/dataVoltage/dto/DataVoltageQueryDTO.java
  29. 21 0
      module_ems/src/main/java/org/jeecg/modules/paramquery/vo/ParamQueryDataVO.java

+ 10 - 4
module_ems/src/main/java/org/jeecg/modules/dataCurrent/mapper/DataCurrentMapper.java

@@ -1,11 +1,12 @@
 package org.jeecg.modules.dataCurrent.mapper;
 
-import java.util.List;
-
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.dataCurrent.entity.DataCurrent;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.dataCurrent.vo.DataCurrentVO;
+import org.jeecg.modules.paramquery.dto.ParamQueryDataDTO;
+
+import java.util.List;
 
 /**
  * @Description: ems_data_current
@@ -16,6 +17,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 @Mapper
 public interface DataCurrentMapper extends BaseMapper<DataCurrent> {
 
+    /**
+     * 监测参数查询——电流
+     */
+    List<DataCurrentVO> dataList(ParamQueryDataDTO dto);
+
 
     /**
      * 按日期、点位名查询设备实时电流列表

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

@@ -31,4 +31,24 @@
         order by id asc
     </select>
 
+    <!--监测参数查询——电流-->
+    <select id="dataList" parameterType="org.jeecg.modules.paramquery.dto.ParamQueryDataDTO" resultType="org.jeecg.modules.dataCurrent.vo.DataCurrentVO">
+        SELECT logtime,
+        MAX(CASE WHEN tagname like '%A相电流%' THEN tagvalue END) AS atagvalue,
+        MAX(CASE WHEN tagname like '%B相电流%' THEN tagvalue END) AS btagvalue,
+        MAX(CASE WHEN tagname like '%C相电流%' THEN tagvalue END) AS ctagvalue
+        FROM ems_data_current
+        <where>
+            <if test="equipmentid != null and equipmentid != ''"> and equipmentid = #{equipmentid}</if>
+            <if test="logtimebegin != null "><!-- 开始时间检索 -->
+                and logtime &gt;= #{logtimebegin}
+            </if>
+            <if test="logtimeend != null "><!-- 结束时间检索 -->
+                and logtime &lt;= #{logtimeend}
+            </if>
+        </where>
+        GROUP BY logtime
+        order by id asc
+    </select>
+
 </mapper>

+ 10 - 0
module_ems/src/main/java/org/jeecg/modules/dataCurrent/service/IDataCurrentService.java

@@ -2,6 +2,10 @@ package org.jeecg.modules.dataCurrent.service;
 
 import org.jeecg.modules.dataCurrent.entity.DataCurrent;
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.dataCurrent.vo.DataCurrentVO;
+import org.jeecg.modules.paramquery.dto.ParamQueryDataDTO;
+
+import java.util.List;
 
 /**
  * @Description: ems_data_current
@@ -11,4 +15,10 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface IDataCurrentService extends IService<DataCurrent> {
 
+    /**
+     * 监测参数查询——电流
+     */
+    List<DataCurrentVO> dataList(ParamQueryDataDTO dto);
+
+
 }

+ 15 - 0
module_ems/src/main/java/org/jeecg/modules/dataCurrent/service/impl/DataCurrentServiceImpl.java

@@ -3,10 +3,15 @@ package org.jeecg.modules.dataCurrent.service.impl;
 import org.jeecg.modules.dataCurrent.entity.DataCurrent;
 import org.jeecg.modules.dataCurrent.mapper.DataCurrentMapper;
 import org.jeecg.modules.dataCurrent.service.IDataCurrentService;
+import org.jeecg.modules.dataCurrent.vo.DataCurrentVO;
+import org.jeecg.modules.paramquery.dto.ParamQueryDataDTO;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 
+import java.util.List;
+
 /**
  * @Description: ems_data_current
  * @Author: jeecg-boot
@@ -16,4 +21,14 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 @Service
 public class DataCurrentServiceImpl extends ServiceImpl<DataCurrentMapper, DataCurrent> implements IDataCurrentService {
 
+    @Autowired
+    private DataCurrentMapper dataCurrentMapper;
+
+    /**
+     * 监测参数查询——电流
+     */
+    public List<DataCurrentVO> dataList(ParamQueryDataDTO dto){
+        return dataCurrentMapper.dataList(dto);
+    }
+
 }

+ 31 - 0
module_ems/src/main/java/org/jeecg/modules/dataCurrent/vo/DataCurrentVO.java

@@ -0,0 +1,31 @@
+package org.jeecg.modules.dataCurrent.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+@Data
+public class DataCurrentVO {
+
+    /**A相电流点位值*/
+    @Excel(name = "A相电流点位值", width = 15)
+    @ApiModelProperty(value = "A相电流点位值")
+    private java.lang.Double atagvalue;
+    /**B相电流点位值*/
+    @Excel(name = "B相电流点位值", width = 15)
+    @ApiModelProperty(value = "B相电流点位值")
+    private java.lang.Double btagvalue;
+    /**C相电流点位值*/
+    @Excel(name = "C相电流点位值", width = 15)
+    @ApiModelProperty(value = "C相电流点位值")
+    private java.lang.Double ctagvalue;
+    /**时间*/
+    @Excel(name = "时间", width = 15, format = "MM-dd HH:mm")
+    @JsonFormat(timezone = "GMT+8",pattern = "MM-dd HH:mm")
+    @DateTimeFormat(pattern="MM-dd HH:mm")
+    @ApiModelProperty(value = "时间")
+    private java.util.Date logtime;
+
+}

+ 10 - 4
module_ems/src/main/java/org/jeecg/modules/dataDemand/mapper/DataDemandMapper.java

@@ -1,10 +1,11 @@
 package org.jeecg.modules.dataDemand.mapper;
 
-import java.util.List;
-
-import org.apache.ibatis.annotations.Param;
-import org.jeecg.modules.dataDemand.entity.DataDemand;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.dataDemand.entity.DataDemand;
+import org.jeecg.modules.dataDemand.vo.DataDemandVO;
+import org.jeecg.modules.paramquery.dto.ParamQueryDataDTO;
+
+import java.util.List;
 
 /**
  * @Description: ems_data_demand
@@ -14,4 +15,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface DataDemandMapper extends BaseMapper<DataDemand> {
 
+    /**
+     * 监测参数查询——需量
+     */
+    List<DataDemandVO> dataList(ParamQueryDataDTO dto);
+
 }

+ 17 - 0
module_ems/src/main/java/org/jeecg/modules/dataDemand/mapper/xml/DataDemandMapper.xml

@@ -2,4 +2,21 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="org.jeecg.modules.dataDemand.mapper.DataDemandMapper">
 
+
+    <!--监测参数查询——正向有功需量-->
+    <select id="dataList" parameterType="org.jeecg.modules.paramquery.dto.ParamQueryDataDTO" resultType="org.jeecg.modules.dataDemand.vo.DataDemandVO">
+        SELECT logtime, tagvalue
+        FROM ems_data_demand
+        <where>
+            <if test="equipmentid != null and equipmentid != ''"> and equipmentid = #{equipmentid}</if>
+            <if test="logtimebegin != null "><!-- 开始时间检索 -->
+                and logtime &gt;= #{logtimebegin}
+            </if>
+            <if test="logtimeend != null "><!-- 结束时间检索 -->
+                and logtime &lt;= #{logtimeend}
+            </if>
+        </where>
+        order by id asc
+    </select>
+
 </mapper>

+ 10 - 0
module_ems/src/main/java/org/jeecg/modules/dataDemand/service/IDataDemandService.java

@@ -2,6 +2,10 @@ package org.jeecg.modules.dataDemand.service;
 
 import org.jeecg.modules.dataDemand.entity.DataDemand;
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.dataDemand.vo.DataDemandVO;
+import org.jeecg.modules.paramquery.dto.ParamQueryDataDTO;
+
+import java.util.List;
 
 /**
  * @Description: ems_data_demand
@@ -11,4 +15,10 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface IDataDemandService extends IService<DataDemand> {
 
+    /**
+     * 监测参数查询——需量
+     */
+    List<DataDemandVO> dataList(ParamQueryDataDTO dto);
+
+
 }

+ 15 - 0
module_ems/src/main/java/org/jeecg/modules/dataDemand/service/impl/DataDemandServiceImpl.java

@@ -3,10 +3,15 @@ package org.jeecg.modules.dataDemand.service.impl;
 import org.jeecg.modules.dataDemand.entity.DataDemand;
 import org.jeecg.modules.dataDemand.mapper.DataDemandMapper;
 import org.jeecg.modules.dataDemand.service.IDataDemandService;
+import org.jeecg.modules.dataDemand.vo.DataDemandVO;
+import org.jeecg.modules.paramquery.dto.ParamQueryDataDTO;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 
+import java.util.List;
+
 /**
  * @Description: ems_data_demand
  * @Author: jeecg-boot
@@ -16,4 +21,14 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 @Service
 public class DataDemandServiceImpl extends ServiceImpl<DataDemandMapper, DataDemand> implements IDataDemandService {
 
+    @Autowired
+    private DataDemandMapper dataDemandMapper;
+
+    /**
+     * 监测参数查询——需量
+     */
+    public List<DataDemandVO> dataList(ParamQueryDataDTO dto){
+        return dataDemandMapper.dataList(dto);
+    }
+
 }

+ 23 - 0
module_ems/src/main/java/org/jeecg/modules/dataDemand/vo/DataDemandVO.java

@@ -0,0 +1,23 @@
+package org.jeecg.modules.dataDemand.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+@Data
+public class DataDemandVO {
+
+    /**正向有功需量*/
+    @Excel(name = "正向有功需量", width = 15)
+    @ApiModelProperty(value = "正向有功需量")
+    private java.lang.Double tagvalue;
+    /**时间*/
+    @Excel(name = "时间", width = 15, format = "MM-dd HH:mm")
+    @JsonFormat(timezone = "GMT+8",pattern = "MM-dd HH:mm")
+    @DateTimeFormat(pattern="MM-dd HH:mm")
+    @ApiModelProperty(value = "时间")
+    private java.util.Date logtime;
+
+}

+ 11 - 4
module_ems/src/main/java/org/jeecg/modules/dataElectricity/mapper/DataElectricityMapper.java

@@ -1,11 +1,12 @@
 package org.jeecg.modules.dataElectricity.mapper;
 
-import java.util.List;
-
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.dataElectricity.entity.DataElectricity;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.dataElectricity.vo.DataElectricityVO;
+import org.jeecg.modules.paramquery.dto.ParamQueryDataDTO;
+
+import java.util.List;
 
 /**
  * @Description: ems_data_electricity
@@ -17,6 +18,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 public interface DataElectricityMapper extends BaseMapper<DataElectricity> {
 
     /**
+     * 监测参数查询——分时电量(有功总电能)
+     */
+    List<DataElectricityVO> dataList(ParamQueryDataDTO dto);
+
+
+    /**
      * 按日期查询电量
      *
      * @param electricity 分时电量

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

@@ -62,4 +62,20 @@
                            on a.equipmentid=c.equipmentid
     </select>
 
+    <!--监测参数查询——分时电量(有功总电能)-->
+    <select id="dataList" parameterType="org.jeecg.modules.paramquery.dto.ParamQueryDataDTO" resultType="org.jeecg.modules.dataElectricity.vo.DataElectricityVO">
+        SELECT logtime, tagvalue
+        FROM ems_data_electricity
+        <where>
+            <if test="equipmentid != null and equipmentid != ''"> and equipmentid = #{equipmentid}</if>
+            <if test="logtimebegin != null "><!-- 开始时间检索 -->
+                and logtime &gt;= #{logtimebegin}
+            </if>
+            <if test="logtimeend != null "><!-- 结束时间检索 -->
+                and logtime &lt;= #{logtimeend}
+            </if>
+        </where>
+        order by id asc
+    </select>
+
 </mapper>

+ 7 - 0
module_ems/src/main/java/org/jeecg/modules/dataElectricity/service/IDataElectricityService.java

@@ -3,6 +3,8 @@ package org.jeecg.modules.dataElectricity.service;
 import org.jeecg.modules.dataElectricity.entity.DataElectricity;
 import com.baomidou.mybatisplus.extension.service.IService;
 import org.jeecg.modules.dataElectricity.entity.DataElectricitySta;
+import org.jeecg.modules.dataElectricity.vo.DataElectricityVO;
+import org.jeecg.modules.paramquery.dto.ParamQueryDataDTO;
 import org.springframework.web.servlet.ModelAndView;
 
 import javax.servlet.http.HttpServletRequest;
@@ -17,6 +19,11 @@ import java.util.List;
 public interface IDataElectricityService extends IService<DataElectricity> {
 
     /**
+     * 监测参数查询——分时电量(有功总电能)
+     */
+    public List<DataElectricityVO> dataList(ParamQueryDataDTO dto);
+
+    /**
      * 用电集抄
      *
      * @param emsElectricity 分时电量

+ 10 - 0
module_ems/src/main/java/org/jeecg/modules/dataElectricity/service/impl/DataElectricityServiceImpl.java

@@ -6,6 +6,8 @@ import org.jeecg.modules.dataElectricity.entity.DataElectricity;
 import org.jeecg.modules.dataElectricity.entity.DataElectricitySta;
 import org.jeecg.modules.dataElectricity.mapper.DataElectricityMapper;
 import org.jeecg.modules.dataElectricity.service.IDataElectricityService;
+import org.jeecg.modules.dataElectricity.vo.DataElectricityVO;
+import org.jeecg.modules.paramquery.dto.ParamQueryDataDTO;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
 import org.jeecgframework.poi.excel.entity.ExportParams;
 import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
@@ -34,6 +36,14 @@ public class DataElectricityServiceImpl extends ServiceImpl<DataElectricityMappe
     private DataElectricityMapper dataElectricityMapper;
 
     /**
+     * 监测参数查询——分时电量(有功总电能)
+     */
+    public List<DataElectricityVO> dataList(ParamQueryDataDTO dto){
+        return dataElectricityMapper.dataList(dto);
+    }
+
+
+    /**
      * 用电集抄
      *
      * @param emsElectricity 分时电量

+ 23 - 0
module_ems/src/main/java/org/jeecg/modules/dataElectricity/vo/DataElectricityVO.java

@@ -0,0 +1,23 @@
+package org.jeecg.modules.dataElectricity.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+@Data
+public class DataElectricityVO {
+
+    /**分时电量(有功总电能)*/
+    @Excel(name = "分时电量(有功总电能)", width = 15)
+    @ApiModelProperty(value = "分时电量(有功总电能)")
+    private java.lang.Double tagvalue;
+    /**时间*/
+    @Excel(name = "时间", width = 15, format = "MM-dd HH:mm")
+    @JsonFormat(timezone = "GMT+8",pattern = "MM-dd HH:mm")
+    @DateTimeFormat(pattern="MM-dd HH:mm")
+    @ApiModelProperty(value = "时间")
+    private java.util.Date logtime;
+
+}

+ 9 - 4
module_ems/src/main/java/org/jeecg/modules/dataPower/mapper/DataPowerMapper.java

@@ -1,11 +1,12 @@
 package org.jeecg.modules.dataPower.mapper;
 
-import java.util.List;
-
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.dataPower.entity.DataPower;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.dataPower.vo.DataPowerVO;
+import org.jeecg.modules.paramquery.dto.ParamQueryDataDTO;
+
+import java.util.List;
 
 /**
  * @Description: ems_data_power
@@ -16,6 +17,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 @Mapper
 public interface DataPowerMapper extends BaseMapper<DataPower> {
 
+    /**
+     * 监测参数查询——功率
+     */
+    List<DataPowerVO> dataList(ParamQueryDataDTO dto);
 
     /**
      * 按日期查询功率

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

@@ -30,4 +30,20 @@
         order by id asc
     </select>
 
+    <!--监测参数查询——功率-->
+    <select id="dataList" parameterType="org.jeecg.modules.paramquery.dto.ParamQueryDataDTO" resultType="org.jeecg.modules.dataPower.vo.DataPowerVO">
+        SELECT logtime, tagvalue
+        FROM ems_data_power
+        <where>
+            <if test="equipmentid != null and equipmentid != ''"> and equipmentid = #{equipmentid}</if>
+            <if test="logtimebegin != null "><!-- 开始时间检索 -->
+                and logtime &gt;= #{logtimebegin}
+            </if>
+            <if test="logtimeend != null "><!-- 结束时间检索 -->
+                and logtime &lt;= #{logtimeend}
+            </if>
+        </where>
+        order by id asc
+    </select>
+
 </mapper>

+ 9 - 0
module_ems/src/main/java/org/jeecg/modules/dataPower/service/IDataPowerService.java

@@ -2,6 +2,10 @@ package org.jeecg.modules.dataPower.service;
 
 import org.jeecg.modules.dataPower.entity.DataPower;
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.dataPower.vo.DataPowerVO;
+import org.jeecg.modules.paramquery.dto.ParamQueryDataDTO;
+
+import java.util.List;
 
 /**
  * @Description: ems_data_power
@@ -11,4 +15,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface IDataPowerService extends IService<DataPower> {
 
+    /**
+     * 监测参数查询——功率
+     */
+    List<DataPowerVO> dataList(ParamQueryDataDTO dto);
+
 }

+ 15 - 0
module_ems/src/main/java/org/jeecg/modules/dataPower/service/impl/DataPowerServiceImpl.java

@@ -3,10 +3,15 @@ package org.jeecg.modules.dataPower.service.impl;
 import org.jeecg.modules.dataPower.entity.DataPower;
 import org.jeecg.modules.dataPower.mapper.DataPowerMapper;
 import org.jeecg.modules.dataPower.service.IDataPowerService;
+import org.jeecg.modules.dataPower.vo.DataPowerVO;
+import org.jeecg.modules.paramquery.dto.ParamQueryDataDTO;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 
+import java.util.List;
+
 /**
  * @Description: ems_data_power
  * @Author: jeecg-boot
@@ -16,4 +21,14 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 @Service
 public class DataPowerServiceImpl extends ServiceImpl<DataPowerMapper, DataPower> implements IDataPowerService {
 
+    @Autowired
+    private DataPowerMapper dataPowerMapper;
+
+    /**
+     * 监测参数查询——功率
+     */
+    public List<DataPowerVO> dataList(ParamQueryDataDTO dto){
+        return dataPowerMapper.dataList(dto);
+    }
+
 }

+ 23 - 0
module_ems/src/main/java/org/jeecg/modules/dataPower/vo/DataPowerVO.java

@@ -0,0 +1,23 @@
+package org.jeecg.modules.dataPower.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+@Data
+public class DataPowerVO {
+
+    /**功率*/
+    @Excel(name = "功率", width = 15)
+    @ApiModelProperty(value = "功率")
+    private java.lang.Double tagvalue;
+    /**时间*/
+    @Excel(name = "时间", width = 15, format = "MM-dd HH:mm")
+    @JsonFormat(timezone = "GMT+8",pattern = "MM-dd HH:mm")
+    @DateTimeFormat(pattern="MM-dd HH:mm")
+    @ApiModelProperty(value = "时间")
+    private java.util.Date logtime;
+
+}

+ 12 - 40
module_ems/src/main/java/org/jeecg/modules/dataVoltage/controller/DataVoltageController.java

@@ -1,44 +1,26 @@
 package org.jeecg.modules.dataVoltage.controller;
 
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.common.util.oConvertUtils;
-import org.jeecg.modules.dataVoltage.dto.DataVoltageQueryDTO;
-import org.jeecg.modules.dataVoltage.entity.DataVoltage;
-import org.jeecg.modules.dataVoltage.service.IDataVoltageService;
-
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
-
-import org.jeecg.modules.dataVoltage.vo.DataVoltageVO;
-import org.jeecgframework.poi.excel.ExcelImportUtil;
-import org.jeecgframework.poi.excel.def.NormalExcelConstants;
-import org.jeecgframework.poi.excel.entity.ExportParams;
-import org.jeecgframework.poi.excel.entity.ImportParams;
-import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.base.controller.JeecgController;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.modules.dataVoltage.entity.DataVoltage;
+import org.jeecg.modules.dataVoltage.service.IDataVoltageService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-import org.springframework.web.multipart.MultipartHttpServletRequest;
 import org.springframework.web.servlet.ModelAndView;
-import com.alibaba.fastjson.JSON;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.jeecg.common.aspect.annotation.AutoLog;
 
- /**
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Arrays;
+
+/**
  * @Description: 设备实时电压
  * @Author: jeecg-boot
  * @Date:   2024-01-19
@@ -52,16 +34,6 @@ public class DataVoltageController extends JeecgController<DataVoltage, IDataVol
 	@Autowired
 	private IDataVoltageService dataVoltageService;
 
-	 /**
-	  * 参数历史查询
-	  */
-	 @ApiOperation(value="参数历史查询", notes="参数历史查询")
-	 @GetMapping(value = "/dataList")
-	 public Result<List<DataVoltageVO>> dataList(DataVoltageQueryDTO dto) {
-		 List<DataVoltageVO> list = dataVoltageService.dataList(dto);
-		 return Result.OK(list);
-	 }
-
 	/**
 	 * 分页列表查询
 	 *

+ 6 - 7
module_ems/src/main/java/org/jeecg/modules/dataVoltage/mapper/DataVoltageMapper.java

@@ -1,13 +1,12 @@
 package org.jeecg.modules.dataVoltage.mapper;
 
-import java.util.List;
-
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-import org.jeecg.modules.dataVoltage.dto.DataVoltageQueryDTO;
 import org.jeecg.modules.dataVoltage.entity.DataVoltage;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.jeecg.modules.dataVoltage.vo.DataVoltageVO;
+import org.jeecg.modules.paramquery.dto.ParamQueryDataDTO;
+
+import java.util.List;
 
 /**
  * @Description: ems_data_voltage
@@ -20,9 +19,9 @@ public interface DataVoltageMapper extends BaseMapper<DataVoltage> {
 
 
     /**
-     * 参数历史查询
+     * 监测参数查询——电压
      */
-    List<DataVoltageVO> dataList(DataVoltageQueryDTO dto);
+    List<DataVoltageVO> dataList(ParamQueryDataDTO dto);
 
 
     /**

+ 14 - 4
module_ems/src/main/java/org/jeecg/modules/dataVoltage/mapper/xml/DataVoltageMapper.xml

@@ -31,13 +31,23 @@
         order by id asc
     </select>
 
-    <!--参数历史查询-->
-    <select id="dataList" parameterType="org.jeecg.modules.dataVoltage.dto.DataVoltageQueryDTO" resultType="org.jeecg.modules.dataVoltage.vo.DataVoltageVO">
-        SELECT logtime
+    <!--监测参数查询——电压-->
+    <select id="dataList" parameterType="org.jeecg.modules.paramquery.dto.ParamQueryDataDTO" resultType="org.jeecg.modules.dataVoltage.vo.DataVoltageVO">
+        SELECT logtime,
+        MAX(CASE WHEN tagname like '%A相电压%' THEN tagvalue END) AS atagvalue,
+        MAX(CASE WHEN tagname like '%B相电压%' THEN tagvalue END) AS btagvalue,
+        MAX(CASE WHEN tagname like '%C相电压%' THEN tagvalue END) AS ctagvalue
         FROM ems_data_voltage
         <where>
             <if test="equipmentid != null and equipmentid != ''"> and equipmentid = #{equipmentid}</if>
+            <if test="logtimebegin != null "><!-- 开始时间检索 -->
+                and logtime &gt;= #{logtimebegin}
+            </if>
+            <if test="logtimeend != null "><!-- 结束时间检索 -->
+                and logtime &lt;= #{logtimeend}
+            </if>
         </where>
+        GROUP BY logtime
+        order by id asc
     </select>
-
 </mapper>

+ 4 - 4
module_ems/src/main/java/org/jeecg/modules/dataVoltage/service/IDataVoltageService.java

@@ -1,9 +1,9 @@
 package org.jeecg.modules.dataVoltage.service;
 
-import org.jeecg.modules.dataVoltage.dto.DataVoltageQueryDTO;
-import org.jeecg.modules.dataVoltage.entity.DataVoltage;
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.dataVoltage.entity.DataVoltage;
 import org.jeecg.modules.dataVoltage.vo.DataVoltageVO;
+import org.jeecg.modules.paramquery.dto.ParamQueryDataDTO;
 
 import java.util.List;
 
@@ -16,8 +16,8 @@ import java.util.List;
 public interface IDataVoltageService extends IService<DataVoltage> {
 
     /**
-     * 参数历史查询
+     * 监测参数查询——电压
      */
-    List<DataVoltageVO> dataList(DataVoltageQueryDTO dto);
+    List<DataVoltageVO> dataList(ParamQueryDataDTO dto);
 
 }

+ 5 - 6
module_ems/src/main/java/org/jeecg/modules/dataVoltage/service/impl/DataVoltageServiceImpl.java

@@ -1,14 +1,13 @@
 package org.jeecg.modules.dataVoltage.service.impl;
 
-import org.jeecg.modules.dataVoltage.dto.DataVoltageQueryDTO;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.jeecg.modules.dataVoltage.entity.DataVoltage;
 import org.jeecg.modules.dataVoltage.mapper.DataVoltageMapper;
 import org.jeecg.modules.dataVoltage.service.IDataVoltageService;
+import org.jeecg.modules.dataVoltage.vo.DataVoltageVO;
+import org.jeecg.modules.paramquery.dto.ParamQueryDataDTO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import org.jeecg.modules.dataVoltage.vo.DataVoltageVO;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 
 import java.util.List;
 
@@ -25,9 +24,9 @@ public class DataVoltageServiceImpl extends ServiceImpl<DataVoltageMapper, DataV
     private DataVoltageMapper dataVoltageMapper;
 
     /**
-     * 参数历史查询
+     * 监测参数查询——电压
      */
-    public List<DataVoltageVO> dataList(DataVoltageQueryDTO dto){
+    public List<DataVoltageVO> dataList(ParamQueryDataDTO dto){
         return dataVoltageMapper.dataList(dto);
     }
 

+ 9 - 9
module_ems/src/main/java/org/jeecg/modules/dataVoltage/vo/DataVoltageVO.java

@@ -9,17 +9,17 @@ import org.springframework.format.annotation.DateTimeFormat;
 @Data
 public class DataVoltageVO {
 
-    /**A相电压点位值(电量)*/
-    @Excel(name = "A相电压点位值(电量)", width = 15)
-    @ApiModelProperty(value = "A相电压点位值(电量)")
+    /**A相电压点位值*/
+    @Excel(name = "A相电压点位值", width = 15)
+    @ApiModelProperty(value = "A相电压点位值")
     private java.lang.Double atagvalue;
-    /**B相电压点位值(电量)*/
-    @Excel(name = "B相电压点位值(电量)", width = 15)
-    @ApiModelProperty(value = "B相电压点位值(电量)")
+    /**B相电压点位值*/
+    @Excel(name = "B相电压点位值", width = 15)
+    @ApiModelProperty(value = "B相电压点位值")
     private java.lang.Double btagvalue;
-    /**C相电压点位值(电量)*/
-    @Excel(name = "C相电压点位值(电量)", width = 15)
-    @ApiModelProperty(value = "C相电压点位值(电量)")
+    /**C相电压点位值*/
+    @Excel(name = "C相电压点位值", width = 15)
+    @ApiModelProperty(value = "C相电压点位值")
     private java.lang.Double ctagvalue;
     /**时间*/
     @Excel(name = "时间", width = 15, format = "MM-dd HH:mm")

+ 71 - 0
module_ems/src/main/java/org/jeecg/modules/paramquery/controller/ParamQueryDataConotroller.java

@@ -0,0 +1,71 @@
+package org.jeecg.modules.paramquery.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.modules.dataCurrent.service.IDataCurrentService;
+import org.jeecg.modules.dataCurrent.vo.DataCurrentVO;
+import org.jeecg.modules.dataDemand.service.IDataDemandService;
+import org.jeecg.modules.dataDemand.vo.DataDemandVO;
+import org.jeecg.modules.dataElectricity.service.IDataElectricityService;
+import org.jeecg.modules.dataElectricity.vo.DataElectricityVO;
+import org.jeecg.modules.dataPower.service.IDataPowerService;
+import org.jeecg.modules.dataPower.vo.DataPowerVO;
+import org.jeecg.modules.dataVoltage.service.IDataVoltageService;
+import org.jeecg.modules.dataVoltage.vo.DataVoltageVO;
+import org.jeecg.modules.paramquery.dto.ParamQueryDataDTO;
+import org.jeecg.modules.paramquery.vo.ParamQueryDataVO;
+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.List;
+
+@RestController
+@Api(tags = "监测参数查询")
+@RequestMapping("/dataVoltage/dataVoltage")
+@Slf4j
+public class ParamQueryDataConotroller {
+    @Autowired
+    private IDataVoltageService voltageService;
+    @Autowired
+    private IDataCurrentService currentService;
+    @Autowired
+    private IDataDemandService demandService;
+    @Autowired
+    private IDataElectricityService electricityService;
+    @Autowired
+    private IDataPowerService powerService;
+
+    /**
+     * 监测参数查询
+     */
+    @ApiOperation(value="监测参数查询", notes="监测参数查询")
+    @GetMapping(value = "/dataList")
+    public Result<ParamQueryDataVO> dataList(ParamQueryDataDTO dto) {
+        ParamQueryDataVO vo = new ParamQueryDataVO();
+	 	if(dto.getQueryparamtype()!=null && !dto.getQueryparamtype().equals("")){
+	 		String queryparamtype = dto.getQueryparamtype();
+	 		if(queryparamtype.equals("电压")){
+                List<DataVoltageVO> voltageVOList = voltageService.dataList(dto);
+                vo.setVoltageVOList(voltageVOList);
+			}else if(queryparamtype.equals("电流")){
+                List<DataCurrentVO> currentVOList = currentService.dataList(dto);
+                vo.setCurrentVOList(currentVOList);
+			}else if(queryparamtype.equals("需量")){
+                List<DataDemandVO> demandVOList = demandService.dataList(dto);
+                vo.setDemandVOList(demandVOList);
+			}else if(queryparamtype.equals("分时电量")){
+                List<DataElectricityVO> electricityVOList = electricityService.dataList(dto);
+                vo.setElectricityVOList(electricityVOList);
+			}else if(queryparamtype.equals("功率")){
+                List<DataPowerVO> powerVOList = powerService.dataList(dto);
+                vo.setPowerVOList(powerVOList);
+			}else return Result.error("请输入正确的查询参数类型");
+		}else return Result.error("请输入查询参数类型");
+        return Result.OK(vo);
+    }
+
+}

+ 6 - 2
module_ems/src/main/java/org/jeecg/modules/dataVoltage/dto/DataVoltageQueryDTO.java

@@ -1,4 +1,4 @@
-package org.jeecg.modules.dataVoltage.dto;
+package org.jeecg.modules.paramquery.dto;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModelProperty;
@@ -8,12 +8,16 @@ import org.springframework.format.annotation.DateTimeFormat;
 
 
 @Data
-public class DataVoltageQueryDTO {
+public class ParamQueryDataDTO {
 
     /**设备ID*/
     @Excel(name = "设备ID", width = 15)
     @ApiModelProperty(value = "设备ID")
     private java.lang.String equipmentid;
+    /**查询参数类型*/
+    @Excel(name = "查询参数类型", width = 15)
+    @ApiModelProperty(value = "查询参数类型")
+    private java.lang.String queryparamtype;
     /**开始时间*/
     @Excel(name = "开始时间", width = 15, format = "yyyy-MM-dd HH:mm:ss")
     @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")

+ 21 - 0
module_ems/src/main/java/org/jeecg/modules/paramquery/vo/ParamQueryDataVO.java

@@ -0,0 +1,21 @@
+package org.jeecg.modules.paramquery.vo;
+
+import lombok.Data;
+import org.jeecg.modules.dataCurrent.vo.DataCurrentVO;
+import org.jeecg.modules.dataDemand.vo.DataDemandVO;
+import org.jeecg.modules.dataElectricity.vo.DataElectricityVO;
+import org.jeecg.modules.dataPower.vo.DataPowerVO;
+import org.jeecg.modules.dataVoltage.vo.DataVoltageVO;
+
+import java.util.List;
+
+@Data
+public class ParamQueryDataVO {
+
+    private List<DataVoltageVO> voltageVOList;
+    private List<DataCurrentVO> currentVOList;
+    private List<DataDemandVO> demandVOList;
+    private List<DataElectricityVO> electricityVOList;
+    private List<DataPowerVO> powerVOList;
+
+}