fix: 信用卡账单,新增刷卡次数,日常支出次数。
This commit is contained in:
@@ -26,4 +26,11 @@ public class CreditCardBillVo extends CreditCardBill
|
||||
@Excel(name = "信用卡")
|
||||
private String bankNameCode;
|
||||
|
||||
@ApiModelProperty(value="Pos刷卡次数)")
|
||||
|
||||
private String posCount;
|
||||
|
||||
@ApiModelProperty(value="日常支出次数)")
|
||||
private String dailyExpensesCount;
|
||||
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="bankName" column="bank_name" />
|
||||
<result property="bankCode" column="bank_code" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="posCount" column="pos_count" />
|
||||
<result property="dailyExpensesCount" column="daily_expenses_count" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCreditCardBillVo">
|
||||
@@ -38,7 +40,45 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
a.bill_state,
|
||||
a.remark,
|
||||
bc."name" as bank_name,
|
||||
bc.code as bank_code
|
||||
bc.code as bank_code,
|
||||
(
|
||||
select
|
||||
count(*)
|
||||
from
|
||||
accounts_deal_record adr
|
||||
where
|
||||
adr.account_id = a.credit_card_id
|
||||
and adr.deal_type = '2'
|
||||
and to_char(adr.create_time,
|
||||
'yyyy-MM-dd')>=split_part(a.bill_date_period,
|
||||
'~',
|
||||
1)
|
||||
and split_part(a.bill_date_period,
|
||||
'~',
|
||||
2)>= to_char(adr.create_time,
|
||||
'yyyy-MM-dd')
|
||||
and adr.deal_category = '5'
|
||||
|
||||
) as pos_count,
|
||||
(
|
||||
select
|
||||
count(*)
|
||||
from
|
||||
accounts_deal_record adr
|
||||
where
|
||||
adr.account_id = a.credit_card_id
|
||||
and adr.deal_type = '2'
|
||||
and to_char(adr.create_time,
|
||||
'yyyy-MM-dd')>=split_part(a.bill_date_period,
|
||||
'~',
|
||||
1)
|
||||
and split_part(a.bill_date_period,
|
||||
'~',
|
||||
2)>= to_char(adr.create_time,
|
||||
'yyyy-MM-dd')
|
||||
and adr.deal_category = '1'
|
||||
|
||||
) as daily_expenses_count
|
||||
from
|
||||
credit_card_bill a
|
||||
left join bank_card_lend bc on
|
||||
|
||||
Reference in New Issue
Block a user