@RepositorypublicinterfaceParticipantRepositoryextendsJpaRepository<Participant,Long>{ List<Participant>getByAppointmentId(Long appointmentId);intdeleteByAppointmentId(Long appointmentId); ParticipantgetById(Long id); List<Participant>getByUserId(String userId);/** * 根据appointmentids删除一组数据 * @param appointmentIds */@Transactional@Modifying@Query(nativeQuery=true,value="delete from participant where appointment_id in :appointmentIds")voiddeleteByAppointmentIds(@Param("appointmentIds") List<Long> appointmentIds);}
上一个:java实现机械表