wang-hao-jie
2022-04-18 86c3614c6780b3214ad70ec51011da077113022b
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/DrivingRecordController.java
@@ -84,6 +84,12 @@
    @RequestMapping(value = "/updateMileage", method = RequestMethod.POST)
    @ApiOperation(value = "添加行车记录")
    public Result<DrivingRecord> updateMileage(String carId,int mileage,String userId,String inDate) {
        if(StrUtil.isEmpty(userId)){
            return ResultUtil.error("参数不完整");
        }
        if(StrUtil.isEmpty(carId)){
            return ResultUtil.error("参数不完整");
        }
        String format = DateUtil.format(new Date(), "yyyy-MM-dd");
        QueryWrapper<DrivingRecord> wrapper = new QueryWrapper<>();
        wrapper.eq("driving_date",format);
@@ -117,9 +123,11 @@
    @RequestMapping(value = "/getByPage", method = RequestMethod.GET)
    @ApiOperation(value = "分页获取")
    public Result<IPage<DrivingRecord>> getByPage(PageVo page) {
        IPage<DrivingRecord> data = iDrivingRecordService.page(PageUtil.initMpPage(page));
    public Result<IPage<DrivingRecord>> getByPage(PageVo page,String carNo) {
        QueryWrapper<DrivingRecord> wrapper = new QueryWrapper<>();
        if(!StrUtil.isEmpty(carNo))
            wrapper.like("b.car_no","%"+carNo+"%");
        IPage<DrivingRecord> data = iDrivingRecordService.page2(PageUtil.initMpPage(page),wrapper);
        return new ResultUtil<IPage<DrivingRecord>>().setData(data);
    }