Browse Source

修改查询条件

宋悦 7 năm trước cách đây
mục cha
commit
987b0b4725

+ 3 - 2
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/ExamCourseService.java

@@ -2,6 +2,7 @@ package cn.com.qmth.examcloud.service.examwork.service;
 
 import cn.com.qmth.examcloud.service.examwork.criteria.ExamCourseCriteria;
 import cn.com.qmth.examcloud.service.examwork.dto.ExamCourseDTO;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.PageImpl;
@@ -66,10 +67,10 @@ public class ExamCourseService {
         if(examCourseCriteria.getExamId() != null){
             criteriaSql.append(" and exam_id ="+examCourseCriteria.getExamId());
         }
-        if(examCourseCriteria.getCourseCode() != null){
+        if(!StringUtils.isEmpty(examCourseCriteria.getCourseCode())){
             criteriaSql.append(" and course_code ='"+examCourseCriteria.getCourseCode()+"'");
         }
-        if(examCourseCriteria.getCourseLevel() != null){
+        if(!StringUtils.isEmpty(examCourseCriteria.getCourseLevel())){
             criteriaSql.append(" and course_level ='"+examCourseCriteria.getCourseLevel()+"'");
         }
         criteriaSql.append(" and exists (select 1 from ecs_core_course tc where tc.org_id = ts.root_org_id" +