/*******************************************************************************
 * Copyright (c) 2005, 2014 springside.github.io
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
package com.yihu.wlyy.repository.followup;

import com.yihu.wlyy.entity.followup.FollowupContent;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

public interface FollowupContentDao extends PagingAndSortingRepository<FollowupContent, Long>, JpaSpecificationExecutor<FollowupContent> {

    @Query("select distinct a.followupProject from FollowupContent a where a.followupId=?1")
    List<String> findProjectByFollowupId(Long followupId) throws Exception;

    List<FollowupContent> findByFollowupIdAndFollowupProject(Long followupId,String followupProject);

    List<FollowupContent> findByFollowupId(Long followupId);
}
