From fd00261a7a594945416ef087ab87d275825973ad Mon Sep 17 00:00:00 2001 From: Gary Date: Wed, 21 Feb 2024 18:02:33 +0800 Subject: [PATCH] 1.remove journal no condition in song fuzzy search --- .../main/java/com/luoo/music/service/JournalSongService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/luoo_music/src/main/java/com/luoo/music/service/JournalSongService.java b/luoo_music/src/main/java/com/luoo/music/service/JournalSongService.java index 793670f..e80889b 100644 --- a/luoo_music/src/main/java/com/luoo/music/service/JournalSongService.java +++ b/luoo_music/src/main/java/com/luoo/music/service/JournalSongService.java @@ -162,6 +162,7 @@ public class JournalSongService { Specification specification = fuzzySpecification(keyword); return journalSongDao.findAll(specification,pageRequest).getContent(); } + private Specification fuzzySpecification(String keyword) { return new Specification() { 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("artist").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"))); return criteriaBuilder.or(predicateList.toArray(new Predicate[predicateList.size()])); }