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

import com.ssj.bean.kmt.kmt.domain.KmtQuestion;
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 KmtQuestionDao extends JpaRepository<KmtQuestion, String>{
	
	@Query(nativeQuery = true, value = " SELECT * FROM `kmt_question` t where t.question =?1 LIMIT 1 ")
	public KmtQuestion findQuestionByTitle(String title);
	
	
	@Query(nativeQuery = true, value = " SELECT * FROM `kmt_question` t where t.adduser=?1 AND t.state=?2 ")
	public List<KmtQuestion> findQuestionByUserName(String name, String state);
	

}
