package com.ssj.dao.course.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import com.ssj.bean.course.domain.CourseDetailFeedbackLib;


@Repository
public interface ICourseLibFeedbackDao extends JpaRepository<CourseDetailFeedbackLib,String> {

	@Query(nativeQuery=true,value="select * from tb_course_lib_feedback where course_details_id=?1 and lib_id=?2 and to_days(open_time)=to_days(now()) order by create_time desc limit 1")
	CourseDetailFeedbackLib findTodayVOByAnyParams(String courseDetailId, String libId);
	
	@Query(nativeQuery=true,value="SELECT * from tb_course_lib_feedback b where b.lib_id=?1 AND b.course_details_id=?2 LIMIT 1 ")
	CourseDetailFeedbackLib getCourseDetailFeedbackLibByTeacherId(String libId, String courseDetailsId);
	

}
