Interface AppointmentRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<Appointment, Integer>, org.springframework.data.repository.Repository<Appointment, Integer>
public interface AppointmentRepository
extends org.springframework.data.repository.CrudRepository<Appointment, Integer>
Repository for appointment entities and custom queries.
-
Method Summary
Modifier and TypeMethodDescriptionfindAppointmentByBankerIdAndDataBetweenAndEsito(Integer idBanker, String startDate, String endDate, String esito) Finds appointments with optional banker, date range, and esito filters.intupdateAppointment(Integer appointmentId, Integer bankerId, Integer clientId, String data, String esito, String polizza, Integer premio, String note) Updates an appointment row via native SQL.Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findAll, findAllById, findById, save, saveAll
-
Method Details
-
updateAppointment
@Transactional @Modifying @Query(value="UPDATE APPOINTMENTS\nSET ID_BANKER = :bankerId,\n ID_CLIENTE = :clientId,\n DATA = :data,\n ESITO = :esito,\n POLIZZA = :polizza,\n PREMIO = :premio,\n NOTE = :note\nWHERE ID = :appointmentId\n", nativeQuery=true) int updateAppointment(Integer appointmentId, Integer bankerId, Integer clientId, String data, String esito, String polizza, Integer premio, String note) Updates an appointment row via native SQL. -
findAppointmentByBankerIdAndDataBetweenAndEsito
@Query(value="SELECT * FROM APPOINTMENTS a\nWHERE (:idBanker IS NULL OR a.id_banker = :idBanker)\n AND (:startDate IS NULL OR a.data >= :startDate)\n AND (:endDate IS NULL OR a.data <= :endDate)\n AND (:esito IS NULL OR a.esito = :esito)\n", nativeQuery=true) List<Appointment> findAppointmentByBankerIdAndDataBetweenAndEsito(Integer idBanker, String startDate, String endDate, String esito) Finds appointments with optional banker, date range, and esito filters.
-