Преглед изворни кода

设备实时电压参数历史查询

LLL пре 1 година
родитељ
комит
c5f2e78cd9

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

@@ -12,6 +12,7 @@ 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;
 
@@ -20,6 +21,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 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;
@@ -50,6 +52,16 @@ 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);
+	 }
+
 	/**
 	 * 分页列表查询
 	 *

+ 30 - 0
module_ems/src/main/java/org/jeecg/modules/dataVoltage/dto/DataVoltageQueryDTO.java

@@ -0,0 +1,30 @@
+package org.jeecg.modules.dataVoltage.dto;
+
+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 DataVoltageQueryDTO {
+
+    /**设备ID*/
+    @Excel(name = "设备ID", width = 15)
+    @ApiModelProperty(value = "设备ID")
+    private java.lang.String equipmentid;
+    /**开始时间*/
+    @Excel(name = "开始时间", width = 15, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "开始时间")
+    private java.util.Date logtimebegin;
+    /**结束时间*/
+    @Excel(name = "结束时间", width = 15, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "结束时间")
+    private java.util.Date logtimeend;
+
+}

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

@@ -30,4 +30,14 @@
         </where>
         order by id asc
     </select>
+
+    <!--参数历史查询-->
+    <select id="dataList" parameterType="org.jeecg.modules.dataVoltage.dto.DataVoltageQueryDTO" resultType="org.jeecg.modules.dataVoltage.vo.DataVoltageVO">
+        SELECT logtime
+        FROM ems_data_voltage
+        <where>
+            <if test="equipmentid != null and equipmentid != ''"> and equipmentid = #{equipmentid}</if>
+        </where>
+    </select>
+
 </mapper>

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

@@ -1,7 +1,11 @@
 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.vo.DataVoltageVO;
+
+import java.util.List;
 
 /**
  * @Description: ems_data_voltage
@@ -11,4 +15,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface IDataVoltageService extends IService<DataVoltage> {
 
+    /**
+     * 参数历史查询
+     */
+    List<DataVoltageVO> dataList(DataVoltageQueryDTO dto);
+
 }

+ 15 - 0
module_ems/src/main/java/org/jeecg/modules/dataVoltage/service/impl/DataVoltageServiceImpl.java

@@ -1,12 +1,17 @@
 package org.jeecg.modules.dataVoltage.service.impl;
 
+import org.jeecg.modules.dataVoltage.dto.DataVoltageQueryDTO;
 import org.jeecg.modules.dataVoltage.entity.DataVoltage;
 import org.jeecg.modules.dataVoltage.mapper.DataVoltageMapper;
 import org.jeecg.modules.dataVoltage.service.IDataVoltageService;
+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;
+
 /**
  * @Description: ems_data_voltage
  * @Author: jeecg-boot
@@ -16,4 +21,14 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 @Service
 public class DataVoltageServiceImpl extends ServiceImpl<DataVoltageMapper, DataVoltage> implements IDataVoltageService {
 
+    @Autowired
+    private DataVoltageMapper dataVoltageMapper;
+
+    /**
+     * 参数历史查询
+     */
+    public List<DataVoltageVO> dataList(DataVoltageQueryDTO dto){
+        return dataVoltageMapper.dataList(dto);
+    }
+
 }

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

@@ -0,0 +1,31 @@
+package org.jeecg.modules.dataVoltage.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 DataVoltageVO {
+
+    /**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;
+
+}