UserMapper.xml 16.3 KB
Newer Older
1 2 3
<?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="pwc.taxtech.atms.dao.UserMapper">
4
  <resultMap id="BaseResultMap" type="pwc.taxtech.atms.entity.User">
5 6 7 8
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
gary's avatar
gary committed
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="user_name" jdbcType="VARCHAR" property="userName" />
    <result column="email" jdbcType="VARCHAR" property="email" />
    <result column="password" jdbcType="VARCHAR" property="password" />
    <result column="login_type" jdbcType="INTEGER" property="loginType" />
    <result column="status" jdbcType="INTEGER" property="status" />
    <result column="expiration_date" jdbcType="TIMESTAMP" property="expirationDate" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="is_admin" jdbcType="BIT" property="isAdmin" />
    <result column="password_update_time" jdbcType="TIMESTAMP" property="passwordUpdateTime" />
    <result column="attempt_times" jdbcType="INTEGER" property="attemptTimes" />
    <result column="locked_time" jdbcType="TIMESTAMP" property="lockedTime" />
    <result column="organization_id" jdbcType="VARCHAR" property="organizationId" />
    <result column="is_super_admin" jdbcType="BIT" property="isSuperAdmin" />
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
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
52
            </foreach>
53
          </trim>
54
        </if>
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
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <where>
      <foreach collection="example.oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
87
        </if>
88 89 90 91 92 93 94 95
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
gary's avatar
gary committed
96 97 98
    id, user_name, email, password, login_type, status, expiration_date, create_time, 
    update_time, is_admin, password_update_time, attempt_times, locked_time, organization_id, 
    is_super_admin
99
  </sql>
100
  <select id="selectByExample" parameterType="pwc.taxtech.atms.entity.UserExample" resultMap="BaseResultMap">
101 102 103 104 105 106 107 108 109
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
gary's avatar
gary committed
110
    from user
111 112 113 114 115 116 117 118 119 120 121 122 123 124
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select 
    <include refid="Base_Column_List" />
gary's avatar
gary committed
125 126
    from user
    where id = #{id,jdbcType=VARCHAR}
127 128 129 130 131 132
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
gary's avatar
gary committed
133 134
    delete from user
    where id = #{id,jdbcType=VARCHAR}
135
  </delete>
136
  <delete id="deleteByExample" parameterType="pwc.taxtech.atms.entity.UserExample">
137 138 139 140
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
gary's avatar
gary committed
141
    delete from user
142 143 144 145
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
146
  <insert id="insert" parameterType="pwc.taxtech.atms.entity.User">
147 148 149 150
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
gary's avatar
gary committed
151 152 153 154 155
    insert into user (id, user_name, email, 
      password, login_type, status, 
      expiration_date, create_time, update_time, 
      is_admin, password_update_time, attempt_times, 
      locked_time, organization_id, is_super_admin
156
      )
neo's avatar
neo committed
157
    values (#{id,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, 
gary's avatar
gary committed
158
      #{password,jdbcType=VARCHAR}, #{loginType,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, 
gary's avatar
gary committed
159 160 161
      #{expirationDate,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, 
      #{isAdmin,jdbcType=BIT}, #{passwordUpdateTime,jdbcType=TIMESTAMP}, #{attemptTimes,jdbcType=INTEGER}, 
      #{lockedTime,jdbcType=TIMESTAMP}, #{organizationId,jdbcType=VARCHAR}, #{isSuperAdmin,jdbcType=BIT}
162 163
      )
  </insert>
164
  <insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.User">
165 166 167 168
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
gary's avatar
gary committed
169
    insert into user
170
    <trim prefix="(" suffix=")" suffixOverrides=",">
neo's avatar
neo committed
171
      <if test="id != null">
gary's avatar
gary committed
172
        id,
173 174
      </if>
      <if test="userName != null">
gary's avatar
gary committed
175
        user_name,
176 177
      </if>
      <if test="email != null">
gary's avatar
gary committed
178
        email,
179 180
      </if>
      <if test="password != null">
gary's avatar
gary committed
181
        password,
182 183
      </if>
      <if test="loginType != null">
gary's avatar
gary committed
184
        login_type,
185 186
      </if>
      <if test="status != null">
gary's avatar
gary committed
187
        status,
188 189
      </if>
      <if test="expirationDate != null">
gary's avatar
gary committed
190
        expiration_date,
191 192
      </if>
      <if test="createTime != null">
gary's avatar
gary committed
193
        create_time,
194 195
      </if>
      <if test="updateTime != null">
gary's avatar
gary committed
196
        update_time,
197 198
      </if>
      <if test="isAdmin != null">
gary's avatar
gary committed
199
        is_admin,
200 201
      </if>
      <if test="passwordUpdateTime != null">
gary's avatar
gary committed
202
        password_update_time,
203 204
      </if>
      <if test="attemptTimes != null">
