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

import com.ssj.bean.kmt.kmt.domain.KmtCourseKnowKdDetail;
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 KmtCourseKnowKdDetailDao  extends JpaRepository<KmtCourseKnowKdDetail, String> {
    /**
     * 查询讲义的考点顺序列表
     * @param courseKnowId
     * @return
     */
    @Query(nativeQuery = true, value = "select t1.* from kmt_course_know_kd_detail t1 left join zyb_know_how_details_kd t2 on t1.how_details_kd_id=t2.id \n" +
            "where course_know_id=?1 order by t1.know_id, t2.num")
    List<KmtCourseKnowKdDetail> findByCourseKnowId(String courseKnowId);
}