package com.ssj.dao.sys.teacher.dao;

import com.ssj.bean.sys.teacher.domain.ApplyTeacher;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

@Repository
public interface IApplyTeacherDao extends JpaRepository<ApplyTeacher, String> {

	@Query(value="select * from tb_one_apply_teacher where user_id = ?1  order by create_time desc limit 1",nativeQuery=true)
	ApplyTeacher findTeacherByUserId(String userId);

	Page<ApplyTeacher> findAll(Specification<ApplyTeacher> specification, Pageable initPage);

}
