package com.yihu.jw.doctor.dao;

import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorMessageDO;
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 org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 *
 *
 * </pre>
 * @since 1.
 */
@Transactional
public interface BaseDoctorMessageDao extends PagingAndSortingRepository<BaseDoctorMessageDO, String>, JpaSpecificationExecutor<BaseDoctorMessageDO>  {
    @Query("from BaseDoctorMessageDO d where  d.del ='1' and d.doctor=?1 ")
    List<BaseDoctorMessageDO> findByDoctorAndDel(String doctor,Pageable pageRequest);


    @Query("from BaseDoctorMessageDO d where  d.del ='1' and d.id=?1 ")
    BaseDoctorMessageDO findByIdAndDel(String id);


}
