package com.yihu.wlyy.repository.education;

import com.yihu.wlyy.entity.education.HealthEduArticleOpHistory;
import com.yihu.wlyy.entity.education.HealthEduArticlePatient;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

public interface HealthEduArticleOpHistoryDao extends PagingAndSortingRepository<HealthEduArticleOpHistory, Long>, JpaSpecificationExecutor<HealthEduArticleOpHistory> {

	@Query("select count(1) from HealthEduArticleOpHistory a where a.code = ?1 and a.status = ?2")
	int countByCodeStatus(String code,String status);
	@Query("select count(1) from HealthEduArticleOpHistory a where a.creater = ?1 and a.status = ?2")
	int countByUserStatus(String user,String status);

	int deleteByCodeAndStatusAndCreater(String code,String status,String creater);
}
