|
|
@@ -8,6 +8,7 @@ import org.springframework.data.jpa.repository.JpaRepository;
|
|
|
import org.springframework.data.jpa.repository.Query;
|
|
|
|
|
|
import java.util.Optional;
|
|
|
+import java.util.Set;
|
|
|
|
|
|
/**
|
|
|
* @author cst
|
|
|
@@ -31,7 +32,7 @@ public interface QuestionRecordDAO extends JpaRepository<QuestionRecord, Long> {
|
|
|
boolean existsByQuestionId(String questionId);
|
|
|
|
|
|
/**
|
|
|
- * 查询老师创建的题目
|
|
|
+ * 分页查询老师创建的题目ID
|
|
|
*
|
|
|
* @param teacher
|
|
|
* @param pageable
|
|
|
@@ -39,4 +40,13 @@ public interface QuestionRecordDAO extends JpaRepository<QuestionRecord, Long> {
|
|
|
*/
|
|
|
@Query("select record.questionId from QuestionRecord record where record.teacher=?1")
|
|
|
Page<String> findQuestionIdsByTeacher(User teacher, Pageable pageable);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询老师创建的题目id
|
|
|
+ *
|
|
|
+ * @param teacher
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Query("select record.questionId from QuestionRecord record where record.teacher=?1")
|
|
|
+ Set<String> findQuestionIdsByTeacher(User teacher);
|
|
|
}
|