gary's avatar
gary committed
205
        attempt_times,
206 207
      </if>
      <if test="lockedTime != null">
gary's avatar
gary committed
208
        locked_time,
209
      </if>
neo's avatar
neo committed
210
      <if test="organizationId != null">
gary's avatar
gary committed
211
        organization_id,
212 213
      </if>
      <if test="isSuperAdmin != null">
gary's avatar
gary committed
214
        is_super_admin,
215 216 217
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
neo's avatar
neo committed
218 219
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
220 221 222 223 224 225 226 227 228 229 230
      </if>
      <if test="userName != null">
        #{userName,jdbcType=VARCHAR},
      </if>
      <if test="email != null">
        #{email,jdbcType=VARCHAR},
      </if>
      <if test="password != null">
        #{password,jdbcType=VARCHAR},
      </if>
      <if test="loginType != null">
gary's avatar
gary committed
231
        #{loginType,jdbcType=INTEGER},
232 233
      </if>
      <if test="status != null">
gary's avatar
gary committed
234
        #{status,jdbcType=INTEGER},
235 236
      </if>
      <if test="expirationDate != null">
gary's avatar
gary committed
237
        #{expirationDate,jdbcType=TIMESTAMP},
238 239 240 241 242 243 244 245
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="isAdmin != null">
gary's avatar
gary committed
246
        #{isAdmin,jdbcType=BIT},
247 248 249 250 251
      </if>
      <if test="passwordUpdateTime != null">
        #{passwordUpdateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="attemptTimes != null">
gary's avatar
gary committed
252
        #{attemptTimes,jdbcType=INTEGER},
253 254 255 256
      </if>
      <if test="lockedTime != null">
        #{lockedTime,jdbcType=TIMESTAMP},
      </if>
neo's avatar
neo committed
257 258
      <if test="organizationId != null">
        #{organizationId,jdbcType=VARCHAR},
259 260
      </if>
      <if test="isSuperAdmin != null">
gary's avatar
gary committed
261
        #{isSuperAdmin,jdbcType=BIT},
262 263 264
      </if>
    </trim>
  </insert>
265
  <select id="countByExample" parameterType="pwc.taxtech.atms.entity.UserExample" resultType="java.lang.Long">
266 267 268 269
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
gary's avatar
gary committed
270
    select count(*) from user
271 272 273 274 275 276 277 278 279
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
gary's avatar
gary committed
280
    update user
281
    <set>
neo's avatar
neo committed
282
      <if test="record.id != null">
gary's avatar
gary committed
283
        id = #{record.id,jdbcType=VARCHAR},
284 285
      </if>
      <if test="record.userName != null">
gary's avatar
gary committed
286
        user_name = #{record.userName,jdbcType=VARCHAR},
287 288
      </if>
      <if test="record.email != null">
gary's avatar
gary committed
289
        email = #{record.email,jdbcType=VARCHAR},
290 291
      </if>
      <if test="record.password != null">
gary's avatar
gary committed
292
        password = #{record.password,jdbcType=VARCHAR},
293 294
      </if>
      <if test="record.loginType != null">
gary's avatar
gary committed
295
        login_type = #{record.loginType,jdbcType=INTEGER},
296 297
      </if>
      <if test="record.status != null">
gary's avatar
gary committed
298
        status = #{record.status,jdbcType=INTEGER},
299 300
      </if>
      <if test="record.expirationDate != null">
gary's avatar
gary committed
301
        expiration_date = #{record.expirationDate,jdbcType=TIMESTAMP},
302 303
      </if>
      <if test="record.createTime != null">
gary's avatar
gary committed
304
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
305 306
      </if>
      <if test="record.updateTime != null">
gary's avatar
gary committed
307
        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
308 309
      </if>
      <if test="record.isAdmin != null">
gary's avatar
gary committed
310
        is_admin = #{record.isAdmin,jdbcType=BIT},
311 312
      </if>
      <if test="record.passwordUpdateTime != null">
gary's avatar
gary committed
313
        password_update_time = #{record.passwordUpdateTime,jdbcType=TIMESTAMP},
314 315
      </if>
      <if test="record.attemptTimes != null">
gary's avatar
gary committed
316
        attempt_times = #{record.attemptTimes,jdbcType=INTEGER},
317 318
      </if>
      <if test="record.lockedTime != null">
gary's avatar
gary committed
319
        locked_time = #{record.lockedTime,jdbcType=TIMESTAMP},
320
      </if>
neo's avatar
neo committed
321
      <if test="record.organizationId != null">
gary's avatar
gary committed
322
        organization_id = #{record.organizationId,jdbcType=VARCHAR},
323 324
      </if>
      <if test="record.isSuperAdmin != null">
gary's avatar
gary committed
325
        is_super_admin = #{record.isSuperAdmin,jdbcType=BIT},
