package com.cirle.scientific.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;

import com.cirle.scientific.po.QkjQuestionDetail;

@Repository
public interface QkjQuestionDetailDao extends PagingAndSortingRepository<QkjQuestionDetail, Long>, JpaSpecificationExecutor<QkjQuestionDetail> {
	
	@Query(value = "SELECT * FROM qkj_question_detail WHERE obj_type=?1 and obj_id=?2 and status=0 order by sqn desc",nativeQuery = true)
	List<QkjQuestionDetail> findByObjTypeAndObjId(Integer objType, Integer objId);

	@Query(value = "SELECT * FROM qkj_question_detail WHERE obj_type=?1 and obj_id=?2 and status=0 order by sqn asc",nativeQuery = true)
	List<QkjQuestionDetail> SelectByObjTypeAndObjId(Integer objType, Integer objId);
}
