|
@@ -1,9 +1,17 @@
|
1
|
1
|
package com.huiju.welcome.controller;
|
2
|
2
|
|
|
3
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
4
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
3
|
5
|
import com.huiju.welcome.common.base.BaseController;
|
4
|
6
|
import com.huiju.welcome.common.base.ResponseBean;
|
|
7
|
+import com.huiju.welcome.model.TaCar;
|
|
8
|
+import com.huiju.welcome.model.TaContentLib;
|
5
|
9
|
import com.huiju.welcome.service.ITaCarService;
|
6
|
10
|
import com.huiju.welcome.utils.CommConstant;
|
|
11
|
+import com.huiju.welcome.utils.StatusUtils;
|
|
12
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
13
|
+import io.swagger.annotations.ApiImplicitParams;
|
|
14
|
+import io.swagger.annotations.ApiOperation;
|
7
|
15
|
import org.slf4j.Logger;
|
8
|
16
|
import org.slf4j.LoggerFactory;
|
9
|
17
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -37,5 +45,27 @@ public class TaCarController extends BaseController {
|
37
|
45
|
iTaCarService.setCarType(id, CommConstant.TYPE_CAR_NORMAL);
|
38
|
46
|
return ResponseBean.success("");
|
39
|
47
|
}
|
|
48
|
+
|
|
49
|
+ @ApiOperation(value = "分页获取车辆信息", notes = "分页获取车辆信息")
|
|
50
|
+ @ApiImplicitParams({
|
|
51
|
+ @ApiImplicitParam(paramType = "query", dataType = "int", name = "pageNum", value = "当前页"),
|
|
52
|
+ @ApiImplicitParam(paramType = "query", dataType = "int", name = "pageSize", value = "每页数量"),
|
|
53
|
+ @ApiImplicitParam(paramType = "query", dataType = "int", name = "plateNumber", value = "车牌号"),
|
|
54
|
+ })
|
|
55
|
+ @GetMapping("/cars")
|
|
56
|
+ public ResponseBean getCarList(@RequestParam Integer pageNum, @RequestParam Integer pageSize,@RequestParam String plateNumber){
|
|
57
|
+ ResponseBean responseBean = new ResponseBean();
|
|
58
|
+
|
|
59
|
+ Page<TaCar> pg = new Page<>();
|
|
60
|
+ pg.setCurrent(pageNum);
|
|
61
|
+ pg.setSize(pageSize);
|
|
62
|
+ QueryWrapper<TaCar> queryWrapper = new QueryWrapper<>();
|
|
63
|
+ queryWrapper.orderByDesc("create_date");
|
|
64
|
+ queryWrapper.eq("status", StatusUtils.Normal);
|
|
65
|
+ queryWrapper.like("plate_number",plateNumber);
|
|
66
|
+ responseBean.addSuccess(iTaCarService.page(pg, queryWrapper));
|
|
67
|
+
|
|
68
|
+ return responseBean;
|
|
69
|
+ }
|
40
|
70
|
|
41
|
71
|
}
|