searchable中((A&&B)||(C&&D))的情況
阿新 • • 發佈:2018-12-12
Searchable searchable = new SearchRequest(); searchable.setPage(page - 1, rows); OrCondition orCondition; SearchFilter filterOne = SearchFilterHelper.newCondition("createUserId_eq", useID); SearchFilter filterTwo = SearchFilterHelper.newCondition("isSupervise_eq", 0); SearchFilter filter = SearchFilterHelper.and(filterOne, filterTwo); //負責人id等於登入使用者id SearchFilter filter1 = SearchFilterHelper.newCondition("respDepartmentId_eq", useID); // 狀態為已下達 SearchFilter filter2 = SearchFilterHelper.newCondition("flowState_eq", SuperviseStateEnum.goDown.getCode()); SearchFilter searchFilter = SearchFilterHelper.and(filter1, filter2); orCondition = (OrCondition) SearchFilterHelper.or(filter); orCondition.add(searchFilter); searchable.addSearchFilter(orCondition); this.find(searchable);