package com.cirle.scientific.dao;

import com.cirle.scientific.po.QkjTqcourseCourse;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

public interface QkjTqcourseCourseDao extends PagingAndSortingRepository<QkjTqcourseCourse, Long>, JpaSpecificationExecutor<QkjTqcourseCourse> {



    @Query(value = "select * from qkj_tqcourse_course where status = 1 and tqcourse_id = ?1 order by sort_num desc",nativeQuery = true)
    List<QkjTqcourseCourse> findCourseCourse(Integer zqId);


    @Query(value = "select id from qkj_tqcourse_course where status = 1 and tqcourse_id = ?1 order by sort_num desc",nativeQuery = true)
    List<Long> findCourseCourseIds(Integer zqId);
}
