package com.yihu.jw.hospital.survey.dao;

import com.yihu.jw.entity.hospital.survey.WlyySurveyUserDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.Date;
import java.util.List;

/**
 * Created by Trick on 2019/9/6.
 */
public interface SurveyUserDao extends PagingAndSortingRepository<WlyySurveyUserDO, String>, JpaSpecificationExecutor<WlyySurveyUserDO> {

    List<WlyySurveyUserDO> findBySurveyTempCodeAndStatus(String surveyTempCode,Integer status);

    @Query("from WlyySurveyUserDO c WHERE c.surveyTempCode = ?1 and c.patient =?2 and c.status =1 ")
    List<WlyySurveyUserDO> findBySurvey(String surveyTempCode,String patient);
}
