feat: 智聪记账管理,新增储蓄卡开卡统计功能代码提交。

This commit is contained in:
tianyongbao
2025-03-05 09:36:28 +08:00
parent ba23989d59
commit 67b9ea5023
8 changed files with 315 additions and 3 deletions

View File

@@ -77,10 +77,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="lendType != null and lendType != ''"> and a.lend_type = #{lendType}</if>
<if test="status != null and status != ''"> and a.status = #{status}</if>
<if test="repayFlag != null and repayFlag != ''"> and a.debit_type in('1','2','3')</if>
<if test="staticFlag != null and staticFlag != ''"> and ( a.debit_type in('1','2') and a.status!='2') </if>
<if test="startMonth!=null and startMonth !=''">
and to_char(a.activation_date, 'yyyy-MM')>=#{startMonth}
</if>
<if test="endMonth!=null and endMonth !=''">
and #{endMonth}>=to_char(a.activation_date, 'yyyy-MM')
</if>
</where>
<!-- 数据范围过滤 -->
${params.dataScope}
order by a.type asc, a.bill_date asc,a.debit_type asc,a.update_time desc
<if test="staticFlag != null and staticFlag != ''">
order by a.activation_date desc
</if>
<if test="staticFlag == null or staticFlag == ''">
order by a.type asc, a.bill_date asc,a.debit_type asc,a.update_time desc
</if>
</select>
<select id="selectBankCardLendById" parameterType="Long" resultMap="BankCardLendResult">

View File

@@ -894,5 +894,101 @@
order by t.recent_deal_time asc
</select>
<select id="selectOpenCardList" resultType="com.intc.invest.domain.vo.OpenCardVo">
select
t.count,
t.name,
t.type,
t.create_by as createBy
from
(
select
count(*) as count,
bcl.create_by,
'近一月开卡' as name ,
'0' as type
from
bank_card_lend bcl
where
bcl."type" = '1'
and (bcl.debit_type = '1'
or bcl.debit_type = '2')
and bcl.del_flag = '0'
and bcl.status!='2'
and bcl.activation_date >= CURRENT_DATE - interval '1 months'
group by
bcl.create_by
union
select
count(*) as count,
bcl.create_by,
'近三月开卡' as name ,
'1' as type
from
bank_card_lend bcl
where
bcl."type" = '1'
and (bcl.debit_type = '1'
or bcl.debit_type = '2')
and bcl.del_flag = '0'
and bcl.status!='2'
and bcl.activation_date >= CURRENT_DATE - interval '3 months'
group by
bcl.create_by
union
select
count(*) as count,
bcl.create_by,
'近半年开卡' as name ,
'2' as type
from
bank_card_lend bcl
where
bcl."type" = '1'
and (bcl.debit_type = '1'
or bcl.debit_type = '2')
and bcl.del_flag = '0'
and bcl.status!='2'
and bcl.activation_date >= CURRENT_DATE - interval '6 months'
group by
bcl.create_by
union
select
count(*) as count,
bcl.create_by,
'近一年开卡' as name ,
'3' as type
from
bank_card_lend bcl
where
bcl."type" = '1'
and (bcl.debit_type = '1'
or bcl.debit_type = '2')
and bcl.del_flag = '0'
and bcl.status!='2'
and bcl.activation_date >= CURRENT_DATE - interval '1 years'
group by
bcl.create_by
union
select
count(*) as count,
bcl.create_by,
'总开卡' as name ,
'5' as type
from
bank_card_lend bcl
where
bcl."type" = '1'
and (bcl.debit_type = '1'
or bcl.debit_type = '2')
and bcl.del_flag = '0'
and bcl.status!='2'
group by
bcl.create_by) t
order by
t.type
<!-- 数据范围过滤 -->
${params.dataScope}
</select>
</mapper>