PermissionMapper.xml 14.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.PermissionMapper">
4
  <resultMap id="BaseResultMap" type="pwc.taxtech.atms.entity.Permission">
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
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="code" jdbcType="VARCHAR" property="code" />
gary's avatar
gary committed
12
    <result column="operation_perm_list" jdbcType="VARCHAR" property="operationPermList" />
gary's avatar
gary committed
13 14 15 16 17 18 19 20
    <result column="parent_id" jdbcType="VARCHAR" property="parentId" />
    <result column="is_active" jdbcType="BIT" property="isActive" />
    <result column="p_level" jdbcType="SMALLINT" property="pLevel" />
    <result column="rely_on_codes" jdbcType="VARCHAR" property="relyOnCodes" />
    <result column="menu_id" jdbcType="VARCHAR" property="menuId" />
    <result column="service_type_id" jdbcType="VARCHAR" property="serviceTypeId" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
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
  </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>
49
            </foreach>
50
          </trim>
51
        </if>
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
      </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>
84
        </if>
85 86 87 88 89 90 91 92
      </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
93 94
    id, name, code, operation_perm_list, parent_id, is_active, p_level, rely_on_codes, 
    menu_id, service_type_id, create_time, update_time
95
  </sql>
96
  <select id="selectByExample" parameterType="pwc.taxtech.atms.entity.PermissionExample" resultMap="BaseResultMap">
97 98 99 100 101 102 103 104 105
    <!--
      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
106
    from permission
107 108 109 110 111 112 113 114 115 116 117 118 119 120
    <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
121 122
    from permission
    where id = #{id,jdbcType=VARCHAR}
123 124 125 126 127 128
  </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
129 130
    delete from permission
    where id = #{id,jdbcType=VARCHAR}
131
  </delete>
132
  <delete id="deleteByExample" parameterType="pwc.taxtech.atms.entity.PermissionExample">
133 134 135 136
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
gary's avatar
gary committed
137
    delete from permission
138 139 140 141
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
142
  <insert id="insert" parameterType="pwc.taxtech.atms.entity.Permission">
143 144 145 146
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
gary's avatar
gary committed
147
    insert into permission (id, name, code, 
gary's avatar
gary committed
148 149 150 151
      operation_perm_list, parent_id, is_active, 
      p_level, rely_on_codes, menu_id, 
      service_type_id, create_time, update_time
      )
gary's avatar
gary committed
152
    values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, 
gary's avatar
gary committed
153 154 155 156
      #{operationPermList,jdbcType=VARCHAR}, #{parentId,jdbcType=VARCHAR}, #{isActive,jdbcType=BIT}, 
      #{pLevel,jdbcType=SMALLINT}, #{relyOnCodes,jdbcType=VARCHAR}, #{menuId,jdbcType=VARCHAR}, 
      #{serviceTypeId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
      )
157
  </insert>
158
  <insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.Permission">
159 160 161 162
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
gary's avatar
gary committed
163
    insert into permission
164
    <trim prefix="(" suffix=")" suffixOverrides=",">
gary's avatar
gary committed
165 166
      <if test="id != null">
        id,
167 168
      </if>
      <if test="name != null">
gary's avatar
gary committed
169
        name,
170 171
      </if>
      <if test="code != null">
gary's avatar
gary committed
172
        code,
173
      </if>
gary's avatar
gary committed
174 175 176
      <if test="operationPermList != null">
        operation_perm_list,
      </if>
gary's avatar
gary committed
177 178
      <if test="parentId != null">
        parent_id,
179 180
      </if>
      <if test="isActive != null">
gary's avatar
gary committed
181
        is_active,
182
      </if>
gary's avatar
gary committed
183 184
      <if test="pLevel != null">
        p_level,
185 186
      </if>
      <if test="relyOnCodes != null">
gary's avatar
gary committed
187
        rely_on_codes,
188
      </if>
gary's avatar
gary committed
189 190
      <if test="menuId != null">
        menu_id,
