WithdrawRepo.java 681 B

12345678910111213141516171819
  1. package com.izouma.jiashanxia.repo;
  2. import com.izouma.jiashanxia.domain.Withdraw;
  3. import org.springframework.data.jpa.repository.JpaRepository;
  4. import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
  5. import org.springframework.data.jpa.repository.Modifying;
  6. import org.springframework.data.jpa.repository.Query;
  7. import javax.transaction.Transactional;
  8. import java.util.List;
  9. public interface WithdrawRepo extends JpaRepository<Withdraw, Long>, JpaSpecificationExecutor<Withdraw> {
  10. @Query("update Withdraw t set t.del = true where t.id = ?1")
  11. @Modifying
  12. @Transactional
  13. void softDelete(Long id);
  14. List<Withdraw> findAllByUserId(Long userId);
  15. }