AnchorCheckedMapper.xml
5.4 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
<?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.AnchorChecked">
<resultMap id="BaseResultMap" type="com.bjivt.entity.showtime.AnchorChecked">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="user_id" jdbcType="INTEGER" property="userId" />
<result column="user_name" jdbcType="VARCHAR" property="userName" />
<result column="contact" jdbcType="VARCHAR" property="contact" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="id_card" jdbcType="VARCHAR" property="idCard" />
<result column="card_file_front" jdbcType="VARCHAR" property="cardFileFront" />
<result column="hand_Card" jdbcType="VARCHAR" property="handCard" />
<result column="card_file_back" jdbcType="VARCHAR" property="cardFileBack" />
<result column="is_checked" jdbcType="INTEGER" property="isChecked" />
<result column="reason" jdbcType="VARCHAR" property="reason" />
</resultMap>
<sql id="Base_Column_List">
id,user_id,user_name,contact,create_time,id_card,card_file_front,hand_Card,card_file_back,is_checked,reason
</sql>
<update id="updateByIdSelective" parameterType="com.bjivt.entity.showtime.AnchorChecked">
update tbl_anchor_checked
<set>
<if test="userId != null">
user_id = #{userId,jdbcType=VARCHAR},
</if>
<if test="userName != null">
user_name = #{userName,jdbcType=VARCHAR},
</if>
<if test="contact != null">
contact = #{contact,jdbcType=VARCHAR},
</if>
<if test="idCard != null">
id_card = #{idCard,jdbcType=INTEGER},
</if>
<if test="cardFileFront != null">
card_file_front = #{cardFileFront,jdbcType=INTEGER},
</if>
<if test="handCard != null">
hand_Card = #{handCard,jdbcType=VARCHAR},
</if>
<if test="cardFileBack != null">
card_file_back = #{cardFileBack,jdbcType=VARCHAR},
</if>
<if test="isChecked != null">
is_checked = #{isChecked,jdbcType=INTEGER},
</if>
<if test="reason != null">
reason = #{reason,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectById" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tbl_anchor_checked
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectByUserId" parameterType="java.lang.Integer"
resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tbl_anchor_checked
where user_id = #{userId,jdbcType=INTEGER}
</select>
<select id="selectByUserName" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tbl_anchor_checked
where user_name = #{userName,jdbcType=VARCHAR}
</select>
<select id="selectByStatus" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tbl_anchor_checked
where is_checked =
#{isChecked,jdbcType=INTEGER}
</select>
<select id="getCountBy" resultType="java.lang.Integer"
parameterType="com.bjivt.entity.showtime.AnchorChecked">
SELECT
count(1)
FROM
tbl_anchor_checked
<trim prefix="where" prefixOverrides="and|or">
<if test="userId != null and userId != ''">
and tbl_anchor_checked.user_id = #{userId}
</if>
</trim>
</select>
<select id="findListByMap" resultMap="BaseResultMap"
parameterType="java.util.Map">
SELECT
<include refid="Base_Column_List" />
FROM
tbl_anchor_checked
<trim prefix="where" prefixOverrides="and|or">
<if test="AnchorChecked.userId != null and AnchorChecked.userId != 0">
and tbl_anchor_checked.user_id = #{AnchorChecked.userId}
</if>
<if test="AnchorChecked.contact != null and AnchorChecked.contact !=''">
and contact = #{AnchorChecked.contact}
</if>
<if test="AnchorChecked.isChecked != null and AnchorChecked.isChecked !=''">
and is_checked = #{AnchorChecked.isChecked}
</if>
</trim>
order by create_time DESC
<if test="page != null and page !=''">
<if test="page.from != null and page.size != null">
limit #{page.from},#{page.size}
</if>
</if>
</select>
<select id="findAnchorChecked" resultType="com.bjivt.entity.showtime.AnchorChecked"
parameterType="com.bjivt.entity.showtime.AnchorChecked">
select * from tbl_anchor_checked
<trim prefix="where" prefixOverrides="and|or">
<if test="userId != null and userId !=''">
and userId like '%${userId}%'
</if>
<if test="userName != null and userName !=''">
and userName like '%${userName}%'
</if>
<if test="contact != null and contact !=''">
and contact like '%${contact}%'
</if>
<if test="idCard != null and idCard !=''">
and idCard like '%${idCard}%'
</if>
<if test="cardFileFront != null and cardFileFront !=''">
and cardFileFront like '%${cardFileFront}%'
</if>
<if test="handCard != null and handCard !=''">
and handCard like '%${handCard}%'
</if>
<if test="isChecked != null and isChecked !=''">
and is_checked = #{isChecked}
</if>
<if test="cardFileBack != null and cardFileBack !=''">
and cardFileBack like '%${cardFileBack}%'
</if>
<if test="reason != null and reason !=''">
and reason like '%${reason}%'
</if>
</trim>
order by ${orderBy}
<if test="startRow != null and sizeRow !=''">
limit #{startRow},#{sizeRow}
</if>
</select>
</mapper>