package com.ssj.dao.weixin.story.dao;

import com.ssj.bean.weixin.story.bean.StoryPraise;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;


/** 
 * @author  ZhangCaibao 
 * @version 2017年8月7日 下午5:26:00 
 * 类说明 
 */
public interface StoryPraiseDao extends JpaRepository<StoryPraise, String>{

	public  StoryPraise  findByObjectIdAndStatAndUserId(String objectId,String stat,String userId);
	
	public List<StoryPraise> findByStat(String stat) ;
	
	
	@Query(nativeQuery = true, value ="  SELECT   count(1)  from  tb_story_praise  where  stat =?1 and   user_id = ?2 ")
	public Integer getStatAndUserId(String stat,String userId);
}
