package com.ywt.outpatient.domain.entity.center;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface DoctorFixedPointRepository extends JpaRepository<DoctorFixedPoint, Integer>, JpaSpecificationExecutor<DoctorFixedPoint> {

    /**
     * 获取正在使用的医生定点医院
     *
     * @param doctorId 医生ID
     * @param status 状态，0-正常，1-禁用
     * @return 定点医院列表
     */
    @Query(value = "select * from doctor_fixed_point where doctor_id = ? and status = ? and is_deleted = 0;", nativeQuery = true)
    List<DoctorFixedPoint> getFixedPointListByDoctorId(int doctorId, int status);
}