VehicleInoutStopController.java
1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package com.bsth.controller.traffic;
import com.bsth.controller.BaseController;
import com.bsth.entity.traffic.VehicleInoutStop;
import com.bsth.service.traffic.VehicleInoutStopService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
*
* @author BSTH
*
*/
@RestController
@RequestMapping("vehicle_stop")
public class VehicleInoutStopController extends BaseController<VehicleInoutStop,Integer> {
@Autowired
VehicleInoutStopService vehicleInoutStopService;
/**
* 给定条件查车载上报停靠站
* @param map
* @param page
* @param size
* @return
*/
@RequestMapping(value = "getVehicleInoutStopByParam")
public Page<Map<String, Object>> getVehicleInoutStopByParam(@RequestParam Map<String, Object> map,
@RequestParam(defaultValue = "0") int page,
@RequestParam(defaultValue = "10") int size) {
map.put("page",page);
map.put("size",size);
long total = vehicleInoutStopService.getVehicleInoutStopCountByParam(map);
Page<Map<String, Object>> result = new PageImpl<>(vehicleInoutStopService.getVehicleInoutStopByParam(map),
new PageRequest(page, size, null),total);
return result;
}
}