liusheng
2023-05-25 bed24ea3fdeee959b85b699a82d53c5112adb219
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
<?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.ruoyi.system.mapper.BaseUserInfoMapper">
 
    <resultMap type="BaseUserInfo" id="BaseUserInfoResult">
        <result property="userid"    column="userid"    />
        <result property="usercode"    column="usercode"    />
        <result property="account"    column="account"    />
        <result property="phone"    column="phone"    />
        <result property="password"    column="password"    />
        <result property="secret"    column="secret"    />
        <result property="realname"    column="realname"    />
        <result property="nickname"    column="nickname"    />
        <result property="roleid"    column="roleid"    />
        <result property="rolename"    column="rolename"    />
        <result property="deptid"    column="deptid"    />
        <result property="deptname"    column="deptname"    />
        <result property="wardid"    column="wardid"    />
        <result property="wardname"    column="wardname"    />
        <result property="usertype"    column="usertype"    />
        <result property="usertypename"    column="usertypename"    />
        <result property="dwpermission"    column="dwpermission"    />
        <result property="isopenlowerorg"    column="isopenlowerorg"    />
        <result property="isopenshareknow"    column="isopenshareknow"    />
        <result property="isopengeneraldata"    column="isopengeneraldata"    />
        <result property="orgid"    column="orgid"    />
        <result property="delFlag"    column="del_flag"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="isupload"    column="isupload"    />
        <result property="uploadTime"    column="upload_time"    />
        <result property="deptpermission"    column="deptpermission"    />
        <result property="wardpermission"    column="wardpermission"    />
    </resultMap>
 
    <sql id="selectBaseUserInfoVo">
        select userid, usercode, account, phone, password, secret, realname, nickname, roleid, rolename, deptid, deptname, wardid, wardname, usertype, usertypename, dwpermission, isopenlowerorg, isopenshareknow, isopengeneraldata, orgid, del_flag, update_by, update_time, create_by, create_time, isupload, upload_time, deptpermission, wardpermission from base_user_info
    </sql>
 
    <select id="selectBaseUserInfoList" parameterType="BaseUserInfo" resultMap="BaseUserInfoResult">
        <include refid="selectBaseUserInfoVo"/>
        <where>
            <if test="usercode != null  and usercode != ''"> and usercode = #{usercode}</if>
            <if test="account != null  and account != ''"> and account = #{account}</if>
            <if test="phone != null  and phone != ''"> and phone = #{phone}</if>
            <if test="password != null  and password != ''"> and password = #{password}</if>
            <if test="secret != null  and secret != ''"> and secret = #{secret}</if>
            <if test="realname != null  and realname != ''"> and realname like concat('%', #{realname}, '%')</if>
            <if test="nickname != null  and nickname != ''"> and nickname like concat('%', #{nickname}, '%')</if>
            <if test="roleid != null "> and roleid = #{roleid}</if>
            <if test="rolename != null  and rolename != ''"> and rolename like concat('%', #{rolename}, '%')</if>
            <if test="deptid != null  and deptid != ''"> and deptid = #{deptid}</if>
            <if test="deptname != null  and deptname != ''"> and deptname like concat('%', #{deptname}, '%')</if>
            <if test="wardid != null  and wardid != ''"> and wardid = #{wardid}</if>
            <if test="wardname != null  and wardname != ''"> and wardname like concat('%', #{wardname}, '%')</if>
            <if test="usertype != null "> and usertype = #{usertype}</if>
            <if test="usertypename != null  and usertypename != ''"> and usertypename like concat('%', #{usertypename}, '%')</if>
            <if test="dwpermission != null "> and dwpermission = #{dwpermission}</if>
            <if test="isopenlowerorg != null "> and isopenlowerorg = #{isopenlowerorg}</if>
            <if test="isopenshareknow != null "> and isopenshareknow = #{isopenshareknow}</if>
            <if test="isopengeneraldata != null "> and isopengeneraldata = #{isopengeneraldata}</if>
            <if test="orgid != null  and orgid != ''"> and orgid = #{orgid}</if>
            <if test="isupload != null "> and isupload = #{isupload}</if>
            <if test="uploadTime != null "> and upload_time = #{uploadTime}</if>
            <if test="deptpermission != null  and deptpermission != ''"> and deptpermission = #{deptpermission}</if>
            <if test="wardpermission != null  and wardpermission != ''"> and wardpermission = #{wardpermission}</if>
        </where>
    </select>
 
    <select id="selectBaseUserInfoByUserid" parameterType="Long" resultMap="BaseUserInfoResult">
        <include refid="selectBaseUserInfoVo"/>
        where userid = #{userid}
    </select>
 
    <insert id="insertBaseUserInfo" parameterType="BaseUserInfo" useGeneratedKeys="true" keyProperty="userid">
        insert into base_user_info
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="usercode != null">usercode,</if>
            <if test="account != null">account,</if>
            <if test="phone != null">phone,</if>
            <if test="password != null">password,</if>
            <if test="secret != null">secret,</if>
            <if test="realname != null">realname,</if>
            <if test="nickname != null">nickname,</if>
            <if test="roleid != null">roleid,</if>
            <if test="rolename != null">rolename,</if>
            <if test="deptid != null">deptid,</if>
            <if test="deptname != null">deptname,</if>
            <if test="wardid != null">wardid,</if>
            <if test="wardname != null">wardname,</if>
            <if test="usertype != null">usertype,</if>
            <if test="usertypename != null">usertypename,</if>
            <if test="dwpermission != null">dwpermission,</if>
            <if test="isopenlowerorg != null">isopenlowerorg,</if>
            <if test="isopenshareknow != null">isopenshareknow,</if>
            <if test="isopengeneraldata != null">isopengeneraldata,</if>
            <if test="orgid != null">orgid,</if>
            <if test="delFlag != null and delFlag != ''">del_flag,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="isupload != null">isupload,</if>
            <if test="uploadTime != null">upload_time,</if>
            <if test="deptpermission != null">deptpermission,</if>
            <if test="wardpermission != null">wardpermission,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="usercode != null">#{usercode},</if>
            <if test="account != null">#{account},</if>
            <if test="phone != null">#{phone},</if>
            <if test="password != null">#{password},</if>
            <if test="secret != null">#{secret},</if>
            <if test="realname != null">#{realname},</if>
            <if test="nickname != null">#{nickname},</if>
            <if test="roleid != null">#{roleid},</if>
            <if test="rolename != null">#{rolename},</if>
            <if test="deptid != null">#{deptid},</if>
            <if test="deptname != null">#{deptname},</if>
            <if test="wardid != null">#{wardid},</if>
            <if test="wardname != null">#{wardname},</if>
            <if test="usertype != null">#{usertype},</if>
            <if test="usertypename != null">#{usertypename},</if>
            <if test="dwpermission != null">#{dwpermission},</if>
            <if test="isopenlowerorg != null">#{isopenlowerorg},</if>
            <if test="isopenshareknow != null">#{isopenshareknow},</if>
            <if test="isopengeneraldata != null">#{isopengeneraldata},</if>
            <if test="orgid != null">#{orgid},</if>
            <if test="delFlag != null and delFlag != ''">#{delFlag},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="isupload != null">#{isupload},</if>
            <if test="uploadTime != null">#{uploadTime},</if>
            <if test="deptpermission != null">#{deptpermission},</if>
            <if test="wardpermission != null">#{wardpermission},</if>
         </trim>
    </insert>
 
    <update id="updateBaseUserInfo" parameterType="BaseUserInfo">
        update base_user_info
        <trim prefix="SET" suffixOverrides=",">
            <if test="usercode != null">usercode = #{usercode},</if>
            <if test="account != null">account = #{account},</if>
            <if test="phone != null">phone = #{phone},</if>
            <if test="password != null">password = #{password},</if>
            <if test="secret != null">secret = #{secret},</if>
            <if test="realname != null">realname = #{realname},</if>
            <if test="nickname != null">nickname = #{nickname},</if>
            <if test="roleid != null">roleid = #{roleid},</if>
            <if test="rolename != null">rolename = #{rolename},</if>
            <if test="deptid != null">deptid = #{deptid},</if>
            <if test="deptname != null">deptname = #{deptname},</if>
            <if test="wardid != null">wardid = #{wardid},</if>
            <if test="wardname != null">wardname = #{wardname},</if>
            <if test="usertype != null">usertype = #{usertype},</if>
            <if test="usertypename != null">usertypename = #{usertypename},</if>
            <if test="dwpermission != null">dwpermission = #{dwpermission},</if>
            <if test="isopenlowerorg != null">isopenlowerorg = #{isopenlowerorg},</if>
            <if test="isopenshareknow != null">isopenshareknow = #{isopenshareknow},</if>
            <if test="isopengeneraldata != null">isopengeneraldata = #{isopengeneraldata},</if>
            <if test="orgid != null">orgid = #{orgid},</if>
            <if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="isupload != null">isupload = #{isupload},</if>
            <if test="uploadTime != null">upload_time = #{uploadTime},</if>
            <if test="deptpermission != null">deptpermission = #{deptpermission},</if>
            <if test="wardpermission != null">wardpermission = #{wardpermission},</if>
        </trim>
        where userid = #{userid}
    </update>
 
    <delete id="deleteBaseUserInfoByUserid" parameterType="Long">
        delete from base_user_info where userid = #{userid}
    </delete>
 
    <delete id="deleteBaseUserInfoByUserids" parameterType="String">
        delete from base_user_info where userid in
        <foreach item="userid" collection="array" open="(" separator="," close=")">
            #{userid}
        </foreach>
    </delete>
</mapper>