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 CheckupBookingOrderRepository extends JpaRepository<CheckupBookingOrder, Integer>, JpaSpecificationExecutor<CheckupBookingOrder> {

    @Query(value = "select * from checkup_booking_order where reg_id = ? and hospital_id = ?  limit 1;", nativeQuery = true)
    CheckupBookingOrder findByRegId(String regId, int hospitalId);

    @Query(value = "select * from checkup_booking_order where id_card = ? and hospital_id = ?;", nativeQuery = true)
    List<CheckupBookingOrder> findByIdNo(String idCard, int hospitalId);
}