bladex分页

/**
	 * 分页查询
	 * @param entity
	 * @return
	 */
	@GetMapping("getPageList")
	public R<IPage<ConsumptionMachineVO>> getPageList(@ApiIgnore @RequestParam Map<String, Object> entity, Query query){
		QueryWrapper<ConsumptionMachine> queryWrapper=Condition.getQueryWrapper(entity,ConsumptionMachine.class).orderByDesc("id");
		if(entity.containsKey("startMealDate")&& entity.containsKey("endMealDate")){
			Date startMealDate=CMDateTimeUtil.getDateFromString(String.valueOf(entity.get("startMealDate")));
			Date endMealDate=CMDateTimeUtil.getDateFromString(String.valueOf(entity.get("endMealDate")));
			Map<String,Object>map=new HashMap<>();
			map.putAll(entity);
			map.remove("startMealDate");
			map.remove("endMealDate");
			map.remove("current");
			map.remove("size");
			queryWrapper=Condition.getQueryWrapper(map, ConsumptionMachine.class).orderByDesc("id").between("posoptime",startMealDate,endMealDate);
		}
		IPage<ConsumptionMachine> pages = consumptionMachineService.page(Condition.getPage(query), queryWrapper);
		return R.data(ConsumptionMachineWrapper.build().pageVO(pages));
	}

  

posted @ 2021-01-28 15:18  红尘沙漏  阅读(531)  评论(0编辑  收藏  举报