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

import com.ssj.bean.kmt.kmt.domain.KmtCourseKnowDetail;
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 KmtCourseKnowDetailDao  extends JpaRepository<KmtCourseKnowDetail, String> {
    /**
     * 查询讲义的知识点顺序列表
     * @param courseKnowId
     * @return
     */
    @Query(nativeQuery = true, value = "select t1.* from kmt_course_know_detail t1 left join zyb_know_how_details_sort t2 on t1.know_id=t2.how_details_id and t2.stat=2 \n" +
            "where course_know_id=?1 order by t2.num")
    List<KmtCourseKnowDetail> findByCourseKnowId(String courseKnowId);
}
