|
@@ -22,6 +22,9 @@ import com.qmth.cqb.utils.CommonUtils;
|
|
|
|
|
|
import cn.com.qmth.examcloud.common.uac.entity.AccessUser;
|
|
import cn.com.qmth.examcloud.common.uac.entity.AccessUser;
|
|
|
|
|
|
|
|
+import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.contains;
|
|
|
|
+import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.exact;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Created by songyue on 16/12/28.
|
|
* Created by songyue on 16/12/28.
|
|
*/
|
|
*/
|
|
@@ -43,7 +46,10 @@ public class PaperStructService {
|
|
formatSearchInfo(searchInfo);
|
|
formatSearchInfo(searchInfo);
|
|
PaperStruct paperStruct = BeanCopierUtil.copyProperties(searchInfo, PaperStruct.class);
|
|
PaperStruct paperStruct = BeanCopierUtil.copyProperties(searchInfo, PaperStruct.class);
|
|
formatPaperStruct(paperStruct);
|
|
formatPaperStruct(paperStruct);
|
|
- ExampleMatcher matcher = ExampleMatcher.matching().withStringMatcher(ExampleMatcher.StringMatcher.CONTAINING)
|
|
|
|
|
|
+ ExampleMatcher matcher = ExampleMatcher.matching()
|
|
|
|
+ .withMatcher("name",contains())
|
|
|
|
+ .withMatcher("creator",contains())
|
|
|
|
+ .withMatcher("orgId",exact())
|
|
.withIgnoreNullValues();
|
|
.withIgnoreNullValues();
|
|
return paperStructRepo.findAll(Example.of(paperStruct, matcher), new PageRequest(curPage - 1, pageSize));
|
|
return paperStructRepo.findAll(Example.of(paperStruct, matcher), new PageRequest(curPage - 1, pageSize));
|
|
}
|
|
}
|
|
@@ -57,7 +63,10 @@ public class PaperStructService {
|
|
formatSearchInfo(searchInfo);
|
|
formatSearchInfo(searchInfo);
|
|
PaperStruct paperStruct = BeanCopierUtil.copyProperties(searchInfo, PaperStruct.class);
|
|
PaperStruct paperStruct = BeanCopierUtil.copyProperties(searchInfo, PaperStruct.class);
|
|
formatPaperStruct(paperStruct);
|
|
formatPaperStruct(paperStruct);
|
|
- ExampleMatcher matcher = ExampleMatcher.matching().withStringMatcher(ExampleMatcher.StringMatcher.CONTAINING)
|
|
|
|
|
|
+ ExampleMatcher matcher = ExampleMatcher.matching()
|
|
|
|
+ .withMatcher("name",contains())
|
|
|
|
+ .withMatcher("creator",contains())
|
|
|
|
+ .withMatcher("orgId",exact())
|
|
.withIgnoreNullValues();
|
|
.withIgnoreNullValues();
|
|
return paperStructRepo.findAll(Example.of(paperStruct, matcher));
|
|
return paperStructRepo.findAll(Example.of(paperStruct, matcher));
|
|
}
|
|
}
|