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