package com.ssj.dao.sys.opentest;

import com.ssj.bean.sys.opentest.OpenTestTemplate;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

/**
 * @author Mount Liu
 * @date 2020/2/12
 */
@Repository
public interface OpenTestTemplateDao extends JpaRepository<OpenTestTemplate, String> {

    @Query(nativeQuery = true, value = "select * from tb_test_template where module =?1 and right_num regexp ?2 and subject=?3 and grade=?4 and version=?5")
    OpenTestTemplate findTemplate(String module, String rightNum, String subject, String grade, String version);

    @Query(nativeQuery = true, value = "select * from tb_test_template where module =?1 and right_num regexp ?2 and subject=?3 and grade=?4")
    OpenTestTemplate findTemplate(String module, String rightNum, String subject, String grade);

}
