package com.yihu.jw.complaint;

import com.yihu.jw.entity.base.complaint.BaseComplaintDictDO;
import com.yihu.jw.entity.base.complaint.BaseComplaintDoctorDO;
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 BaseComplaintDoctorDao extends PagingAndSortingRepository<BaseComplaintDoctorDO, String>, JpaSpecificationExecutor<BaseComplaintDoctorDO> {
    @Query("from BaseComplaintDoctorDO t where t.isDel='1' and t.id=?1")
    BaseComplaintDoctorDO findByDelAndId(String id);
    @Query("from BaseComplaintDoctorDO t where t.isDel='1' and t.doctor=?1")
    BaseComplaintDoctorDO findbyDoctorAndDel(String doctor);

    @Query("from BaseComplaintDoctorDO t where t.isDel='1' and t.doctor=?1 and t.complaintId=?2")
    BaseComplaintDoctorDO findbyDoctorAndDelAndType(String doctor,String complaintType);


    @Query("from BaseComplaintDoctorDO t where t.isDel='1' and t.complaintId=?1")
    List<BaseComplaintDoctorDO> findbyComplaintId(String complaintId);
}
