fix: 信用卡账单新增最新交易时间字段。
This commit is contained in:
@@ -45,6 +45,10 @@ public class CreditCardBillVo extends CreditCardBill
|
|||||||
@ApiModelProperty(value="还款日)")
|
@ApiModelProperty(value="还款日)")
|
||||||
private int payDate;
|
private int payDate;
|
||||||
|
|
||||||
|
/** 最新交易时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date recentDealTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,70 +24,92 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="dailyExpensesCount" column="daily_expenses_count" />
|
<result property="dailyExpensesCount" column="daily_expenses_count" />
|
||||||
<result property="availableLimit" column="available_limit" />
|
<result property="availableLimit" column="available_limit" />
|
||||||
<result property="payDate" column="pay_date" />
|
<result property="payDate" column="pay_date" />
|
||||||
|
<result property="recentDealTime" column="recent_deal_time" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectCreditCardBillVo">
|
<sql id="selectCreditCardBillVo">
|
||||||
select
|
select
|
||||||
a.id,
|
a.id,
|
||||||
a.name,
|
a.name,
|
||||||
a.bill_date,
|
a.bill_date,
|
||||||
a.credit_card_id,
|
a.credit_card_id,
|
||||||
a.bill_date_period,
|
a.bill_date_period,
|
||||||
a.bill_amount,
|
a.bill_amount,
|
||||||
a.create_by,
|
a.create_by,
|
||||||
a.create_time,
|
a.create_time,
|
||||||
a.update_by,
|
a.update_by,
|
||||||
a.update_time,
|
a.update_time,
|
||||||
a.del_flag,
|
a.del_flag,
|
||||||
a.bill_state,
|
a.bill_state,
|
||||||
a.remark,
|
a.remark,
|
||||||
bc."name" as bank_name,
|
bc."name" as bank_name,
|
||||||
bc.pay_date,
|
bc.pay_date,
|
||||||
bc.code as bank_code,
|
bc.code as bank_code,
|
||||||
a2.available_limit,
|
a2.available_limit,
|
||||||
(
|
(
|
||||||
select
|
select
|
||||||
count(*)
|
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'
|
||||||
|
and adr.del_flag = '0'
|
||||||
|
) 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'
|
||||||
|
and adr.del_flag = '0'
|
||||||
|
) as daily_expenses_count,
|
||||||
|
(
|
||||||
|
select
|
||||||
|
create_time
|
||||||
|
from
|
||||||
|
accounts_deal_record adr
|
||||||
|
where
|
||||||
|
adr.account_id = a.credit_card_id
|
||||||
|
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.del_flag = '0'
|
||||||
|
order by
|
||||||
|
adr.create_time desc
|
||||||
|
limit 1
|
||||||
|
) as recent_deal_time
|
||||||
from
|
from
|
||||||
accounts_deal_record adr
|
credit_card_bill a
|
||||||
where
|
left join bank_card_lend bc on
|
||||||
adr.account_id = a.credit_card_id
|
bc.id = a.credit_card_id
|
||||||
and adr.deal_type = '2'
|
left join accounts a2 on
|
||||||
and to_char(adr.create_time,
|
a2.id = a.credit_card_id
|
||||||
'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'
|
|
||||||
and adr.del_flag='0'
|
|
||||||
) 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'
|
|
||||||
and adr.del_flag='0'
|
|
||||||
) as daily_expenses_count
|
|
||||||
from
|
|
||||||
credit_card_bill a
|
|
||||||
left join bank_card_lend bc on
|
|
||||||
bc.id = a.credit_card_id
|
|
||||||
left join accounts a2 on a2.id =a.credit_card_id
|
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectCreditCardBillList" parameterType="CreditCardBillDto" resultMap="CreditCardBillResult">
|
<select id="selectCreditCardBillList" parameterType="CreditCardBillDto" resultMap="CreditCardBillResult">
|
||||||
|
|||||||
Reference in New Issue
Block a user