From 59af410cf8cfbfee99e5aa5e3afb20f70880e106 Mon Sep 17 00:00:00 2001 From: Alan <3052806735@qq.com> Date: Tue, 18 Jun 2024 10:51:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=9F=A5=E8=AF=A2=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../backend/service/impl/courses/CoursesServiceImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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);