fix: 新增pos机刷卡推荐功能代码提交。
This commit is contained in:
@@ -176,4 +176,71 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="selectCreditPosList" parameterType="AccountsDto" resultType="AccountsVo">
|
||||
select
|
||||
a."name",
|
||||
a.code,
|
||||
a.available_limit as availableLimit,
|
||||
bcl.bill_date || '日' as billDateName,
|
||||
(
|
||||
select
|
||||
STRING_AGG(to_char(atr.create_time,
|
||||
'yyyy-MM-dd')|| '-' || pm.name || '(' || pm.merchant_name || ')'|| '-' ||bcl.name ::text,
|
||||
'、'
|
||||
order by
|
||||
atr.create_time) as posNames
|
||||
from
|
||||
accounts_transfer_record atr
|
||||
left join pos_machine pm on
|
||||
pm.id = atr.pos_id
|
||||
left join bank_card_lend bcl on
|
||||
bcl.id = pm.debit_card
|
||||
where
|
||||
atr.out_account_id = a.id
|
||||
and atr.create_time >= CURRENT_DATE - interval '1 months'
|
||||
and atr.del_flag = '0'
|
||||
|
||||
) as remark,
|
||||
(
|
||||
select
|
||||
STRING_AGG(pm.name || '(' || pm.merchant_name || ')'|| '-' ||bcl.name ::text,
|
||||
'、'
|
||||
)
|
||||
from
|
||||
pos_machine pm
|
||||
left join bank_card_lend bcl on
|
||||
bcl.id = pm.debit_card
|
||||
where
|
||||
pm.status = '1'
|
||||
and bcl.name not like '%' || a.name || '%'
|
||||
and pm.del_flag = '0'
|
||||
and pm.id not in
|
||||
(
|
||||
select
|
||||
atr.pos_id
|
||||
from
|
||||
accounts_transfer_record atr
|
||||
left join pos_machine pm on
|
||||
pm.id = atr.pos_id
|
||||
where
|
||||
atr.out_account_id = a.id
|
||||
and atr.create_time >= CURRENT_DATE - interval '1 months'
|
||||
and atr.del_flag = '0'
|
||||
) ) as advicePosNames
|
||||
from
|
||||
accounts a
|
||||
left join bank_card_lend bcl on
|
||||
bcl.id = a.id
|
||||
where
|
||||
a."type" = '2'
|
||||
and a.status = '1'
|
||||
and a.del_flag = '0'
|
||||
<if test="name != null and name != ''"> and a.name like '%'|| #{name}||'%'</if>
|
||||
<if test="code != null and code != ''"> and a.code like '%'|| #{code}||'%'</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by
|
||||
bcl.bill_date
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user