fix: 账户总览新增接口。

This commit is contained in:
tianyongbao
2024-05-06 13:19:18 +08:00
parent d51f460360
commit b2955206d7
4 changed files with 101 additions and 8 deletions

View File

@@ -30,6 +30,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="bankCode" column="bank_code" />
<result property="repaymentDate" column="repayment_date" />
<result property="calculateInterestRate" column="calculate_interest_rate" />
<result property="outstandingInterest" column="outstanding_interest" />
<result property="outstandingPrincipal" column="outstanding_principal" />
</resultMap>
<sql id="selectInstallmentHistoryVo">
@@ -53,10 +55,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
installment_history_detail ihd
where
ihd.installment_history_id = a.id
and ihd .posting_state = '0'
and ihd.posting_state = '0'
and ihd.del_flag='0'
) as balance,
(
select
CASE
WHEN sum(ihd.interest) is null THEN 0
ELSE sum(ihd.interest)
END
from
installment_history_detail ihd
where
ihd.installment_history_id = a.id
and ihd.posting_state = '0'
and ihd.del_flag='0'
) as outstanding_interest,
(
select
CASE
WHEN sum(ihd.principal) is null THEN 0
ELSE sum(ihd.principal)
END
from
installment_history_detail ihd
where
ihd.installment_history_id = a.id
and ihd.posting_state = '0'
and ihd.del_flag='0'
) as outstanding_principal,
(
select
min(d.repayment_date)
from
installment_history_detail d