| | |
| | | package com.ycl.service.carManage.impl; |
| | | |
| | | import com.alibaba.excel.util.StringUtils; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ycl.dto.carManage.CarEnforcecarVo; |
| | | import com.ycl.entity.carManage.CarEnforcecar; |
| | | import com.ycl.mapper.carManage.CarEnforcecarMapper; |
| | | import com.ycl.service.carManage.ICarEnforcecarService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class CarEnforcecarServiceImpl extends ServiceImpl<CarEnforcecarMapper, CarEnforcecar> implements ICarEnforcecarService { |
| | | |
| | | @Override |
| | | public Page<CarEnforcecarVo> searchEnforceCar(Integer size, Integer current, String carNum) { |
| | | Page<CarEnforcecarVo> page = new Page<>(); |
| | | page.setSize(size); |
| | | page.setCurrent(current); |
| | | |
| | | List<CarEnforcecarVo> ls = baseMapper.searchEnforceCar(carNum, page.offset(), page.getSize()); |
| | | page.setRecords(ls); |
| | | LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<CarEnforcecar>() |
| | | .like(StringUtils.isNotBlank(carNum), CarEnforcecar::getCarNumber, carNum); |
| | | page.setTotal(this.count(queryWrapper)); |
| | | |
| | | return page; |
| | | } |
| | | } |