pnr-bind-ret-info-mapper.xml
2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!-- @author tongxiaochuan -->
<mapper namespace="com.cjs.cms.dao.user.account.PnrBindRetInfoDao">
<sql id="pnr_bind_ret_info_field">
id, user_id, user_cust_id, acct_id, order_id, order_date, platform_seq_id, bank_id, card_no, bind_status, remark, create_at
</sql>
<insert id="save" parameterType="map">
insert into pnr_bind_ret_info(user_id, bank_id, card_no, create_at)
values(#{user_id}, #{bank_id}, #{card_no}, CURRENT_TIMESTAMP)
</insert>
<!-- 提交绑定接口后更新信息 -->
<update id="updateAfterBind" parameterType="map">
update pnr_bind_ret_info set order_id = #{order_id}, order_date = #{order_date},
bind_status = #{bind_status} where user_id = #{user_id}
</update>
<!-- 快捷绑卡回调更新 -->
<update id="update" parameterType="map">
update pnr_bind_ret_info set platform_seq_id = #{platform_seq_id}, bind_status = #{bind_status}, remark = #{remark}
where user_cust_id = #{user_cust_id}
</update>
<select id="queryInfo" parameterType="map" resultType="map">
select <include refid="pnr_bind_ret_info_field" /> from pnr_bind_ret_info
where 1=1
<if test="user_id != null and user_id != ''">
and user_id = #{user_id}
</if>
<if test="user_cust_id != null and user_cust_id != ''">
and user_cust_id = #{user_cust_id}
</if>
</select>
<update id="updateAcctId" parameterType="map">
update pnr_bind_ret_info set user_cust_id = #{user_cust_id}, acct_id = #{acct_id} where user_id = #{user_id}
</update>
<select id="queryForReOperate" resultType="string">
select user_id from pnr_bind_ret_info where bind_status is null and user_cust_id is null
</select>
<select id="queryBindFailedUser" resultType="string">
select user_id from pnr_bind_ret_info
where bind_status != 1 or bind_status is null and user_cust_id is not null
</select>
<select id="queryBindList" resultType="string">
select user_id from user_list_tab
</select>
</mapper>