|  |  | 
 |  |  | 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; | 
 |  |  | 
 |  |  | 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)); | 
 |  |  |     } | 
 |  |  |     @GetMapping("count-by-times") | 
 |  |  | /*    @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); | 
 |  |  | 
 |  |  |        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){ |