| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.boying.common.R; |
| | | import com.boying.entity.Inspection; |
| | | import com.boying.entity.Repair; |
| | | import com.boying.entity.WhiteList; |
| | | import com.boying.service.BarrierService; |
| | | import com.boying.service.InspectionService; |
| | | import com.boying.service.ParkService; |
| | | import com.boying.service.WhiteListService; |
| | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | |
| | | @RestController |
| | |
| | | |
| | | private final InspectionService inspectionService; |
| | | 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<Inspection> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | | .eq(parkId !=null,Inspection::getParkId,parkId) |
| | | .orderByDesc(Inspection::getId); |
| | | Page<Inspection> page1 = inspectionService.page(page, wrapper); |
| | | List<Inspection> records = page1.getRecords(); |
| | | for (Inspection record : records) { |
| | | record.setParkName(parkService.getById(record.getParkId()).getName()); |
| | | if(record.getBarrierId()!=null){ |
| | | record.setBarrierName(barrierService.getById(record.getBarrierId()).getName()); |
| | | } |
| | | } |
| | | page1.setRecords(records); |
| | | return R.ok(page1); |
| | | } |
| | | |