From 7be408b1ce28b70005cdf147f9c41065ddc43dea Mon Sep 17 00:00:00 2001
From: fengxiang <110431245@qq.com>
Date: Tue, 08 May 2018 16:48:18 +0800
Subject: [PATCH] 设备信息修改

---
 src/main/java/com/moral/controller/DeviceController.java |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/moral/controller/DeviceController.java b/src/main/java/com/moral/controller/DeviceController.java
index 87e7fa1..468425f 100644
--- a/src/main/java/com/moral/controller/DeviceController.java
+++ b/src/main/java/com/moral/controller/DeviceController.java
@@ -2,8 +2,13 @@
 
 import com.moral.common.bean.PageBean;
 import com.moral.common.bean.ResultBean;
+import com.moral.entity.Device;
 import com.moral.service.DeviceService;
 import org.springframework.web.bind.annotation.*;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
 
 import javax.annotation.Resource;
 
@@ -13,6 +18,14 @@
 public class DeviceController {
     @Resource
     DeviceService deviceService;
+    @GetMapping("count-by-example")
+    public ResultBean<Integer> countByExample(PageBean pageBean){
+        return  new ResultBean<Integer>(deviceService.countByExample(pageBean));
+    }
+    @GetMapping("count-by-times")
+    public ResultBean<List<Map>> countByTimes(Date start, Date end){
+        return  new ResultBean<List<Map>>(deviceService.countByTimes(start,end,"%Y-%m"));
+    }
     @GetMapping("page-list")
     public PageBean pageList(PageBean pageBean) {
         return deviceService.queryByPageBean(pageBean);
@@ -23,4 +36,17 @@
         ResultBean resultBean = new ResultBean(ResultBean.SUCCESS);
         return resultBean;
     }
+    @PostMapping("add-or-modify")
+    public ResultBean addOrModify(@RequestBody Device device){
+        deviceService.addOrModify(device);
+        ResultBean resultBean = new ResultBean(ResultBean.SUCCESS);
+        return resultBean;
+    }
+
+    @GetMapping("monitorPointId")
+    public ResultBean<List<Device>> getDevicesByMonitorPointId(@RequestParam(name="monitorPointId")Integer  monitorPointId) {
+    	
+    	List<Device> devices = deviceService.getDevicesByMonitorPointId(monitorPointId);
+        return new ResultBean<List<Device>>(devices);
+    }
 }

--
Gitblit v1.8.0