fengxiang
2018-05-08 7be408b1ce28b70005cdf147f9c41065ddc43dea
src/main/java/com/moral/controller/DeviceController.java
@@ -6,7 +6,9 @@
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;
@@ -16,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);