mitao
2025-02-21 31573d6180d15ef65ed0df9c2732495f40b12663
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
<?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.panzhihua.service_community.dao.SysUserDao">
 
    <resultMap type="com.panzhihua.service_community.entity.SysUser" id="SysUserMap">
        <result property="userId" column="user_id"/>
        <result property="account" column="account"/>
        <result property="password" column="password"/>
        <result property="openid" column="openid"/>
        <result property="sessionKey" column="session_key"/>
        <result property="unionid" column="unionid"/>
        <result property="phone" column="phone"/>
        <result property="nickName" column="nick_name"/>
        <result property="name" column="name"/>
        <result property="communityId" column="community_id"/>
        <result property="sex" column="sex"/>
        <result property="idCard" column="id_card"/>
        <result property="birthday" column="birthday"/>
        <result property="imageUrl" column="image_url"/>
        <result property="type" column="type"/>
        <result property="job" column="job"/>
        <result property="isVolunteer" column="is_volunteer"/>
        <result property="isPartymember" column="is_partymember"/>
        <result property="status" column="status"/>
        <result property="createAt" column="create_at"/>
        <result property="lastLoginTime" column="last_login_time"/>
        <result property="tags" column="tags"/>
        <result property="familyId" column="family_id"/>
        <result property="faceUrl" column="face_url"/>
        <result property="faceState" column="face_state"/>
        <result property="rejectReson" column="reject_reson"/>
        <result property="areaId" column="area_id"/>
        <result property="cardPhotoFront" column="card_photo_front"/>
        <result property="cardPhotoBack" column="card_photo_back"/>
        <result property="familyBook" column="family_book"/>
        <result property="continuousLandingDays" column="continuous_landing_days"/>
        <result property="isTips" column="is_tips"/>
        <result property="workStatus" column="work_status"/>
        <result property="workStartTime" column="work_start_time"/>
        <result property="workEndTime" column="work_end_time"/>
        <result property="bigAgeTips" column="big_age_tips"/>
        <result property="plaintextPassword" column="plaintext_password"/>
        <result property="streetId" column="street_id"/>
        <result property="relationName" column="relation_name"/>
        <result property="loveIntegral" column="love_integral"/>
        <result property="playPwd" column="play_pwd"/>
    </resultMap>
 
    <!--查询单个-->
    <select id="queryById" resultMap="SysUserMap">
        select
          user_id, account, password, openid, session_key, unionid, phone, nick_name, name,play_pwd,
               community_id, sex, id_card, birthday, image_url, type, job, is_volunteer, is_partymember,
               status, create_at, last_login_time, tags, family_id, face_url, face_state, reject_reson,
               area_id, card_photo_front, card_photo_back, family_book, continuous_landing_days, is_tips,
               work_status, work_start_time, work_end_time, big_age_tips, plaintext_password,love_integral
        from sys_user
        where user_id = #{userId}
    </select>
 
    <!--查询指定行数据-->
    <select id="queryAllByLimit" resultMap="SysUserMap">
        select
        user_id, account, password, openid, session_key, unionid, phone, nick_name, name, community_id, sex, id_card,
        birthday, image_url, type, job, is_volunteer, is_partymember, status, create_at, last_login_time, tags,play_pwd,
        family_id, face_url, face_state, reject_reson, area_id, card_photo_front, card_photo_back, family_book,love_integral,
        continuous_landing_days, is_tips, work_status, work_start_time, work_end_time, big_age_tips, plaintext_password
        from sys_user
        <where>
            <if test="dto.userId != null">
                and user_id = #{dto.userId}
            </if>
            <if test="dto.account != null and dto.account != ''">
                and account = #{dto.account}
            </if>
            <if test="dto.password != null and dto.password != ''">
                and password = #{dto.password}
            </if>
            <if test="dto.openid != null and dto.openid != ''">
                and openid = #{dto.openid}
            </if>
            <if test="dto.sessionKey != null and dto.sessionKey != ''">
                and session_key = #{dto.sessionKey}
            </if>
            <if test="dto.unionid != null and dto.unionid != ''">
                and unionid = #{dto.unionid}
            </if>
            <if test="dto.phone != null and dto.phone != ''">
                and phone = #{dto.phone}
            </if>
            <if test="dto.nickName != null and dto.nickName != ''">
                and nick_name = #{dto.nickName}
            </if>
            <if test="dto.name != null and dto.name != ''">
                and name = #{dto.name}
            </if>
            <if test="dto.communityId != null">
                and community_id = #{dto.communityId}
            </if>
            <if test="dto.sex != null">
                and sex = #{dto.sex}
            </if>
            <if test="dto.idCard != null and dto.idCard != ''">
                and id_card = #{dto.idCard}
            </if>
            <if test="dto.birthday != null">
                and birthday = #{dto.birthday}
            </if>
            <if test="dto.imageUrl != null and dto.imageUrl != ''">
                and image_url = #{dto.imageUrl}
            </if>
            <if test="dto.type != null">
                and type = #{dto.type}
            </if>
            <if test="dto.job != null and dto.job != ''">
                and job = #{dto.job}
            </if>
            <if test="dto.isVolunteer != null">
                and is_volunteer = #{dto.isVolunteer}
            </if>
            <if test="dto.isPartymember != null">
                and is_partymember = #{dto.isPartymember}
            </if>
            <if test="dto.status != null">
                and status = #{dto.status}
            </if>
            <if test="dto.createAt != null">
                and create_at = #{dto.createAt}
            </if>
            <if test="dto.lastLoginTime != null">
                and last_login_time = #{dto.lastLoginTime}
            </if>
            <if test="dto.tags != null and dto.tags != ''">
                and tags = #{dto.tags}
            </if>
            <if test="dto.familyId != null">
                and family_id = #{dto.familyId}
            </if>
            <if test="dto.faceUrl != null and dto.faceUrl != ''">
                and face_url = #{dto.faceUrl}
            </if>
            <if test="dto.faceState != null">
                and face_state = #{dto.faceState}
            </if>
            <if test="dto.rejectReson != null and dto.rejectReson != ''">
                and reject_reson = #{dto.rejectReson}
            </if>
            <if test="dto.areaId != null">
                and area_id = #{dto.areaId}
            </if>
            <if test="dto.cardPhotoFront != null and dto.cardPhotoFront != ''">
                and card_photo_front = #{dto.cardPhotoFront}
            </if>
            <if test="dto.cardPhotoBack != null and dto.cardPhotoBack != ''">
                and card_photo_back = #{dto.cardPhotoBack}
            </if>
            <if test="dto.familyBook != null and dto.familyBook != ''">
                and family_book = #{dto.familyBook}
            </if>
            <if test="dto.continuousLandingDays != null">
                and continuous_landing_days = #{dto.continuousLandingDays}
            </if>
            <if test="dto.isTips != null">
                and is_tips = #{dto.isTips}
            </if>
            <if test="dto.workStatus != null">
                and work_status = #{dto.workStatus}
            </if>
            <if test="dto.workStartTime != null">
                and work_start_time = #{dto.workStartTime}
            </if>
            <if test="dto.workEndTime != null">
                and work_end_time = #{dto.workEndTime}
            </if>
            <if test="dto.bigAgeTips != null">
                and big_age_tips = #{dto.bigAgeTips}
            </if>
            <if test="dto.plaintextPassword != null and dto.plaintextPassword != ''">
                and plaintext_password = #{dto.plaintextPassword}
            </if>
        </where>
        order by create_at desc
    </select>
 
    <!--查询所有数据-->
    <select id="queryAllByList" resultMap="SysUserMap">
        select
        user_id, account, password, openid, session_key, unionid, phone, nick_name, name, community_id, sex, id_card,
        birthday, image_url, type, job, is_volunteer, is_partymember, status, create_at, last_login_time, tags,play_pwd,
        family_id, face_url, face_state, reject_reson, area_id, card_photo_front, card_photo_back, family_book,love_integral,
        continuous_landing_days, is_tips, work_status, work_start_time, work_end_time, big_age_tips, plaintext_password
        from sys_user
        <where>
            <if test="dto.userId != null">
                and user_id = #{dto.userId}
            </if>
            <if test="dto.account != null and dto.account != ''">
                and account = #{dto.account}
            </if>
            <if test="dto.password != null and dto.password != ''">
                and password = #{dto.password}
            </if>
            <if test="dto.openid != null and dto.openid != ''">
                and openid = #{dto.openid}
            </if>
            <if test="dto.sessionKey != null and dto.sessionKey != ''">
                and session_key = #{dto.sessionKey}
            </if>
            <if test="dto.unionid != null and dto.unionid != ''">
                and unionid = #{dto.unionid}
            </if>
            <if test="dto.phone != null and dto.phone != ''">
                and phone = #{dto.phone}
            </if>
            <if test="dto.nickName != null and dto.nickName != ''">
                and nick_name = #{dto.nickName}
            </if>
            <if test="dto.name != null and dto.name != ''">
                and name = #{dto.name}
            </if>
            <if test="dto.communityId != null">
                and community_id = #{dto.communityId}
            </if>
            <if test="dto.sex != null">
                and sex = #{dto.sex}
            </if>
            <if test="dto.idCard != null and dto.idCard != ''">
                and id_card = #{dto.idCard}
            </if>
            <if test="dto.birthday != null">
                and birthday = #{dto.birthday}
            </if>
            <if test="dto.imageUrl != null and dto.imageUrl != ''">
                and image_url = #{dto.imageUrl}
            </if>
            <if test="dto.type != null">
                and type = #{dto.type}
            </if>
            <if test="dto.job != null and dto.job != ''">
                and job = #{dto.job}
            </if>
            <if test="dto.isVolunteer != null">
                and is_volunteer = #{dto.isVolunteer}
            </if>
            <if test="dto.isPartymember != null">
                and is_partymember = #{dto.isPartymember}
            </if>
            <if test="dto.status != null">
                and status = #{dto.status}
            </if>
            <if test="dto.createAt != null">
                and create_at = #{dto.createAt}
            </if>
            <if test="dto.lastLoginTime != null">
                and last_login_time = #{dto.lastLoginTime}
            </if>
            <if test="dto.tags != null and dto.tags != ''">
                and tags = #{dto.tags}
            </if>
            <if test="dto.familyId != null">
                and family_id = #{dto.familyId}
            </if>
            <if test="dto.faceUrl != null and dto.faceUrl != ''">
                and face_url = #{dto.faceUrl}
            </if>
            <if test="dto.faceState != null">
                and face_state = #{dto.faceState}
            </if>
            <if test="dto.rejectReson != null and dto.rejectReson != ''">
                and reject_reson = #{dto.rejectReson}
            </if>
            <if test="dto.areaId != null">
                and area_id = #{dto.areaId}
            </if>
            <if test="dto.cardPhotoFront != null and dto.cardPhotoFront != ''">
                and card_photo_front = #{dto.cardPhotoFront}
            </if>
            <if test="dto.cardPhotoBack != null and dto.cardPhotoBack != ''">
                and card_photo_back = #{dto.cardPhotoBack}
            </if>
            <if test="dto.familyBook != null and dto.familyBook != ''">
                and family_book = #{dto.familyBook}
            </if>
            <if test="dto.continuousLandingDays != null">
                and continuous_landing_days = #{dto.continuousLandingDays}
            </if>
            <if test="dto.isTips != null">
                and is_tips = #{dto.isTips}
            </if>
            <if test="dto.workStatus != null">
                and work_status = #{dto.workStatus}
            </if>
            <if test="dto.workStartTime != null">
                and work_start_time = #{dto.workStartTime}
            </if>
            <if test="dto.workEndTime != null">
                and work_end_time = #{dto.workEndTime}
            </if>
            <if test="dto.bigAgeTips != null">
                and big_age_tips = #{dto.bigAgeTips}
            </if>
            <if test="dto.plaintextPassword != null and dto.plaintextPassword != ''">
                and plaintext_password = #{dto.plaintextPassword}
            </if>
        </where>
        order by create_at desc
    </select>
 
    <update id="updatePassWord">
        update sys_user set plaintext_password = #{passWord},password = #{pwd} where community_id = #{storeId} and `type` = 20
    </update>
    <select id="selectOpenId" resultType="String">
        select openid from sys_user where type = 1 and app_id ='wx118de8a734d269f0' and is_accept = 1
    </select>
</mapper>