OrderRechargeSMapper.xml
7.41 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<?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.order.mapper.smapper.OrderRechargeSMapper" >
<resultMap id="BaseResultMap" type="com.zteits.order.domain.OrderRecharge">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="order_id" jdbcType="VARCHAR" property="orderId" />
<result column="order_type" jdbcType="INTEGER" property="orderType" />
<result column="order_state" jdbcType="INTEGER" property="orderState" />
<result column="order_dicount_fee" jdbcType="BIGINT" property="orderDicountFee" />
<result column="order_act_fee" jdbcType="BIGINT" property="orderActFee" />
<result column="order_total_fee" jdbcType="BIGINT" property="orderTotalFee" />
<result column="cust_type" jdbcType="INTEGER" property="custType" />
<result column="cust_id" jdbcType="VARCHAR" property="custId" />
<result column="terminal_source" jdbcType="INTEGER" property="terminalSource" />
<result column="acct_type" jdbcType="INTEGER" property="acctType" />
<result column="acct_id" jdbcType="VARCHAR" property="acctId" />
<result column="invoice_state" jdbcType="INTEGER" property="invoiceState" />
<result column="data_state" jdbcType="INTEGER" property="dataState" />
<result column="create_emp_id" jdbcType="VARCHAR" property="createEmpId" />
<result column="create_emp_name" jdbcType="VARCHAR" property="createEmpName" />
<result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
<result column="modfiy_emp_id" jdbcType="VARCHAR" property="modfiyEmpId" />
<result column="modfiy_emp_name" jdbcType="VARCHAR" property="modfiyEmpName" />
<result column="modfiy_date" jdbcType="TIMESTAMP" property="modfiyDate" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="org_id" jdbcType="BIGINT" property="orgId" />
<result column="org_name" jdbcType="VARCHAR" property="orgName" />
</resultMap>
<sql id="Base_Column_List">
id, order_id, order_type, order_state, order_dicount_fee, order_act_fee, order_total_fee,
cust_type, cust_id, terminal_source, acct_type, acct_id, invoice_state, data_state,
create_emp_id, create_emp_name, create_date, modfiy_emp_id, modfiy_emp_name, modfiy_date,
remark, org_id, org_name
</sql>
<!-- 根据订单id或者id查询充值单 -->
<select id="queryOrderRechargeByOrderIdOrId" resultMap="BaseResultMap" parameterType="com.zteits.order.domain.OrderRecharge" >
select
<include refid="Base_Column_List" />
from order_recharge
where 1=1
and data_state = 1
<if test="id != null" >
and id = #{id,jdbcType=BIGINT}
</if>
<if test="orderId != null" >
and order_id = #{orderId,jdbcType=VARCHAR}
</if>
</select>
<!-- 条件查询充值单 -->
<select id="queryOrderRechargeByCondition" resultMap="BaseResultMap" parameterType="com.zteits.clouds.api.dto.order.rechargeorder.param.OrderRechargeQueryReq" >
select
<include refid="Base_Column_List" />
from order_recharge
where 1=1
and data_state = 1
<if test="id != null" >
and id = #{id,jdbcType=BIGINT}
</if>
<if test="orderId != null" >
and order_id = #{orderId,jdbcType=VARCHAR}
</if>
<if test="orderIds != null and orderIds.size >0 ">
AND order_id IN
<foreach collection="orderIds" item="orderId" index="index" open="(" close=")" separator=",">
#{orderId}
</foreach>
</if>
<if test="orderTypeList != null and orderTypeList.size >0 ">
AND order_type IN
<foreach collection="orderTypeList" item="orderType" index="index" open="(" close=")" separator=",">
#{orderType}
</foreach>
</if>
<if test="orderStateList != null and orderStateList.size >0 ">
AND order_state IN
<foreach collection="orderStateList" item="orderState" index="index" open="(" close=")" separator=",">
#{orderState}
</foreach>
</if>
<if test="terminalSourceList != null and terminalSourceList.size >0 ">
AND terminal_source IN
<foreach collection="terminalSourceList" item="terminalSource" index="index" open="(" close=")" separator=",">
#{terminalSource}
</foreach>
</if>
<if test="acctTypeList != null and acctTypeList.size >0 ">
AND acct_type IN
<foreach collection="acctTypeList" item="acctType" index="index" open="(" close=")" separator=",">
#{acctType}
</foreach>
</if>
<if test="custType != null and custType !=''">
and cust_type=#{custType}
</if>
<if test="custId != null and custId !=''">
and cust_id=#{custId}
</if>
<if test="acctId != null and acctId !=''">
and acct_id=#{acctId}
</if>
<if test="dataState == null">
and data_state = 1
</if>
<if test="dataState != null">
and data_state=#{dataState}
</if>
</select>
<!-- 根据订单id或者id修改充值单信息 -->
<update id="updateOrderRechargeByOrderIdOrId" parameterType="com.zteits.order.domain.OrderRecharge" >
update order_recharge
<set >
<if test="orderId != null" >
order_id = #{orderId,jdbcType=VARCHAR},
</if>
<if test="orderType != null" >
order_type = #{orderType,jdbcType=INTEGER},
</if>
<if test="orderState != null" >
order_state = #{orderState,jdbcType=INTEGER},
</if>
<if test="orderDicountFee != null" >
order_dicount_fee = #{orderDicountFee,jdbcType=BIGINT},
</if>
<if test="orderActFee != null" >
order_act_fee = #{orderActFee,jdbcType=BIGINT},
</if>
<if test="orderTotalFee != null" >
order_total_fee = #{orderTotalFee,jdbcType=BIGINT},
</if>
<if test="custType != null" >
cust_type = #{custType,jdbcType=INTEGER},
</if>
<if test="custId != null" >
cust_id = #{custId,jdbcType=VARCHAR},
</if>
<if test="terminalSource != null" >
terminal_source = #{terminalSource,jdbcType=INTEGER},
</if>
<if test="acctType != null" >
acct_type = #{acctType,jdbcType=INTEGER},
</if>
<if test="acctId != null" >
acct_id = #{acctId,jdbcType=VARCHAR},
</if>
<if test="invoiceState != null">
invoice_state = #{invoiceState,jdbcType=INTEGER},
</if>
<if test="dataState != null" >
data_state = #{dataState,jdbcType=INTEGER},
</if>
<if test="createEmpId != null" >
create_emp_id = #{createEmpId,jdbcType=VARCHAR},
</if>
<if test="createEmpName != null" >
create_emp_name = #{createEmpName,jdbcType=VARCHAR},
</if>
<if test="createDate != null" >
create_date = #{createDate,jdbcType=TIMESTAMP},
</if>
<if test="modfiyEmpId != null" >
modfiy_emp_id = #{modfiyEmpId,jdbcType=VARCHAR},
</if>
<if test="modfiyEmpName != null" >
modfiy_emp_name = #{modfiyEmpName,jdbcType=VARCHAR},
</if>
<if test="modfiyDate != null" >
modfiy_date = #{modfiyDate,jdbcType=TIMESTAMP},
</if>
<if test="remark != null" >
remark = #{remark,jdbcType=VARCHAR},
</if>
</set>
where 1=1
and data_state = 1
<if test="id != null" >
and id = #{id,jdbcType=BIGINT}
</if>
<if test="orderId != null" >
and order_id = #{orderId,jdbcType=VARCHAR}
</if>
</update>
</mapper>