package com.yihu.jw.base.dao.doctor;

import com.yihu.jw.entity.base.doctor.BaseDoctorIncentiveDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.domain.Pageable;
import java.util.List;

public interface BaseDoctorIncentiveDao extends PagingAndSortingRepository<BaseDoctorIncentiveDO, String>, JpaSpecificationExecutor<BaseDoctorIncentiveDO> {
    @Query("from BaseDoctorIncentiveDO where doctorCode = ?1 and isDel = '1'")
    List<BaseDoctorIncentiveDO> findByDoctorCode(String doctorCode);


    @Query("from BaseDoctorIncentiveDO where doctorCode = ?1 and incentiveId = ?2 and isDel = '1'")
    List<BaseDoctorIncentiveDO> findByDoctorCodeAndIncentiveId(String doctorCode,String incentiveId);

    @Query("from BaseDoctorIncentiveDO where doctorCode = ?1 and incentiveId = ?2 and isDel =?3")
    BaseDoctorIncentiveDO findByDoctorCodeAndIncentiveIdAndIsDel(String doctorCode,String incentiveId,String isDel);


    @Query("from BaseDoctorIncentiveDO where doctorCode = ?1 and isDel = '1'")
    List<BaseDoctorIncentiveDO> findByDoctorCodeList(String doctorCode, Pageable pageable);
    @Query("from BaseDoctorIncentiveDO where doctorCode = ?1 and isDel = '1'")
    List<BaseDoctorIncentiveDO> findByDoctorCodeListCount(String doctorCode);

}
