| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- package com.loan.system.repository;
- import com.loan.system.domain.entity.ApprovalRecord;
- import com.loan.system.domain.entity.ContractRepayment;
- import org.springframework.data.jpa.repository.JpaRepository;
- import org.springframework.data.jpa.repository.Modifying;
- import org.springframework.data.jpa.repository.Query;
- import org.springframework.transaction.annotation.Transactional;
- import java.util.List;
- /**
- * @author EdwinXu
- * @date 2020/9/2 - 15:35
- * @Description
- */
- public interface ContractRepaymentRepository extends JpaRepository<ContractRepayment,Long> {
- @Query("select c.id from ContractRepayment c where c.repaymentRecordId = ?1 and c.isDelete = ?2")
- List<Long> findByRepaymentRecordIdAndIsDelete(Long recordId, boolean b);
- @Modifying
- @Transactional
- @Query("update ContractRepayment c set c.isDelete = true where c.id in ?1")
- void deleteByIds(List<Long> ids);
- @Query("select c from ContractRepayment c where c.repaymentRecordId in ?1 and c.isDelete = ?2")
- List<ContractRepayment> findByRepaymentRecordIdsAndIsDelete(List<Long> recordIds, boolean b);
- @Query("select c from ContractRepayment c where c.contractId = ?1 and c.isDelete = ?2")
- List<ContractRepayment> findByContractIdAndIsDelete(Long id, boolean b);
- @Query("select c from ContractRepayment c where c.repaymentRecordId = ?1 and c.isDelete = ?2")
- List<ContractRepayment> findDataByRepaymentRecordIdAndIsDelete(Long recordId, boolean b);
- @Query("select c.contractId from ContractRepayment c where c.repaymentRecordId = ?1 and c.isDelete = ?2 order by c.createTime asc")
- List<Long> findContractIdsByRepaymentId(Long recordId, boolean b);
- @Modifying
- @Transactional
- @Query("update ContractRepayment c set c.amount = ?1 where c.contractId = ?2 and c.repaymentRecordId = ?3")
- void updateAmountByRecordIdAndContractId(Double amount, Long contractId, Long recordId);
- }
|