326 327 328 329 330 331 332 333 334 335 336
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
gary's avatar
gary committed
337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352
    update user
    set id = #{record.id,jdbcType=VARCHAR},
      user_name = #{record.userName,jdbcType=VARCHAR},
      email = #{record.email,jdbcType=VARCHAR},
      password = #{record.password,jdbcType=VARCHAR},
      login_type = #{record.loginType,jdbcType=INTEGER},
      status = #{record.status,jdbcType=INTEGER},
      expiration_date = #{record.expirationDate,jdbcType=TIMESTAMP},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      is_admin = #{record.isAdmin,jdbcType=BIT},
      password_update_time = #{record.passwordUpdateTime,jdbcType=TIMESTAMP},
      attempt_times = #{record.attemptTimes,jdbcType=INTEGER},
      locked_time = #{record.lockedTime,jdbcType=TIMESTAMP},
      organization_id = #{record.organizationId,jdbcType=VARCHAR},
      is_super_admin = #{record.isSuperAdmin,jdbcType=BIT}
353 354 355 356
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
357
  <update id="updateByPrimaryKeySelective" parameterType="pwc.taxtech.atms.entity.User">
358 359 360 361
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
gary's avatar
gary committed
362
    update user
363 364
    <set>
      <if test="userName != null">
gary's avatar
gary committed
365
        user_name = #{userName,jdbcType=VARCHAR},
366 367
      </if>
      <if test="email != null">
gary's avatar
gary committed
368
        email = #{email,jdbcType=VARCHAR},
369 370
      </if>
      <if test="password != null">
gary's avatar
gary committed
371
        password = #{password,jdbcType=VARCHAR},
372 373
      </if>
      <if test="loginType != null">
gary's avatar
gary committed
374
        login_type = #{loginType,jdbcType=INTEGER},
375 376
      </if>
      <if test="status != null">
gary's avatar
gary committed
377
        status = #{status,jdbcType=INTEGER},
378 379
      </if>
      <if test="expirationDate != null">
gary's avatar
gary committed
380
        expiration_date = #{expirationDate,jdbcType=TIMESTAMP},
381 382
      </if>
      <if test="createTime != null">
gary's avatar
gary committed
383
        create_time = #{createTime,jdbcType=TIMESTAMP},
384 385
      </if>
      <if test="updateTime != null">
gary's avatar
gary committed
386
        update_time = #{updateTime,jdbcType=TIMESTAMP},
387 388
      </if>
      <if test="isAdmin != null">
gary's avatar
gary committed
389
        is_admin = #{isAdmin,jdbcType=BIT},
390 391
      </if>
      <if test="passwordUpdateTime != null">
gary's avatar
gary committed
392
        password_update_time = #{passwordUpdateTime,jdbcType=TIMESTAMP},
393 394
      </if>
      <if test="attemptTimes != null">
gary's avatar
gary committed
395
        attempt_times = #{attemptTimes,jdbcType=INTEGER},
396 397
      </if>
      <if test="lockedTime != null">
gary's avatar
gary committed
398
        locked_time = #{lockedTime,jdbcType=TIMESTAMP},
399
      </if>
neo's avatar
neo committed
400
      <if test="organizationId != null">
gary's avatar
gary committed
401
        organization_id = #{organizationId,jdbcType=VARCHAR},
402 403
      </if>
      <if test="isSuperAdmin != null">
gary's avatar
gary committed
404
        is_super_admin = #{isSuperAdmin,jdbcType=BIT},
405 406
      </if>
    </set>
gary's avatar
gary committed
407
    where id = #{id,jdbcType=VARCHAR}
408
  </update>
409
  <update id="updateByPrimaryKey" parameterType="pwc.taxtech.atms.entity.User">
410 411 412 413
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
gary's avatar
gary committed
414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429
    update user
    set user_name = #{userName,jdbcType=VARCHAR},
      email = #{email,jdbcType=VARCHAR},
      password = #{password,jdbcType=VARCHAR},
      login_type = #{loginType,jdbcType=INTEGER},
      status = #{status,jdbcType=INTEGER},
      expiration_date = #{expirationDate,jdbcType=TIMESTAMP},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      is_admin = #{isAdmin,jdbcType=BIT},
      password_update_time = #{passwordUpdateTime,jdbcType=TIMESTAMP},
      attempt_times = #{attemptTimes,jdbcType=INTEGER},
      locked_time = #{lockedTime,jdbcType=TIMESTAMP},
      organization_id = #{organizationId,jdbcType=VARCHAR},
      is_super_admin = #{isSuperAdmin,jdbcType=BIT}
    where id = #{id,jdbcType=VARCHAR}
430
  </update>
431
  <select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.entity.UserExample" resultMap="BaseResultMap">
432 433 434 435 436 437 438 439 440
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
gary's avatar
gary committed
441
    from user
442 443 444 445 446 447 448
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
449
</mapper>