瀏覽代碼

新增按代码或名称查询课程接口

宋悦 7 年之前
父節點
當前提交
7d1a2cf8e8
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      core-domain/src/main/java/cn/com/qmth/examcloud/service/core/repo/CourseRepo.java

+ 1 - 1
core-domain/src/main/java/cn/com/qmth/examcloud/service/core/repo/CourseRepo.java

@@ -17,7 +17,7 @@ public interface CourseRepo extends JpaRepository<Course, Long>,QueryByExampleEx
 	
 	List<Course> findByIdNotIn(List<Long> ids);
 
-	@Query("select t from Course t where t.orgId = ?1 and (t.code like '%?2%' or t.name like '%?2%') and t.enable = true")
+	@Query("select t from Course t where t.orgId = ?1 and (t.code like ?2 or t.name like ?2) and t.enable = true")
 	List<Course> findByCodeName(Long orgId,String codeName);
 
 }