springcloud根据日期区间查询同时其他字段模糊查询

/**
	 * 分页查询完工送检单
	 * @param entity
	 * @param query
	 * @return
	 */
	@GetMapping("getQcProInsAppOverList")
	public R<IPage<QcProInsAppOverVO>> getQcProInsAppOverList(@ApiIgnore @RequestParam Map<String, Object> entity, Query query){
		log.info("分页查询完工送检单entity======"+entity);
		QueryWrapper<QcProInsAppOver> queryWrapper=Condition.getQueryWrapper(entity,QcProInsAppOver.class).orderByDesc("id");
		if(entity.containsKey("startDateTime")&&entity.containsKey("endDateTime") && Func.isNotEmpty(entity.get("startDateTime"))&&Func.isNotEmpty(entity.get("endDateTime"))){
			Map<String,Object>map=new HashMap<>();
			map.putAll(entity);
			map.remove("startDateTime");
			map.remove("endDateTime");
			map.remove("current");
			map.remove("size");
			queryWrapper=Condition.getQueryWrapper(map, QcProInsAppOver.class).orderByDesc("id").between("create_date",entity.get("startDateTime"),entity.get("endDateTime"));
		}
		IPage<QcProInsAppOver> pages = qcProInsAppOverService.page(Condition.getPage(query),queryWrapper);
		return R.data(QcProInsAppOverWrapper.build().pageVO(pages));
	}

  

posted @ 2020-12-29 16:02  红尘沙漏  阅读(297)  评论(0编辑  收藏  举报