diff --git a/src/main/java/com/teaching/backend/service/impl/courses/CoursesServiceImpl.java b/src/main/java/com/teaching/backend/service/impl/courses/CoursesServiceImpl.java index 9a2d9ab..f5157b6 100644 --- a/src/main/java/com/teaching/backend/service/impl/courses/CoursesServiceImpl.java +++ b/src/main/java/com/teaching/backend/service/impl/courses/CoursesServiceImpl.java @@ -186,10 +186,10 @@ public class CoursesServiceImpl extends ServiceImpl impl private PageDTO queryForAdmin(CourseQuery courseQuery) { Page page = courseQuery.toMpPageDefaultSortByCreateTime(); Page p = lambdaQuery() - .like(courseQuery.getName() != null, Courses::getName, courseQuery.getName()) - .eq(courseQuery.getCategory() != null, Courses::getCategory, courseQuery.getCategory()) - .eq(courseQuery.getNature() != null, Courses::getNature, courseQuery.getNature()) - .eq(courseQuery.getAssessmenttype() != null, Courses::getAssessmenttype, courseQuery.getAssessmenttype()) + .like(courseQuery.getName() != null && !courseQuery.getName().isEmpty(), Courses::getName, courseQuery.getName()) + .eq(courseQuery.getCategory() != null && !courseQuery.getCategory().isEmpty(), Courses::getCategory, courseQuery.getCategory()) + .eq(courseQuery.getNature() != null && !courseQuery.getNature().isEmpty(), Courses::getNature, courseQuery.getNature()) + .eq(courseQuery.getAssessmenttype() != null &&!courseQuery.getAssessmenttype().isEmpty(), Courses::getAssessmenttype, courseQuery.getAssessmenttype()) .apply(courseQuery.getTeacher() != null && !courseQuery.getTeacher().isEmpty(), "FIND_IN_SET({0}, teacher)", courseQuery.getTeacher()) .page(page); return PageDTO.of(p, CoursesVO.class);