更新分页
parent
5b2ddb22e0
commit
60c5e03819
|
@ -77,6 +77,12 @@
|
||||||
<artifactId>dragon-common-log</artifactId>
|
<artifactId>dragon-common-log</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.dragon</groupId>
|
||||||
|
<artifactId>dragon-common-core</artifactId>
|
||||||
|
<version>3.6.4</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Dragon Common Swagger -->
|
<!-- Dragon Common Swagger -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.dragon</groupId>
|
<groupId>com.dragon</groupId>
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.dragon.vehicle.history.server.controller;
|
package com.dragon.vehicle.history.server.controller;
|
||||||
|
|
||||||
import com.dragon.common.core.domain.Result;
|
import com.dragon.common.core.domain.Result;
|
||||||
|
import com.dragon.common.core.domain.PageResult;
|
||||||
import com.dragon.vehicle.history.common.domain.Car;
|
import com.dragon.vehicle.history.common.domain.Car;
|
||||||
import com.dragon.vehicle.history.common.domain.CarType;
|
import com.dragon.vehicle.history.common.domain.CarType;
|
||||||
import com.dragon.vehicle.history.common.domain.Fence;
|
import com.dragon.vehicle.history.common.domain.Fence;
|
||||||
|
@ -29,8 +30,9 @@ public class CarController {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/listCar")
|
@PostMapping("/listCar")
|
||||||
public Result<List<ResCar>> listCar(@RequestBody ReqCar reqCar){
|
public Result<PageResult<ResCar>> listCar(@RequestBody ReqCar reqCar){
|
||||||
return carService.listCar(reqCar);
|
Result<PageResult<ResCar>> result = carService.listCar(reqCar);
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.dragon.vehicle.history.server.service;
|
package com.dragon.vehicle.history.server.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.dragon.common.core.domain.PageResult;
|
||||||
import com.dragon.common.core.domain.Result;
|
import com.dragon.common.core.domain.Result;
|
||||||
import com.dragon.vehicle.history.common.domain.Car;
|
import com.dragon.vehicle.history.common.domain.Car;
|
||||||
import com.dragon.vehicle.history.common.domain.CarType;
|
import com.dragon.vehicle.history.common.domain.CarType;
|
||||||
|
@ -21,7 +22,7 @@ public interface CarService {
|
||||||
* @param reqCar 分页参数
|
* @param reqCar 分页参数
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Result<List<ResCar>> listCar(ReqCar reqCar);
|
Result<PageResult<ResCar>> listCar(ReqCar reqCar);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询车辆类型列表
|
* 查询车辆类型列表
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.dragon.vehicle.history.server.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.dragon.common.core.domain.PageResult;
|
||||||
import com.dragon.common.core.domain.Result;
|
import com.dragon.common.core.domain.Result;
|
||||||
import com.dragon.vehicle.history.common.domain.Car;
|
import com.dragon.vehicle.history.common.domain.Car;
|
||||||
import com.dragon.vehicle.history.common.domain.CarType;
|
import com.dragon.vehicle.history.common.domain.CarType;
|
||||||
|
@ -40,7 +41,7 @@ public class CarServiceImpl implements CarService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Result<List<ResCar>> listCar(ReqCar reqCar) {
|
public Result<PageResult<ResCar>> listCar(ReqCar reqCar) {
|
||||||
Page<ResCar> resCarPage = new Page<>(reqCar.getPageNum(), reqCar.getPageSize());
|
Page<ResCar> resCarPage = new Page<>(reqCar.getPageNum(), reqCar.getPageSize());
|
||||||
List<ResCar> resCars = carMapper.selectJoinPage(resCarPage, ResCar.class, new MPJLambdaWrapper<Car>()
|
List<ResCar> resCars = carMapper.selectJoinPage(resCarPage, ResCar.class, new MPJLambdaWrapper<Car>()
|
||||||
.selectAll(Car.class)
|
.selectAll(Car.class)
|
||||||
|
@ -55,8 +56,8 @@ public class CarServiceImpl implements CarService {
|
||||||
.eq(reqCar.getCarTypeId() != null, CarType::getCarTypeId, reqCar.getCarTypeId())
|
.eq(reqCar.getCarTypeId() != null, CarType::getCarTypeId, reqCar.getCarTypeId())
|
||||||
.like(reqCar.getFenceName() != null, Fence::getFenceName, reqCar.getFenceName())
|
.like(reqCar.getFenceName() != null, Fence::getFenceName, reqCar.getFenceName())
|
||||||
).getRecords();
|
).getRecords();
|
||||||
|
int size = resCars.size();
|
||||||
return Result.success(resCars,"查询成功!");
|
return PageResult.toResult(size,resCars);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue