From f71d6745eed2bd85f9f52a1133083b6055e7104e Mon Sep 17 00:00:00 2001 From: qdintc Date: Fri, 13 Jun 2025 13:26:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=A1=E7=94=A8=E5=8D=A1=E8=B4=A6?= =?UTF-8?q?=E5=8D=95=E6=96=B0=E5=A2=9E=E6=9C=80=E6=96=B0=E4=BA=A4=E6=98=93?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=AD=97=E6=AE=B5=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../invest/domain/vo/CreditCardBillVo.java | 4 + .../mapper/invest/CreditCardBillMapper.xml | 140 ++++++++++-------- 2 files changed, 85 insertions(+), 59 deletions(-) diff --git a/intc-modules/intc-invest/src/main/java/com/intc/invest/domain/vo/CreditCardBillVo.java b/intc-modules/intc-invest/src/main/java/com/intc/invest/domain/vo/CreditCardBillVo.java index e0a89e2..562fa6b 100644 --- a/intc-modules/intc-invest/src/main/java/com/intc/invest/domain/vo/CreditCardBillVo.java +++ b/intc-modules/intc-invest/src/main/java/com/intc/invest/domain/vo/CreditCardBillVo.java @@ -45,6 +45,10 @@ public class CreditCardBillVo extends CreditCardBill @ApiModelProperty(value="还款日)") private int payDate; + /** 最新交易时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date recentDealTime; + } diff --git a/intc-modules/intc-invest/src/main/resources/mapper/invest/CreditCardBillMapper.xml b/intc-modules/intc-invest/src/main/resources/mapper/invest/CreditCardBillMapper.xml index a2cbdc7..a8412b8 100644 --- a/intc-modules/intc-invest/src/main/resources/mapper/invest/CreditCardBillMapper.xml +++ b/intc-modules/intc-invest/src/main/resources/mapper/invest/CreditCardBillMapper.xml @@ -24,70 +24,92 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + select - a.id, - a.name, - a.bill_date, - a.credit_card_id, - a.bill_date_period, - a.bill_amount, - a.create_by, - a.create_time, - a.update_by, - a.update_time, - a.del_flag, - a.bill_state, - a.remark, - bc."name" as bank_name, - bc.pay_date, - bc.code as bank_code, - a2.available_limit, - ( - select - count(*) + a.id, + a.name, + a.bill_date, + a.credit_card_id, + a.bill_date_period, + a.bill_amount, + a.create_by, + a.create_time, + a.update_by, + a.update_time, + a.del_flag, + a.bill_state, + a.remark, + bc."name" as bank_name, + bc.pay_date, + bc.code as bank_code, + a2.available_limit, + ( + 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' + 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 - 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 - 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 + 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