| | |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.boying.common.R; |
| | | import com.boying.entity.Inspection; |
| | | import com.boying.entity.Park; |
| | | import com.boying.entity.Repair; |
| | | import com.boying.entity.WhiteList; |
| | | import com.boying.service.BarrierService; |
| | | import com.boying.service.ParkService; |
| | | import com.boying.service.RepairService; |
| | | import com.boying.service.WhiteListService; |
| | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | |
| | | @RestController |
| | |
| | | |
| | | private final RepairService repairService; |
| | | private final ParkService parkService; |
| | | private final BarrierService barrierService; |
| | | |
| | | @PostMapping("/findPage") |
| | | //@Operation(summary = "分页查询" , description = "分页查询" ) |
| | | public Object findPage(Page page, String carNo) { |
| | | public Object findPage(Page page,Long parkId) { |
| | | QueryWrapper<Repair> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | | .eq(parkId !=null, Repair::getParkId,parkId) |
| | | .orderByDesc(Repair::getId); |
| | | Page<Repair> page1 = repairService.page(page, wrapper); |
| | | List<Repair> records = page1.getRecords(); |
| | | for (Repair record : records) { |
| | | record.setParkName(parkService.getById(record.getParkId()).getName()); |
| | | record.setBarrierName(barrierService.getById(record.getBarrierId()).getName()); |
| | | } |
| | | page1.setRecords(records); |
| | | return R.ok(page1); |
| | | } |
| | | |