| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | |
| | | @RestController |
| | | @RequestMapping("whiteList") |
| | | @RequestMapping("ffzf/whiteList") |
| | | @RequiredArgsConstructor |
| | | public class WhiteListController{ |
| | | |
| | |
| | | private final ParkService parkService; |
| | | |
| | | @PostMapping("/findPage") |
| | | //@Operation(summary = "分页查询" , description = "分页查询" ) |
| | | public Object findPage(Page page, String carNo) { |
| | | QueryWrapper<WhiteList> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | | .orderByDesc(WhiteList::getId) |
| | | .eq(StringUtils.isNotBlank(carNo),WhiteList::getCarNo,carNo); |
| | | .like(StringUtils.isNotBlank(carNo),WhiteList::getCarNo,carNo) |
| | | .orderByDesc(WhiteList::getId); |
| | | Page<WhiteList> page1 = whiteListService.page(page, wrapper); |
| | | for (WhiteList record : page1.getRecords()) { |
| | | if(record.getParkId() != null){ |
| | |
| | | } |
| | | |
| | | @PostMapping("/findPageNew") |
| | | public Object findPageNew(Page page, String carNo) { |
| | | public Object findPageNew(Page page, String carNo,Integer type,String date) throws ParseException { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | if(StringUtils.isNotBlank(date)){ |
| | | System.out.println(date); |
| | | Date parse = sdf.parse(date); |
| | | date = sdf.format(parse); |
| | | } |
| | | QueryWrapper<WhiteList> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | | .orderByDesc(WhiteList::getId) |
| | | .eq(StringUtils.isNotBlank(carNo),WhiteList::getCarNo,carNo); |
| | | .like(StringUtils.isNotBlank(carNo),WhiteList::getCarNo,carNo) |
| | | .eq(type!=null,WhiteList::getType,type) |
| | | .le(StringUtils.isNotBlank(date),WhiteList::getEndTime,date); |
| | | Page<WhiteList> page1 = whiteListService.page(page, wrapper); |
| | | for (WhiteList record : page1.getRecords()) { |
| | | if(StringUtils.isNotBlank(record.getParkIds())){ |