package com.yihu.wlyy.repository.education;

import com.yihu.wlyy.entity.patient.PatientHealthRecordDiet;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.yihu.wlyy.entity.education.HealthEduArticle;

import java.util.Date;

public interface HealthEduArticleDao extends PagingAndSortingRepository<HealthEduArticle, Long>, JpaSpecificationExecutor<HealthEduArticle> {

	HealthEduArticle findByCode(String code);

	@Query("SELECT a FROM HealthEduArticle a WHERE (a.title like ?1 or a.keyword like ?2) ORDER BY a.czrq DESC")
	Page<HealthEduArticle> list(String title, String keyword, Pageable pageRequest);
}
