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

import com.ssj.bean.kmt.kmt.domain.KmtImgFace;
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 KmtImgFaceDao  extends JpaRepository<KmtImgFace, String>{

	@Query(nativeQuery = true, value = " SELECT * from kmt_img_face t where t.teacher_id=?1 ORDER BY t.create_time DESC LIMIT ?2,?3")
	List<KmtImgFace> findImgFaceByTId(String teacherId, Integer pageNo, Integer pageSize);
	
	
	@Query(nativeQuery = true, value = " SELECT * from kmt_img_face t where t.teacher_id=?1 AND t.student_id=?2  ORDER BY t.course_time DESC LIMIT 1 ")
	KmtImgFace findImgFaceByTAndSId(String teacherId, String vipId);

	@Query(nativeQuery = true, value = " SELECT * from kmt_img_face t where t.course_id=?1 LIMIT 1 ")
	KmtImgFace findByCourseId(String courseId);

}
