| | |
| | | */ |
| | | @Query(value = "SELECT SUM(after_tax_amount) AS totalAmount FROM contract_invoice WHERE contract_id = ?1",nativeQuery = true) |
| | | BigDecimal countTotalAmountByContractId(Long contractId); |
| | | |
| | | /** |
| | | * 根据合同ID删除 |
| | | * @param contractId |
| | | */ |
| | | void deleteByContractId(Long contractId); |
| | | } |
| | |
| | | */ |
| | | @Query(value = "SELECT SUM(payment_amount) AS totalAmount FROM contract_payment WHERE contract_id = ?1",nativeQuery = true) |
| | | BigDecimal countTotalAmountByContractId(Long contractId); |
| | | |
| | | /** |
| | | * 根据合同ID删除 |
| | | * @param contractId |
| | | */ |
| | | void deleteByContractId(Long contractId); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void deleteAll(Long[] ids) { |
| | | for (Long contractId : ids) { |
| | | contractRepository.deleteById(contractId); |
| | | contractInvoiceRepository.deleteByContractId(contractId); |
| | | contractPaymentRepository.deleteByContractId(contractId); |
| | | } |
| | | } |
| | | |