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.QkjColumnistDetail;


@Repository
public interface QkjColumnistDetailDao extends PagingAndSortingRepository<QkjColumnistDetail, Long>, JpaSpecificationExecutor<QkjColumnistDetail> {
	
	@Query(value = "select mpr.* from qkj_columnist_detail mpr where mpr.obj_type=?1 and mpr.obj_id=?2 ", nativeQuery = true)
	List<QkjColumnistDetail> findByobjTypeAndobjId(Integer objType, long objId);
	
	@Query(value = "select mpr.obj_id from qkj_columnist_detail mpr where mpr.obj_type=?1 and mpr.mem_card in ?2", nativeQuery = true)
	List<Integer> findByobjTypeAndMemCard(Integer objType, List<String> memCards);


	@Query(value = "select * from qkj_columnist_detail where obj_type=?1 and obj_id=?2", nativeQuery = true)
	List<QkjColumnistDetail> findByobjTypeAndobjIdAuthor(Integer objType, long objId);
}