191
      </if>
gary's avatar
gary committed
192 193
      <if test="serviceTypeId != null">
        service_type_id,
194 195
      </if>
      <if test="createTime != null">
gary's avatar
gary committed
196
        create_time,
197 198
      </if>
      <if test="updateTime != null">
gary's avatar
gary committed
199
        update_time,
200 201 202
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
gary's avatar
gary committed
203 204
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
205 206 207 208 209 210 211
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="code != null">
        #{code,jdbcType=VARCHAR},
      </if>
gary's avatar
gary committed
212 213 214
      <if test="operationPermList != null">
        #{operationPermList,jdbcType=VARCHAR},
      </if>
gary's avatar
gary committed
215 216
      <if test="parentId != null">
        #{parentId,jdbcType=VARCHAR},
217 218
      </if>
      <if test="isActive != null">
gary's avatar
gary committed
219
        #{isActive,jdbcType=BIT},
220
      </if>
gary's avatar
gary committed
221 222
      <if test="pLevel != null">
        #{pLevel,jdbcType=SMALLINT},
223 224 225 226
      </if>
      <if test="relyOnCodes != null">
        #{relyOnCodes,jdbcType=VARCHAR},
      </if>
gary's avatar
gary committed
227 228
      <if test="menuId != null">
        #{menuId,jdbcType=VARCHAR},
229
      </if>
gary's avatar
gary committed
230 231
      <if test="serviceTypeId != null">
        #{serviceTypeId,jdbcType=VARCHAR},
232 233 234 235 236 237 238 239 240
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
241
  <select id="countByExample" parameterType="pwc.taxtech.atms.entity.PermissionExample" resultType="java.lang.Long">
242 243 244 245
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
gary's avatar
gary committed
246
    select count(*) from permission
247 248 249 250 251 252 253 254 255
    <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
256
    update permission
257
    <set>
gary's avatar
gary committed
258 259
      <if test="record.id != null">
        id = #{record.id,jdbcType=VARCHAR},
260 261
      </if>
      <if test="record.name != null">
gary's avatar
gary committed
262
        name = #{record.name,jdbcType=VARCHAR},
263 264
      </if>
      <if test="record.code != null">
gary's avatar
gary committed
265
        code = #{record.code,jdbcType=VARCHAR},
266
      </if>
gary's avatar
gary committed
267 268 269
      <if test="record.operationPermList != null">
        operation_perm_list = #{record.operationPermList,jdbcType=VARCHAR},
      </if>
gary's avatar
gary committed
270 271
      <if test="record.parentId != null">
        parent_id = #{record.parentId,jdbcType=VARCHAR},
272 273
      </if>
      <if test="record.isActive != null">
gary's avatar
gary committed
274
        is_active = #{record.isActive,jdbcType=BIT},
275
      </if>
gary's avatar
gary committed
276 277
      <if test="record.pLevel != null">
        p_level = #{record.pLevel,jdbcType=SMALLINT},
278 279
      </if>
      <if test="record.relyOnCodes != null">
gary's avatar
gary committed
280
        rely_on_codes = #{record.relyOnCodes,jdbcType=VARCHAR},
281
      </if>
gary's avatar
gary committed
282 283
      <if test="record.menuId != null">
        menu_id = #{record.menuId,jdbcType=VARCHAR},
284
      </if>
gary's avatar
gary committed
285 286
      <if test="record.serviceTypeId != null">
        service_type_id = #{record.serviceTypeId,jdbcType=VARCHAR},
287 288
      </if>
      <if test="record.createTime != null">
gary's avatar
gary committed
289
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
290 291
      </if>
      <if test="record.updateTime != null">
gary's avatar
gary committed
292
        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
293 294 295 296 297 298 299 300 301 302 303
      </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
304 305 306 307
    update permission
    set id = #{record.id,jdbcType=VARCHAR},
      name = #{record.name,jdbcType=VARCHAR},
      code = #{record.code,jdbcType=VARCHAR},
