我想从数据库中检索,即使其中一个字段为空
这是查询
@Query("{'origin.airport.iatacode' : ?0,'scores.value' : ?1,'carriername' : ?2,'scores.datetimedimension' : ?3}")
Set<Route> findByAll(String iatacode,Integer value,String carriername,String datetimedimension);
控制器
@RequestMapping(value = "/filter",
method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE)
@Timed
public Set<Route> gettome() {
return routeRepository.findByAll("SOW", null, "Great Lakes Airlines", "201503");
}
此查询过滤器路由集合取决于此值(iatacode,value,carriername,datetimedimension)
有时其中一个值或多个值为null,因此我需要使用其他值进行过滤并忽略具有null的值。
任何人都可以帮我做那件事或者给我其他想法来过滤可用值吗?