ContractRepaymentRepository.java 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. package com.loan.system.repository;
  2. import com.loan.system.domain.entity.ApprovalRecord;
  3. import com.loan.system.domain.entity.ContractRepayment;
  4. import org.springframework.data.jpa.repository.JpaRepository;
  5. import org.springframework.data.jpa.repository.Modifying;
  6. import org.springframework.data.jpa.repository.Query;
  7. import org.springframework.transaction.annotation.Transactional;
  8. import java.util.List;
  9. /**
  10. * @author EdwinXu
  11. * @date 2020/9/2 - 15:35
  12. * @Description
  13. */
  14. public interface ContractRepaymentRepository extends JpaRepository<ContractRepayment,Long> {
  15. @Query("select c.id from ContractRepayment c where c.repaymentRecordId = ?1 and c.isDelete = ?2")
  16. List<Long> findByRepaymentRecordIdAndIsDelete(Long recordId, boolean b);
  17. @Modifying
  18. @Transactional
  19. @Query("update ContractRepayment c set c.isDelete = true where c.id in ?1")
  20. void deleteByIds(List<Long> ids);
  21. @Query("select c from ContractRepayment c where c.repaymentRecordId in ?1 and c.isDelete = ?2")
  22. List<ContractRepayment> findByRepaymentRecordIdsAndIsDelete(List<Long> recordIds, boolean b);
  23. @Query("select c from ContractRepayment c where c.contractId = ?1 and c.isDelete = ?2")
  24. List<ContractRepayment> findByContractIdAndIsDelete(Long id, boolean b);
  25. @Query("select c from ContractRepayment c where c.repaymentRecordId = ?1 and c.isDelete = ?2")
  26. List<ContractRepayment> findDataByRepaymentRecordIdAndIsDelete(Long recordId, boolean b);
  27. }