|
|
@ -162,6 +162,7 @@ public class JournalSongService {
|
|
|
|
Specification<JournalSong> specification = fuzzySpecification(keyword);
|
|
|
|
Specification<JournalSong> specification = fuzzySpecification(keyword);
|
|
|
|
return journalSongDao.findAll(specification,pageRequest).getContent();
|
|
|
|
return journalSongDao.findAll(specification,pageRequest).getContent();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private Specification<JournalSong> fuzzySpecification(String keyword) {
|
|
|
|
private Specification<JournalSong> fuzzySpecification(String keyword) {
|
|
|
|
return new Specification<JournalSong>() {
|
|
|
|
return new Specification<JournalSong>() {
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
@ -171,7 +172,7 @@ public class JournalSongService {
|
|
|
|
predicateList.add(criteriaBuilder.like(root.get("name").as(String.class),"%"+keyword+"%"));
|
|
|
|
predicateList.add(criteriaBuilder.like(root.get("name").as(String.class),"%"+keyword+"%"));
|
|
|
|
predicateList.add(criteriaBuilder.like(root.get("artist").as(String.class),"%"+keyword+"%"));
|
|
|
|
predicateList.add(criteriaBuilder.like(root.get("artist").as(String.class),"%"+keyword+"%"));
|
|
|
|
predicateList.add(criteriaBuilder.like(root.get("album").as(String.class),"%"+keyword+"%"));
|
|
|
|
predicateList.add(criteriaBuilder.like(root.get("album").as(String.class),"%"+keyword+"%"));
|
|
|
|
predicateList.add(criteriaBuilder.like(root.get("journalNo").as(String.class),"%"+keyword+"%"));
|
|
|
|
//predicateList.add(criteriaBuilder.like(root.get("journalNo").as(String.class),"%"+keyword+"%"));
|
|
|
|
query.orderBy(criteriaBuilder.asc(root.get("name")));
|
|
|
|
query.orderBy(criteriaBuilder.asc(root.get("name")));
|
|
|
|
return criteriaBuilder.or(predicateList.toArray(new Predicate[predicateList.size()]));
|
|
|
|
return criteriaBuilder.or(predicateList.toArray(new Predicate[predicateList.size()]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|