1. 复杂查询
参考官方文档:http://www.querydsl.com/static/querydsl/latest/reference/html/ch03.html#d0e2023
样例:
BooleanBuilder builder =new BooleanBuilder();
if (findHouseNewHouseQuery.getCityId() !=null) {
builder.and(qHouseNewRoomTypeDealStatistics.cityId.eq(findHouseNewHouseQuery.getCityId()));
}
List quotedPriceList = findHouseNewHouseQuery.getQuotedPriceList();
if (CollectionUtils.isNotEmpty(quotedPriceList)) {
BooleanBuilder quotedPriceBuilder =new BooleanBuilder();
for (NewHouseOperateOb newHouseOperateOb : quotedPriceList) {
quotedPriceBuilder.or(qHouseNewRoomTypeDealStatistics.minTotalPrice.goe(newHouseOperateOb.getStartValue()).and(qHouseNewRoomTypeDealStatistics.minTotalPrice.lt(newHouseOperateOb.getEndValue())));
}
builder.and(quotedPriceBuilder);
}