TdBCustBindingSMapper.xml
5.97 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?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" >
<mapper namespace="com.zteits.pay.mapper.smapper.TdBCustBindingSMapper">
<resultMap id="BaseResultMap" type="com.zteits.pay.domain.TdBCustBinding">
<id column="id" property="id" jdbcType="BIGINT"/>
<result column="cust_id" property="custId" jdbcType="VARCHAR"/>
<result column="binding_type" property="bindingType" jdbcType="BIGINT"/>
<result column="binding_id" property="bindingId" jdbcType="VARCHAR"/>
<result column="data_state" property="dataState" jdbcType="INTEGER"/>
<result column="create_empid" property="createEmpid" jdbcType="VARCHAR"/>
<result column="create_date" property="createDate" jdbcType="TIMESTAMP"/>
<result column="modfiy_empid" property="modfiyEmpid" jdbcType="VARCHAR"/>
<result column="modfiy_date" property="modfiyDate" jdbcType="TIMESTAMP"/>
<result column="rsrv_str1" property="rsrvStr1" jdbcType="VARCHAR"/>
<result column="rsrv_str2" property="rsrvStr2" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
id, cust_id, binding_type, binding_id, data_state, create_empid, create_date, modfiy_empid,
modfiy_date, rsrv_str1, rsrv_str2
</sql>
<resultMap id="CustPersonResultMap" type="com.zteits.pay.domain.TdCCustPerson" >
<id column="id" jdbcType="BIGINT" property="id" />
<result column="cust_id" jdbcType="VARCHAR" property="custId" />
<result column="cust_name" jdbcType="VARCHAR" property="custName" />
<result column="user_name" jdbcType="VARCHAR" property="userName" />
<result column="user_password" jdbcType="VARCHAR" property="userPassword" />
<result column="user_phone" jdbcType="VARCHAR" property="userPhone" />
<result column="sex" jdbcType="INTEGER" property="sex" />
<result column="email" jdbcType="VARCHAR" property="email" />
<result column="cust_type" jdbcType="INTEGER" property="custType" />
<result column="parent_id" jdbcType="BIGINT" property="parentId" />
<result column="cer_type" jdbcType="INTEGER" property="cerType" />
<result column="cer_number" jdbcType="VARCHAR" property="cerNumber" />
<result column="deivce_type" jdbcType="INTEGER" property="deivceType" />
<result column="device_no" jdbcType="VARCHAR" property="deviceNo" />
<result column="prov_id" jdbcType="VARCHAR" property="provId" />
<result column="city_id" jdbcType="VARCHAR" property="cityId" />
<result column="area_id" jdbcType="VARCHAR" property="areaId" />
<result column="alias" jdbcType="VARCHAR" property="alias" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="data_state" jdbcType="INTEGER" property="dataState" />
<result column="create_empid" jdbcType="VARCHAR" property="createEmpid" />
<result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
<result column="modfiy_empid" jdbcType="VARCHAR" property="modfiyEmpid" />
<result column="modfiy_date" jdbcType="TIMESTAMP" property="modfiyDate" />
<result column="petty_pay_state" jdbcType="INTEGER" property="pettyPayState" />
<result column="petty_pay_pass" jdbcType="VARCHAR" property="pettyPayPass" />
<result column="petty_pay_amount" jdbcType="INTEGER" property="pettyPayAmount" />
</resultMap>
<sql id="CustPerson_Base_Column_List" >
id, cust_id, cust_name, user_name, user_password, user_phone, sex, email, cust_type,
parent_id, cer_type, cer_number, deivce_type, device_no, prov_id, city_id, area_id,
alias, remark, data_state, create_empid, create_date, modfiy_empid, modfiy_date,
petty_pay_state,petty_pay_pass,petty_pay_amount
</sql>
<select id="queryCustPersonByBindId"
parameterType="com.zteits.clouds.api.dto.wx.param.CustInfoQueryByOpenIdRequest" resultMap="CustPersonResultMap">
SELECT cust.*
FROM td_b_cust_binding cb, td_c_cust_person cust
WHERE cb.cust_id = cust.cust_id
AND cb.data_state = 1
AND cust.data_state = 1
AND cb.binding_type = #{bindingType}
AND cb.binding_id = #{bindindId};
</select>
<select id="queryCustBindingByCustId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from td_b_cust_binding
where cust_id = #{custId,jdbcType=VARCHAR}
limit 1
</select>
<update id="updateCustBindInfoByCustId" parameterType="com.zteits.pay.domain.TdBCustBinding" >
update td_b_cust_binding
<set >
<if test="bindingType != null" >
binding_type = #{bindingType,jdbcType=BIGINT},
</if>
<if test="bindingId != null" >
binding_id = #{bindingId,jdbcType=VARCHAR},
</if>
<if test="dataState != null" >
data_state = #{dataState,jdbcType=INTEGER},
</if>
<if test="createEmpid != null" >
create_empid = #{createEmpid,jdbcType=VARCHAR},
</if>
<if test="createDate != null" >
create_date = #{createDate,jdbcType=TIMESTAMP},
</if>
<if test="modfiyEmpid != null" >
modfiy_empid = #{modfiyEmpid,jdbcType=VARCHAR},
</if>
<if test="modfiyDate != null" >
modfiy_date = #{modfiyDate,jdbcType=TIMESTAMP},
</if>
<if test="rsrvStr1 != null" >
rsrv_str1 = #{rsrvStr1,jdbcType=VARCHAR},
</if>
<if test="rsrvStr2 != null" >
rsrv_str2 = #{rsrvStr2,jdbcType=VARCHAR},
</if>
</set>
where data_state = 1
and cust_id = #{custId,jdbcType=VARCHAR}
and binding_type = #{bindingType,jdbcType=BIGINT}
and binding_id != #{bindingId,jdbcType=VARCHAR}
</update>
</mapper>