package com.ssj.dao.sys.problem.dao;

import com.ssj.bean.sys.problem.domain.BanbenDetail;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

@Repository
public interface IBanbenDetalDao extends JpaRepository<BanbenDetail,String> {
    @Query(nativeQuery = true,value = "select * from sys_cn_school_detail where course_name=?1 and school_id=?2 and grade=?3 limit 1")
    BanbenDetail findBanbenByAnyParams(String courseName, String schoolId, String grade);

    @Query(nativeQuery = true,value = "select * from sys_cn_school_detail where course_name=?1 and school_name=?2 and grade=?3 and area=?4 limit 1")
    BanbenDetail findBanbenByParams(String courseName, String schoolName, String grade,String area);

    @Query(nativeQuery = true,value = "select * from sys_cn_school_detail where course_name=?1 and school_name=?2 and grade=?3  limit 1")
    BanbenDetail findBanbenByParams(String courseName, String schoolName, String grade);
}
