package com.ssj.dao.sys.xb.dao;

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

import com.ssj.bean.sys.xb.domain.XbFeedback;

@Repository
public interface IXbFeedbackDao extends JpaRepository<XbFeedback, String> {

	@Query(nativeQuery = true, value = "select * from kmt_course_xb_feedback t where t.kmt_course_id = ?1 and t.course_name = ?2  limit 1")
	XbFeedback findByCourseIdAndCourseName(String courseId, String courseName);

	@Query(nativeQuery = true, value = "select * from kmt_course_xb_feedback t where t.kmt_course_id = ?1 and t.course_name = ?3 and t.feedback_index=?2  limit 1")
	XbFeedback findLastCourseInfo(String courseId, int feedbackIndex, String courseName);

}
