VehicleInoutStopController.java
2.02 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
47
48
49
50
51
52
53
54
55
56
57
package com.bsth.controller.traffic;
import com.bsth.controller.BaseController;
import com.bsth.entity.traffic.VehicleInoutStop;
import com.bsth.service.impl.TrafficManageServiceImpl;
import com.bsth.service.traffic.VehicleInoutStopService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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> {
Logger logger = LoggerFactory.getLogger(TrafficManageServiceImpl.class);
@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) {
Page<Map<String, Object>> result = null;
try {
map.put("page",page);
map.put("size",size);
long total = vehicleInoutStopService.getVehicleInoutStopCountByParam(map);
result = new PageImpl<>(vehicleInoutStopService.getVehicleInoutStopByParam(map),
new PageRequest(page, size, null),total);
}catch (Exception e){
logger.error("车载上报停靠站查询出错:",e);
e.printStackTrace();
}
return result;
}
}