|
@@ -0,0 +1,349 @@
|
|
1
|
+<?xml version="1.0" encoding="UTF-8" ?>
|
|
2
|
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
|
3
|
+<mapper namespace="com.community.huiju.dao.TaUserMapper" >
|
|
4
|
+ <resultMap id="BaseResultMap" type="com.community.huiju.model.TaUser" >
|
|
5
|
+ <id column="id" property="id" jdbcType="INTEGER" />
|
|
6
|
+ <result column="community_id" property="communityId" jdbcType="INTEGER" />
|
|
7
|
+ <result column="building_owner_info_id" property="buildingOwnerInfoId" jdbcType="INTEGER" />
|
|
8
|
+ <result column="head_portrait" property="headPortrait" jdbcType="VARCHAR" />
|
|
9
|
+ <result column="user_name" property="userName" jdbcType="VARCHAR" />
|
|
10
|
+ <result column="login_name" property="loginName" jdbcType="VARCHAR" />
|
|
11
|
+ <result column="login_password" property="loginPassword" jdbcType="VARCHAR" />
|
|
12
|
+ <result column="email" property="email" jdbcType="VARCHAR" />
|
|
13
|
+ <result column="gender" property="gender" jdbcType="CHAR" />
|
|
14
|
+ <result column="status" property="status" jdbcType="CHAR" />
|
|
15
|
+ <result column="remark" property="remark" jdbcType="VARCHAR" />
|
|
16
|
+ <result column="parent_id" property="parentId" jdbcType="INTEGER" />
|
|
17
|
+ <result column="accept_agreement_status" property="acceptAgreementStatus" jdbcType="CHAR" />
|
|
18
|
+ <result column="verify_status" property="verifyStatus" jdbcType="CHAR" />
|
|
19
|
+ <result column="create_user" property="createUser" jdbcType="INTEGER" />
|
|
20
|
+ <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
|
|
21
|
+ <result column="update_user" property="updateUser" jdbcType="INTEGER" />
|
|
22
|
+ <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
|
|
23
|
+ <result column="hk_user_id" property="hkUserId" jdbcType="INTEGER" />
|
|
24
|
+ <result column="hk_card_no" property="hkCardNo" jdbcType="VARCHAR" />
|
|
25
|
+ <result column="face_status" property="faceStatus" jdbcType="CHAR" />
|
|
26
|
+ </resultMap>
|
|
27
|
+ <sql id="Base_Column_List" >
|
|
28
|
+ id, community_id, building_owner_info_id, head_portrait, user_name, login_name, login_password,
|
|
29
|
+ email, gender, status, remark, parent_id, accept_agreement_status, verify_status,
|
|
30
|
+ create_user, create_date, update_user, update_date, hk_user_id, hk_card_no, face_status
|
|
31
|
+ </sql>
|
|
32
|
+ <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
|
33
|
+ select
|
|
34
|
+ <include refid="Base_Column_List" />
|
|
35
|
+ from ta_user
|
|
36
|
+ where id = #{id,jdbcType=INTEGER}
|
|
37
|
+ </select>
|
|
38
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
|
|
39
|
+ delete from ta_user
|
|
40
|
+ where id = #{id,jdbcType=INTEGER}
|
|
41
|
+ </delete>
|
|
42
|
+ <insert id="insert" parameterType="com.community.huiju.model.TaUser" useGeneratedKeys="true" keyProperty="id" >
|
|
43
|
+ insert into ta_user (id, community_id, building_owner_info_id,
|
|
44
|
+ head_portrait, user_name, login_name,
|
|
45
|
+ login_password, email, gender,
|
|
46
|
+ status, remark, parent_id,
|
|
47
|
+ accept_agreement_status, verify_status, create_user,
|
|
48
|
+ create_date, update_user, update_date,
|
|
49
|
+ hk_user_id, hk_card_no, face_status
|
|
50
|
+ )
|
|
51
|
+ values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{buildingOwnerInfoId,jdbcType=INTEGER},
|
|
52
|
+ #{headPortrait,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, #{loginName,jdbcType=VARCHAR},
|
|
53
|
+ #{loginPassword,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{gender,jdbcType=CHAR},
|
|
54
|
+ #{status,jdbcType=CHAR}, #{remark,jdbcType=VARCHAR}, #{parentId,jdbcType=INTEGER},
|
|
55
|
+ #{acceptAgreementStatus,jdbcType=CHAR}, #{verifyStatus,jdbcType=CHAR}, #{createUser,jdbcType=INTEGER},
|
|
56
|
+ #{createDate,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP},
|
|
57
|
+ #{hkUserId,jdbcType=INTEGER}, #{hkCardNo,jdbcType=VARCHAR}, #{faceStatus,jdbcType=CHAR}
|
|
58
|
+ )
|
|
59
|
+ </insert>
|
|
60
|
+ <insert id="insertSelective" parameterType="com.community.huiju.model.TaUser" useGeneratedKeys="true" keyProperty="id" >
|
|
61
|
+ insert into ta_user
|
|
62
|
+ <trim prefix="(" suffix=")" suffixOverrides="," >
|
|
63
|
+ <if test="id != null" >
|
|
64
|
+ id,
|
|
65
|
+ </if>
|
|
66
|
+ <if test="communityId != null" >
|
|
67
|
+ community_id,
|
|
68
|
+ </if>
|
|
69
|
+ <if test="buildingOwnerInfoId != null" >
|
|
70
|
+ building_owner_info_id,
|
|
71
|
+ </if>
|
|
72
|
+ <if test="headPortrait != null" >
|
|
73
|
+ head_portrait,
|
|
74
|
+ </if>
|
|
75
|
+ <if test="userName != null" >
|
|
76
|
+ user_name,
|
|
77
|
+ </if>
|
|
78
|
+ <if test="loginName != null" >
|
|
79
|
+ login_name,
|
|
80
|
+ </if>
|
|
81
|
+ <if test="loginPassword != null" >
|
|
82
|
+ login_password,
|
|
83
|
+ </if>
|
|
84
|
+ <if test="email != null" >
|
|
85
|
+ email,
|
|
86
|
+ </if>
|
|
87
|
+ <if test="gender != null" >
|
|
88
|
+ gender,
|
|
89
|
+ </if>
|
|
90
|
+ <if test="status != null" >
|
|
91
|
+ status,
|
|
92
|
+ </if>
|
|
93
|
+ <if test="remark != null" >
|
|
94
|
+ remark,
|
|
95
|
+ </if>
|
|
96
|
+ <if test="parentId != null" >
|
|
97
|
+ parent_id,
|
|
98
|
+ </if>
|
|
99
|
+ <if test="acceptAgreementStatus != null" >
|
|
100
|
+ accept_agreement_status,
|
|
101
|
+ </if>
|
|
102
|
+ <if test="verifyStatus != null" >
|
|
103
|
+ verify_status,
|
|
104
|
+ </if>
|
|
105
|
+ <if test="createUser != null" >
|
|
106
|
+ create_user,
|
|
107
|
+ </if>
|
|
108
|
+ <if test="createDate != null" >
|
|
109
|
+ create_date,
|
|
110
|
+ </if>
|
|
111
|
+ <if test="updateUser != null" >
|
|
112
|
+ update_user,
|
|
113
|
+ </if>
|
|
114
|
+ <if test="updateDate != null" >
|
|
115
|
+ update_date,
|
|
116
|
+ </if>
|
|
117
|
+ <if test="hkUserId != null" >
|
|
118
|
+ hk_user_id,
|
|
119
|
+ </if>
|
|
120
|
+ <if test="hkCardNo != null" >
|
|
121
|
+ hk_card_no,
|
|
122
|
+ </if>
|
|
123
|
+ <if test="faceStatus != null" >
|
|
124
|
+ face_status,
|
|
125
|
+ </if>
|
|
126
|
+ </trim>
|
|
127
|
+ <trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
128
|
+ <if test="id != null" >
|
|
129
|
+ #{id,jdbcType=INTEGER},
|
|
130
|
+ </if>
|
|
131
|
+ <if test="communityId != null" >
|
|
132
|
+ #{communityId,jdbcType=INTEGER},
|
|
133
|
+ </if>
|
|
134
|
+ <if test="buildingOwnerInfoId != null" >
|
|
135
|
+ #{buildingOwnerInfoId,jdbcType=INTEGER},
|
|
136
|
+ </if>
|
|
137
|
+ <if test="headPortrait != null" >
|
|
138
|
+ #{headPortrait,jdbcType=VARCHAR},
|
|
139
|
+ </if>
|
|
140
|
+ <if test="userName != null" >
|
|
141
|
+ #{userName,jdbcType=VARCHAR},
|
|
142
|
+ </if>
|
|
143
|
+ <if test="loginName != null" >
|
|
144
|
+ #{loginName,jdbcType=VARCHAR},
|
|
145
|
+ </if>
|
|
146
|
+ <if test="loginPassword != null" >
|
|
147
|
+ #{loginPassword,jdbcType=VARCHAR},
|
|
148
|
+ </if>
|
|
149
|
+ <if test="email != null" >
|
|
150
|
+ #{email,jdbcType=VARCHAR},
|
|
151
|
+ </if>
|
|
152
|
+ <if test="gender != null" >
|
|
153
|
+ #{gender,jdbcType=CHAR},
|
|
154
|
+ </if>
|
|
155
|
+ <if test="status != null" >
|
|
156
|
+ #{status,jdbcType=CHAR},
|
|
157
|
+ </if>
|
|
158
|
+ <if test="remark != null" >
|
|
159
|
+ #{remark,jdbcType=VARCHAR},
|
|
160
|
+ </if>
|
|
161
|
+ <if test="parentId != null" >
|
|
162
|
+ #{parentId,jdbcType=INTEGER},
|
|
163
|
+ </if>
|
|
164
|
+ <if test="acceptAgreementStatus != null" >
|
|
165
|
+ #{acceptAgreementStatus,jdbcType=CHAR},
|
|
166
|
+ </if>
|
|
167
|
+ <if test="verifyStatus != null" >
|
|
168
|
+ #{verifyStatus,jdbcType=CHAR},
|
|
169
|
+ </if>
|
|
170
|
+ <if test="createUser != null" >
|
|
171
|
+ #{createUser,jdbcType=INTEGER},
|
|
172
|
+ </if>
|
|
173
|
+ <if test="createDate != null" >
|
|
174
|
+ #{createDate,jdbcType=TIMESTAMP},
|
|
175
|
+ </if>
|
|
176
|
+ <if test="updateUser != null" >
|
|
177
|
+ #{updateUser,jdbcType=INTEGER},
|
|
178
|
+ </if>
|
|
179
|
+ <if test="updateDate != null" >
|
|
180
|
+ #{updateDate,jdbcType=TIMESTAMP},
|
|
181
|
+ </if>
|
|
182
|
+ <if test="hkUserId != null" >
|
|
183
|
+ #{hkUserId,jdbcType=INTEGER},
|
|
184
|
+ </if>
|
|
185
|
+ <if test="hkCardNo != null" >
|
|
186
|
+ #{hkCardNo,jdbcType=VARCHAR},
|
|
187
|
+ </if>
|
|
188
|
+ <if test="faceStatus != null" >
|
|
189
|
+ #{faceStatus,jdbcType=CHAR},
|
|
190
|
+ </if>
|
|
191
|
+ </trim>
|
|
192
|
+ </insert>
|
|
193
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TaUser" >
|
|
194
|
+ update ta_user
|
|
195
|
+ <set >
|
|
196
|
+ <if test="communityId != null" >
|
|
197
|
+ community_id = #{communityId,jdbcType=INTEGER},
|
|
198
|
+ </if>
|
|
199
|
+ <if test="buildingOwnerInfoId != null" >
|
|
200
|
+ building_owner_info_id = #{buildingOwnerInfoId,jdbcType=INTEGER},
|
|
201
|
+ </if>
|
|
202
|
+ <if test="headPortrait != null" >
|
|
203
|
+ head_portrait = #{headPortrait,jdbcType=VARCHAR},
|
|
204
|
+ </if>
|
|
205
|
+ <if test="userName != null" >
|
|
206
|
+ user_name = #{userName,jdbcType=VARCHAR},
|
|
207
|
+ </if>
|
|
208
|
+ <if test="loginName != null" >
|
|
209
|
+ login_name = #{loginName,jdbcType=VARCHAR},
|
|
210
|
+ </if>
|
|
211
|
+ <if test="loginPassword != null" >
|
|
212
|
+ login_password = #{loginPassword,jdbcType=VARCHAR},
|
|
213
|
+ </if>
|
|
214
|
+ <if test="email != null" >
|
|
215
|
+ email = #{email,jdbcType=VARCHAR},
|
|
216
|
+ </if>
|
|
217
|
+ <if test="gender != null" >
|
|
218
|
+ gender = #{gender,jdbcType=CHAR},
|
|
219
|
+ </if>
|
|
220
|
+ <if test="status != null" >
|
|
221
|
+ status = #{status,jdbcType=CHAR},
|
|
222
|
+ </if>
|
|
223
|
+ <if test="remark != null" >
|
|
224
|
+ remark = #{remark,jdbcType=VARCHAR},
|
|
225
|
+ </if>
|
|
226
|
+ <if test="parentId != null" >
|
|
227
|
+ parent_id = #{parentId,jdbcType=INTEGER},
|
|
228
|
+ </if>
|
|
229
|
+ <if test="acceptAgreementStatus != null" >
|
|
230
|
+ accept_agreement_status = #{acceptAgreementStatus,jdbcType=CHAR},
|
|
231
|
+ </if>
|
|
232
|
+ <if test="verifyStatus != null" >
|
|
233
|
+ verify_status = #{verifyStatus,jdbcType=CHAR},
|
|
234
|
+ </if>
|
|
235
|
+ <if test="createUser != null" >
|
|
236
|
+ create_user = #{createUser,jdbcType=INTEGER},
|
|
237
|
+ </if>
|
|
238
|
+ <if test="createDate != null" >
|
|
239
|
+ create_date = #{createDate,jdbcType=TIMESTAMP},
|
|
240
|
+ </if>
|
|
241
|
+ <if test="updateUser != null" >
|
|
242
|
+ update_user = #{updateUser,jdbcType=INTEGER},
|
|
243
|
+ </if>
|
|
244
|
+ <if test="updateDate != null" >
|
|
245
|
+ update_date = #{updateDate,jdbcType=TIMESTAMP},
|
|
246
|
+ </if>
|
|
247
|
+ <if test="hkUserId != null" >
|
|
248
|
+ hk_user_id = #{hkUserId,jdbcType=INTEGER},
|
|
249
|
+ </if>
|
|
250
|
+ <if test="hkCardNo != null" >
|
|
251
|
+ hk_card_no = #{hkCardNo,jdbcType=VARCHAR},
|
|
252
|
+ </if>
|
|
253
|
+ <if test="faceStatus != null" >
|
|
254
|
+ face_status = #{faceStatus,jdbcType=CHAR},
|
|
255
|
+ </if>
|
|
256
|
+ </set>
|
|
257
|
+ where id = #{id,jdbcType=INTEGER}
|
|
258
|
+ </update>
|
|
259
|
+ <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TaUser" >
|
|
260
|
+ update ta_user
|
|
261
|
+ set community_id = #{communityId,jdbcType=INTEGER},
|
|
262
|
+ building_owner_info_id = #{buildingOwnerInfoId,jdbcType=INTEGER},
|
|
263
|
+ head_portrait = #{headPortrait,jdbcType=VARCHAR},
|
|
264
|
+ user_name = #{userName,jdbcType=VARCHAR},
|
|
265
|
+ login_name = #{loginName,jdbcType=VARCHAR},
|
|
266
|
+ login_password = #{loginPassword,jdbcType=VARCHAR},
|
|
267
|
+ email = #{email,jdbcType=VARCHAR},
|
|
268
|
+ gender = #{gender,jdbcType=CHAR},
|
|
269
|
+ status = #{status,jdbcType=CHAR},
|
|
270
|
+ remark = #{remark,jdbcType=VARCHAR},
|
|
271
|
+ parent_id = #{parentId,jdbcType=INTEGER},
|
|
272
|
+ accept_agreement_status = #{acceptAgreementStatus,jdbcType=CHAR},
|
|
273
|
+ verify_status = #{verifyStatus,jdbcType=CHAR},
|
|
274
|
+ create_user = #{createUser,jdbcType=INTEGER},
|
|
275
|
+ create_date = #{createDate,jdbcType=TIMESTAMP},
|
|
276
|
+ update_user = #{updateUser,jdbcType=INTEGER},
|
|
277
|
+ update_date = #{updateDate,jdbcType=TIMESTAMP},
|
|
278
|
+ hk_user_id = #{hkUserId,jdbcType=INTEGER},
|
|
279
|
+ hk_card_no = #{hkCardNo,jdbcType=VARCHAR},
|
|
280
|
+ face_status = #{faceStatus,jdbcType=CHAR}
|
|
281
|
+ where id = #{id,jdbcType=INTEGER}
|
|
282
|
+ </update>
|
|
283
|
+
|
|
284
|
+ <select id="selectByLoginNameAndByLoginPassword" parameterType="map" resultMap="BaseResultMap" >
|
|
285
|
+ select
|
|
286
|
+ <include refid="Base_Column_List" />
|
|
287
|
+ from ta_user
|
|
288
|
+ where login_name=#{loginName,jdbcType=VARCHAR} and login_password = #{loginPassword,jdbcType=VARCHAR}
|
|
289
|
+ </select>
|
|
290
|
+
|
|
291
|
+ <select id="selectByLoginName" parameterType="map" resultMap="BaseResultMap" >
|
|
292
|
+ select
|
|
293
|
+ <include refid="Base_Column_List" />
|
|
294
|
+ from ta_user
|
|
295
|
+ where login_name=#{loginName,jdbcType=VARCHAR}
|
|
296
|
+ </select>
|
|
297
|
+
|
|
298
|
+ <select id="updateLongName" parameterType="com.community.huiju.model.TaUser" resultMap="BaseResultMap">
|
|
299
|
+ update ta_user
|
|
300
|
+ set
|
|
301
|
+ login_name = #{loginName,jdbcType=VARCHAR}
|
|
302
|
+ where id = #{id,jdbcType=INTEGER}
|
|
303
|
+ </select>
|
|
304
|
+
|
|
305
|
+ <select id="selectUserListByParentId" parameterType="java.lang.Integer" resultMap="BaseResultMap" >
|
|
306
|
+ select
|
|
307
|
+ <include refid="Base_Column_List" />
|
|
308
|
+ from ta_user
|
|
309
|
+ where parent_id = #{parentId}
|
|
310
|
+ </select>
|
|
311
|
+
|
|
312
|
+ <select id="selectTaFaceParentId" parameterType="java.lang.Integer" resultMap="BaseResultMap" >
|
|
313
|
+ select
|
|
314
|
+ <include refid="Base_Column_List" />
|
|
315
|
+ from ta_user
|
|
316
|
+ where 1=1
|
|
317
|
+ <if test="otherUserID != null" >
|
|
318
|
+ and id = #{otherUserID,jdbcType=INTEGER}
|
|
319
|
+ </if>
|
|
320
|
+ <if test="id != null" >
|
|
321
|
+ and parent_id = #{id}
|
|
322
|
+ </if>
|
|
323
|
+ limit 1
|
|
324
|
+ </select>
|
|
325
|
+
|
|
326
|
+ <select id="getByLoginName" parameterType="java.lang.Integer" resultMap="BaseResultMap" >
|
|
327
|
+ select
|
|
328
|
+ <include refid="Base_Column_List" />
|
|
329
|
+ from ta_user
|
|
330
|
+ where community_id = #{communityId,jdbcType=INTEGER}
|
|
331
|
+ <if test="otherUserID != null" >
|
|
332
|
+ and login_name = #{phone}
|
|
333
|
+ </if>
|
|
334
|
+
|
|
335
|
+ </select>
|
|
336
|
+
|
|
337
|
+ <select id="getByUserTypeCount" parameterType="java.lang.Integer" resultType="java.lang.Integer">
|
|
338
|
+ SELECT COUNT(*)
|
|
339
|
+ FROM ta_user tu
|
|
340
|
+ INNER JOIN ta_sys_user_role tsur on tu.id = tsur.user_id where tsur.role_id = #{roleId,jdbcType=INTEGER}
|
|
341
|
+ </select>
|
|
342
|
+
|
|
343
|
+ <select id="getOwnerCount" parameterType="java.lang.Integer" resultType="java.lang.Integer">
|
|
344
|
+ SELECT COUNT(*)
|
|
345
|
+ FROM ta_user tu
|
|
346
|
+ INNER JOIN ta_sys_user_role tsur on tu.id = tsur.user_id where tsur.role_id != 2
|
|
347
|
+ </select>
|
|
348
|
+
|
|
349
|
+</mapper>
|