From 129e7dde5da351e111c53d34b7dfa0d4c1f896ef Mon Sep 17 00:00:00 2001
From: kaiyu <404897439@qq.com>
Date: Tue, 08 Dec 2020 10:09:53 +0800
Subject: [PATCH] 添加网页版获取单台设备一个小时AQI接口以及获取单台设备的某一个传感器月平均值
---
src/main/java/com/moral/controller/DeviceController.java | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/moral/controller/DeviceController.java b/src/main/java/com/moral/controller/DeviceController.java
index 5febfa5..d02ddd8 100644
--- a/src/main/java/com/moral/controller/DeviceController.java
+++ b/src/main/java/com/moral/controller/DeviceController.java
@@ -9,6 +9,7 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
+import com.moral.mapper.DeviceMapper;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@@ -30,6 +31,8 @@
public class DeviceController {
@Resource
DeviceService deviceService;
+ @Resource
+ DeviceMapper deviceMapper;
@GetMapping("count-by-example")
public ResultBean<Integer> countByExample(PageBean pageBean){
return new ResultBean<Integer>(deviceService.countByExample(pageBean));
@@ -68,6 +71,12 @@
List<Device> devices = deviceService.getDevicesByProfessionId(parameters);
return new ResultBean<List<Device>>(devices);
}
+
+ @GetMapping("getDeviceByMonitorId")
+ public ResultBean<List<Map<String, Object>>> getDeviceByMonitorId() {
+ List<Map<String, Object>> devices = deviceMapper.getDevicesByMpId(563);
+ return new ResultBean<List<Map<String, Object>>>(devices);
+ }
@PostMapping("save-or-update")
public ResultBean saveOrUpdate(@RequestBody String jsonString){
--
Gitblit v1.8.0