保誠-保戶業務員媒合平台
wayne
2022-02-08 463ba2f5b7e5ae094c33b1692a74b7f7aa58aad5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package com.pollex.pam.repository;
 
import java.util.List;
import java.util.Optional;
 
import com.pollex.pam.enums.AppointmentStatusEnum;
import com.pollex.pam.enums.ContactStatusEnum;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
 
import com.pollex.pam.domain.Appointment;
 
@Repository
public interface AppointmentRepository extends JpaRepository<Appointment, Long>{
 
    List<Appointment> findByAgentNo(String agentNo);
 
    List<Appointment> findByAgentNoAndCustomerId(String agentNo, Long customerId);
 
    Optional<Appointment> findTopByAgentNoAndCustomerIdOrderByAppointmentDateDesc(String agentNo, Long customerId);
 
    List<Appointment> findAllByCommunicateStatusAndStatus(ContactStatusEnum contactStatus, AppointmentStatusEnum status);
}