gary's avatar
gary committed
308
      operation_perm_list = #{record.operationPermList,jdbcType=VARCHAR},
gary's avatar
gary committed
309 310 311 312 313 314 315 316
      parent_id = #{record.parentId,jdbcType=VARCHAR},
      is_active = #{record.isActive,jdbcType=BIT},
      p_level = #{record.pLevel,jdbcType=SMALLINT},
      rely_on_codes = #{record.relyOnCodes,jdbcType=VARCHAR},
      menu_id = #{record.menuId,jdbcType=VARCHAR},
      service_type_id = #{record.serviceTypeId,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP}
317 318 319 320
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
321
  <update id="updateByPrimaryKeySelective" parameterType="pwc.taxtech.atms.entity.Permission">
322 323 324 325
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
gary's avatar
gary committed
326
    update permission
327 328
    <set>
      <if test="name != null">
gary's avatar
gary committed
329
        name = #{name,jdbcType=VARCHAR},
330 331
      </if>
      <if test="code != null">
gary's avatar
gary committed
332
        code = #{code,jdbcType=VARCHAR},
333
      </if>
gary's avatar
gary committed
334 335 336
      <if test="operationPermList != null">
        operation_perm_list = #{operationPermList,jdbcType=VARCHAR},
      </if>
gary's avatar
gary committed
337 338
      <if test="parentId != null">
        parent_id = #{parentId,jdbcType=VARCHAR},
339 340
      </if>
      <if test="isActive != null">
gary's avatar
gary committed
341
        is_active = #{isActive,jdbcType=BIT},
342
      </if>
gary's avatar
gary committed
343 344
      <if test="pLevel != null">
        p_level = #{pLevel,jdbcType=SMALLINT},
345 346
      </if>
      <if test="relyOnCodes != null">
gary's avatar
gary committed
347
        rely_on_codes = #{relyOnCodes,jdbcType=VARCHAR},
348
      </if>
gary's avatar
gary committed
349 350
      <if test="menuId != null">
        menu_id = #{menuId,jdbcType=VARCHAR},
351
      </if>
gary's avatar
gary committed
352 353
      <if test="serviceTypeId != null">
        service_type_id = #{serviceTypeId,jdbcType=VARCHAR},
354 355
      </if>
      <if test="createTime != null">
gary's avatar
gary committed
356
        create_time = #{createTime,jdbcType=TIMESTAMP},
357 358
      </if>
      <if test="updateTime != null">
gary's avatar
gary committed
359
        update_time = #{updateTime,jdbcType=TIMESTAMP},
360 361
      </if>
    </set>
gary's avatar
gary committed
362
    where id = #{id,jdbcType=VARCHAR}
363
  </update>
364
  <update id="updateByPrimaryKey" parameterType="pwc.taxtech.atms.entity.Permission">
365 366 367 368
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
gary's avatar
gary committed
369 370 371
    update permission
    set name = #{name,jdbcType=VARCHAR},
      code = #{code,jdbcType=VARCHAR},
gary's avatar
gary committed
372
      operation_perm_list = #{operationPermList,jdbcType=VARCHAR},
gary's avatar
gary committed
373 374 375 376 377 378 379 380 381
      parent_id = #{parentId,jdbcType=VARCHAR},
      is_active = #{isActive,jdbcType=BIT},
      p_level = #{pLevel,jdbcType=SMALLINT},
      rely_on_codes = #{relyOnCodes,jdbcType=VARCHAR},
      menu_id = #{menuId,jdbcType=VARCHAR},
      service_type_id = #{serviceTypeId,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_time = #{updateTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=VARCHAR}
382
  </update>
383
  <select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.entity.PermissionExample" resultMap="BaseResultMap">
384 385 386 387 388 389 390 391 392
    <!--
      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
393
    from permission
394 395 396 397 398 399 400
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
401
</mapper>