package com.yihu.jw.patient.dao;

import com.yihu.jw.entity.patient.BasePatientGroupDO;
import com.yihu.jw.entity.patient.BasePatientGroupDictDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

public interface BasePatientGroupDao extends PagingAndSortingRepository<BasePatientGroupDO, String>, JpaSpecificationExecutor<BasePatientGroupDO> {
    @Query("from BasePatientGroupDO t where t.doctor=?1 and t.patient=?2 and t.groupId=?3")
    BasePatientGroupDO findOneGroupByDoctorAndPatientAndGroupId(String doctor,String patient,String groupId);
    @Query("select count(1) from BasePatientGroupDO t where t.doctor=?1  and t.groupId=?2")
    int getCountByDoctor(String doctor,String dictId);
}
