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.CourseReadHis;

@Repository
public interface ICourseReadHisDao extends JpaRepository<CourseReadHis, String> {

	@Query(nativeQuery=true,value="select * from course_read_his where user_id=?1 and lib_id=?2 and course_detail_id=?3 and online_type=?4 and state=?5 order by open_time desc limit 1")
	CourseReadHis findOneData(String userId, String libId, String courseDetailId, String onlineType, int state);

}
