From 4a41bd4e105385b5460e5a81c8b67e5f701a262b Mon Sep 17 00:00:00 2001 From: fengxiang <110431245@qq.com> Date: Fri, 04 May 2018 08:55:13 +0800 Subject: [PATCH] 首页 工作台 --- src/main/java/com/moral/controller/DeviceController.java | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/moral/controller/DeviceController.java b/src/main/java/com/moral/controller/DeviceController.java index 0cbbc34..468425f 100644 --- a/src/main/java/com/moral/controller/DeviceController.java +++ b/src/main/java/com/moral/controller/DeviceController.java @@ -6,6 +6,10 @@ 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; @RestController @@ -14,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); @@ -30,4 +42,11 @@ 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