package com.ssj.dao.kmt.kmt.dao;

import com.ssj.bean.kmt.kmt.domain.KmtCourseQuestionDetail;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface KmtCourseQuestionDetailDao extends JpaRepository<KmtCourseQuestionDetail, String>{
	
	@Query(nativeQuery = true, value = "  SELECT * FROM `kmt_course_question_detail` t where t.course_know_id=?1 and t.mark=?2  LIMIT 1   ")
	public KmtCourseQuestionDetail findCourseQuestionDetail(String courseKnowId, Integer mark);

	/**
	 * 查询讲义的所有题目
	 * @param courseKnowId
	 * @return
	 */
	public List<KmtCourseQuestionDetail> findByCourseKnowIdOrderByMark(String courseKnowId);
}
