UserRechargeLogMapper.xml
6.9 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
<?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.bjivt.entity.showtime.UserRechargeLog" >
<resultMap id="BaseResultMap" type="com.bjivt.entity.showtime.UserRechargeLog" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="order_num" property="orderNum" jdbcType="VARCHAR" />
<result column="pay_type" property="payType" jdbcType="INTEGER" />
<result column="pay_time" property="payTime" jdbcType="VARCHAR" />
<result column="user_id" property="userId" jdbcType="INTEGER" />
<result column="money" property="money" jdbcType="INTEGER" />
<result column="error_code" property="errorCode" jdbcType="VARCHAR" />
<result column="error_msg" property="errorMsg" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="me_coin_balance" property="meCoinBalance" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List" >
id, order_num, pay_type, pay_time, user_id, money, error_code, error_msg, create_time
</sql>
<select id="findById" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from tbl_user_recharge_log
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectById" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from tbl_user_recharge_log
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteById" parameterType="java.lang.Integer" >
delete from tbl_user_recharge_log
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="save" parameterType="com.bjivt.entity.showtime.UserRechargeLog" >
insert into tbl_user_recharge_log (id, order_num, pay_type,
pay_time, user_id, money,
error_code, error_msg, create_time
)
values (#{id,jdbcType=INTEGER}, #{orderNum,jdbcType=VARCHAR}, #{payType,jdbcType=INTEGER},
#{payTime,jdbcType=VARCHAR}, #{userId,jdbcType=INTEGER}, #{money,jdbcType=INTEGER},
#{errorCode,jdbcType=VARCHAR}, #{errorMsg,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" parameterType="com.bjivt.entity.showtime.UserRechargeLog" >
insert into tbl_user_recharge_log
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="orderNum != null" >
order_num,
</if>
<if test="payType != null" >
pay_type,
</if>
<if test="payTime != null" >
pay_time,
</if>
<if test="userId != null" >
user_id,
</if>
<if test="money != null" >
money,
</if>
<if test="errorCode != null" >
error_code,
</if>
<if test="errorMsg != null" >
error_msg,
</if>
<if test="createTime != null" >
create_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="orderNum != null" >
#{orderNum,jdbcType=VARCHAR},
</if>
<if test="payType != null" >
#{payType,jdbcType=INTEGER},
</if>
<if test="payTime != null" >
#{payTime,jdbcType=VARCHAR},
</if>
<if test="userId != null" >
#{userId,jdbcType=INTEGER},
</if>
<if test="money != null" >
#{money,jdbcType=INTEGER},
</if>
<if test="errorCode != null" >
#{errorCode,jdbcType=VARCHAR},
</if>
<if test="errorMsg != null" >
#{errorMsg,jdbcType=VARCHAR},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByIdSelective" parameterType="com.bjivt.entity.showtime.UserRechargeLog" >
update tbl_user_recharge_log
<set >
<if test="orderNum != null" >
order_num = #{orderNum,jdbcType=VARCHAR},
</if>
<if test="payType != null" >
pay_type = #{payType,jdbcType=INTEGER},
</if>
<if test="payTime != null" >
pay_time = #{payTime,jdbcType=VARCHAR},
</if>
<if test="userId != null" >
user_id = #{userId,jdbcType=INTEGER},
</if>
<if test="money != null" >
money = #{money,jdbcType=INTEGER},
</if>
<if test="errorCode != null" >
error_code = #{errorCode,jdbcType=VARCHAR},
</if>
<if test="errorMsg != null" >
error_msg = #{errorMsg,jdbcType=VARCHAR},
</if>
<if test="createTime != null" >
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.bjivt.entity.showtime.UserRechargeLog" >
update tbl_user_recharge_log
set order_num = #{orderNum,jdbcType=VARCHAR},
pay_type = #{payType,jdbcType=INTEGER},
pay_time = #{payTime,jdbcType=VARCHAR},
user_id = #{userId,jdbcType=INTEGER},
money = #{money,jdbcType=INTEGER},
error_code = #{errorCode,jdbcType=VARCHAR},
error_msg = #{errorMsg,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="getCountBy" resultType="java.lang.Integer" parameterType="com.bjivt.entity.showtime.UserRechargeLog">
SELECT
count(turl.id)
FROM
tbl_user_recharge_log turl INNER JOIN tbl_user_list tul ON turl.user_id=tul.id WHERE 1=1
<if test="userId != null and userId !=0 ">
and turl.user_id = #{userId}
</if>
<if test="startTime != null and startTime !='' and endTime != null and endTime !=''">
and date_format(turl.create_time,'%Y-%m-%d') between str_to_date(#{startTime},'%Y-%m-%d') and str_to_date(#{endTime},'%Y-%m-%d')
</if>
</select>
<select id="findListByMap" resultMap="BaseResultMap" parameterType="java.util.Map">
SELECT
turl.id, turl.order_num, turl.pay_type, turl.pay_time, turl.user_id, turl.money, turl.error_code, turl.error_msg, turl.create_time,tul.me_coin_balance
FROM
tbl_user_recharge_log turl INNER JOIN tbl_user_list tul ON turl.user_id=tul.id WHERE 1=1
<if test="UserRechargeLog.userId != null and UserRechargeLog.userId !=0 ">
and turl.user_id = #{UserRechargeLog.userId}
</if>
<if test="UserRechargeLog.startTime != null and UserRechargeLog.startTime !='' and UserRechargeLog.endTime != null and UserRechargeLog.endTime !=''">
and date_format(turl.create_time,'%Y-%m-%d') between str_to_date(#{UserRechargeLog.startTime},'%Y-%m-%d') and str_to_date(#{UserRechargeLog.endTime},'%Y-%m-%d')
</if>
order by create_time
<if test="page != null and page !=''">
<if test="page.from != null and page.size != null">
limit #{page.from},#{page.size}
</if>
</if>
</select>
</mapper>