| | |
| | | */ |
| | | package me.zhengjie.modules.contract.repository; |
| | | |
| | | import me.zhengjie.modules.assetManagement.domain.AssetManagement; |
| | | import me.zhengjie.modules.contract.domain.ContractPayment; |
| | | import org.springframework.data.jpa.repository.JpaRepository; |
| | | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| | |
| | | */ |
| | | @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); |
| | | |
| | | /** |
| | | * 根据公司和日期查询 |
| | | * @return |
| | | */ |
| | | @Query(value = "SELECT * FROM `contract_payment` WHERE payment_time like %?% and company_id = ? and payment_type = ?",nativeQuery = true) |
| | | List<ContractPayment> findByDateAndCompany(String buyDate, Long companyId, String assetsType); |
| | | |
| | | /** |
| | | * 统计合同付款(收/支)总额 |
| | | * @param contractId |
| | | * @param paymentType |
| | | * @return |
| | | */ |
| | | @Query(value = "SELECT SUM(payment_amount) AS totalAmount FROM contract_payment WHERE contract_id = ?1 AND payment_type = ?2",nativeQuery = true) |
| | | BigDecimal sumPaymentAmountByContractIdAndPaymentType(Long contractId, String paymentType); |
| | | } |