package com.ssj.dao.sys.train.dao;

import java.util.List;

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

import com.ssj.bean.sys.train.bean.VideoUser;


@Repository
public interface VideoUserDao extends JpaRepository<VideoUser, String> {

	@Query(nativeQuery = true,value =  " SELECT * from tr_video_user t WHERE t.`status`=1 AND t.role_type=?1 AND t.user_id=?2  ORDER BY t.create_time asc  ")
	public List<VideoUser> findVideoUserByUserIdAndRoleType(Integer roleType,String userId);
	
	@Query(nativeQuery = true,value =  " SELECT * from tr_video_user t WHERE t.`status`=1 AND t.video_id=?1 AND t.user_id=?2  ORDER BY t.create_time asc  ")
	public List<VideoUser> findVideoUserByUserIdAndVideoId(String videoId, String userId);

}
