CellTemplateMapper.xml 17.3 KB
Newer Older
1 2 3 4 5 6 7 8
<?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.CellTemplateMapper">
  <resultMap id="BaseResultMap" type="pwc.taxtech.atms.entitiy.CellTemplate">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
9 10 11 12 13 14 15 16 17 18 19 20
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="report_template_id" jdbcType="BIGINT" property="reportTemplateId" />
    <result column="row_index" jdbcType="INTEGER" property="rowIndex" />
    <result column="row_name" jdbcType="VARCHAR" property="rowName" />
    <result column="column_index" jdbcType="INTEGER" property="columnIndex" />
    <result column="column_name" jdbcType="VARCHAR" property="columnName" />
    <result column="comment" jdbcType="VARCHAR" property="comment" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="copy_from_id" jdbcType="BIGINT" property="copyFromId" />
    <result column="data_type" jdbcType="INTEGER" property="dataType" />
    <result column="is_read_only" jdbcType="SMALLINT" property="isReadOnly" />
21 22
    <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 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
  </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>
            </foreach>
          </trim>
        </if>
      </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>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
95
    id, report_template_id, row_index, row_name, column_index, column_name, comment, 
96
    create_time, update_time, copy_from_id, data_type, is_read_only, create_by, update_by
97 98 99 100 101 102 103 104 105 106 107
  </sql>
  <select id="selectByExample" parameterType="pwc.taxtech.atms.entitiy.CellTemplateExample" resultMap="BaseResultMap">
    <!--
      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" />
108
    from cell_template
109 110 111 112 113 114 115
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
116
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
117 118 119 120 121 122
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select 
    <include refid="Base_Column_List" />
123 124
    from cell_template
    where id = #{id,jdbcType=BIGINT}
125
  </select>
126
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
127 128 129 130
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
131 132
    delete from cell_template
    where id = #{id,jdbcType=BIGINT}
133 134 135 136 137 138
  </delete>
  <delete id="deleteByExample" parameterType="pwc.taxtech.atms.entitiy.CellTemplateExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
139
    delete from cell_template
140 141 142 143 144 145 146 147 148
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="pwc.taxtech.atms.entitiy.CellTemplate">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
149 150 151
    insert into cell_template (id, report_template_id, row_index, 
      row_name, column_index, column_name, 
      comment, create_time, update_time, 
152 153
      copy_from_id, data_type, is_read_only, 
      create_by, update_by)
154
    values (#{id,jdbcType=BIGINT}, #{reportTemplateId,jdbcType=BIGINT}, #{rowIndex,jdbcType=INTEGER}, 
155 156
      #{rowName,jdbcType=VARCHAR}, #{columnIndex,jdbcType=INTEGER}, #{columnName,jdbcType=VARCHAR}, 
      #{comment,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, 
157 158
      #{copyFromId,jdbcType=BIGINT}, #{dataType,jdbcType=INTEGER}, #{isReadOnly,jdbcType=SMALLINT}, 
      #{createBy,jdbcType=VARCHAR}, #{updateBy,jdbcType=VARCHAR})
159 160 161 162 163 164
  </insert>
  <insert id="insertSelective" parameterType="pwc.taxtech.atms.entitiy.CellTemplate">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
165
    insert into cell_template
166
    <trim prefix="(" suffix=")" suffixOverrides=",">
167 168
      <if test="id != null">
        id,
169
      </if>
170 171
      <if test="reportTemplateId != null">
        report_template_id,
172 173
      </if>
      <if test="rowIndex != null">
174
        row_index,
175 176
      </if>
      <if test="rowName != null">
177
        row_name,
178 179
      </if>
      <if test="columnIndex != null">
180
        column_index,
181 182
      </if>
      <if test="columnName != null">
183
        column_name,
184 185
      </if>
      <if test="comment != null">
186
        comment,
187 188
      </if>
      <if test="createTime != null">
189
        create_time,
190 191
      </if>
      <if test="updateTime != null">
192
        update_time,
193
      </if>
194 195
      <if test="copyFromId != null">
        copy_from_id,
196 197
      </if>
      <if test="dataType != null">
198
        data_type,
199 200
      </if>
      <if test="isReadOnly != null">
201
        is_read_only,
202
      </if>
203 204 205 206 207 208
      <if test="createBy != null">
        create_by,
      </if>
      <if test="updateBy != null">
        update_by,
      </if>
209 210
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
211 212
      <if test="id != null">
        #{id,jdbcType=BIGINT},
213
      </if>
214 215
      <if test="reportTemplateId != null">
        #{reportTemplateId,jdbcType=BIGINT},
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237
      </if>
      <if test="rowIndex != null">
        #{rowIndex,jdbcType=INTEGER},
      </if>
      <if test="rowName != null">
        #{rowName,jdbcType=VARCHAR},
      </if>
      <if test="columnIndex != null">
        #{columnIndex,jdbcType=INTEGER},
      </if>
      <if test="columnName != null">
        #{columnName,jdbcType=VARCHAR},
      </if>
      <if test="comment != null">
        #{comment,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
238 239
      <if test="copyFromId != null">
        #{copyFromId,jdbcType=BIGINT},
240 241 242 243 244
      </if>
      <if test="dataType != null">
        #{dataType,jdbcType=INTEGER},
      </if>
      <if test="isReadOnly != null">
245
        #{isReadOnly,jdbcType=SMALLINT},
246
      </if>
247 248 249 250 251 252
      <if test="createBy != null">
        #{createBy,jdbcType=VARCHAR},
      </if>
      <if test="updateBy != null">
        #{updateBy,jdbcType=VARCHAR},
      </if>
253 254 255 256 257 258 259
    </trim>
  </insert>
  <select id="countByExample" parameterType="pwc.taxtech.atms.entitiy.CellTemplateExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
260
    select count(*) from cell_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.
    -->
270
    update cell_template
271
    <set>
272 273
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
274
      </if>
275 276
      <if test="record.reportTemplateId != null">
        report_template_id = #{record.reportTemplateId,jdbcType=BIGINT},
277 278
      </if>
      <if test="record.rowIndex != null">
279
        row_index = #{record.rowIndex,jdbcType=INTEGER},
280 281
      </if>
      <if test="record.rowName != null">
282
        row_name = #{record.rowName,jdbcType=VARCHAR},
283 284
      </if>
      <if test="record.columnIndex != null">
285
        column_index = #{record.columnIndex,jdbcType=INTEGER},
286 287
      </if>
      <if test="record.columnName != null">
288
        column_name = #{record.columnName,jdbcType=VARCHAR},
289 290
      </if>
      <if test="record.comment != null">
291
        comment = #{record.comment,jdbcType=VARCHAR},
292 293
      </if>
      <if test="record.createTime != null">
294
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
295 296
      </if>
      <if test="record.updateTime != null">
297
        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
298
      </if>
299 300
      <if test="record.copyFromId != null">
        copy_from_id = #{record.copyFromId,jdbcType=BIGINT},
301 302
      </if>
      <if test="record.dataType != null">
303
        data_type = #{record.dataType,jdbcType=INTEGER},
304 305
      </if>
      <if test="record.isReadOnly != null">
306
        is_read_only = #{record.isReadOnly,jdbcType=SMALLINT},
307
      </if>
308 309 310 311 312 313
      <if test="record.createBy != null">
        create_by = #{record.createBy,jdbcType=VARCHAR},
      </if>
      <if test="record.updateBy != null">
        update_by = #{record.updateBy,jdbcType=VARCHAR},
      </if>
314 315 316 317 318 319 320 321 322 323
    </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.
    -->
324 325 326 327 328 329 330 331 332 333 334 335
    update cell_template
    set id = #{record.id,jdbcType=BIGINT},
      report_template_id = #{record.reportTemplateId,jdbcType=BIGINT},
      row_index = #{record.rowIndex,jdbcType=INTEGER},
      row_name = #{record.rowName,jdbcType=VARCHAR},
      column_index = #{record.columnIndex,jdbcType=INTEGER},
      column_name = #{record.columnName,jdbcType=VARCHAR},
      comment = #{record.comment,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      copy_from_id = #{record.copyFromId,jdbcType=BIGINT},
      data_type = #{record.dataType,jdbcType=INTEGER},
336 337 338
      is_read_only = #{record.isReadOnly,jdbcType=SMALLINT},
      create_by = #{record.createBy,jdbcType=VARCHAR},
      update_by = #{record.updateBy,jdbcType=VARCHAR}
339 340 341 342 343 344 345 346 347
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="pwc.taxtech.atms.entitiy.CellTemplate">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
348
    update cell_template
349
    <set>
350 351
      <if test="reportTemplateId != null">
        report_template_id = #{reportTemplateId,jdbcType=BIGINT},
352 353
      </if>
      <if test="rowIndex != null">
354
        row_index = #{rowIndex,jdbcType=INTEGER},
355 356
      </if>
      <if test="rowName != null">
357
        row_name = #{rowName,jdbcType=VARCHAR},
358 359
      </if>
      <if test="columnIndex != null">
360
        column_index = #{columnIndex,jdbcType=INTEGER},
361 362
      </if>
      <if test="columnName != null">
363
        column_name = #{columnName,jdbcType=VARCHAR},
364 365
      </if>
      <if test="comment != null">
366
        comment = #{comment,jdbcType=VARCHAR},
367 368
      </if>
      <if test="createTime != null">
369
        create_time = #{createTime,jdbcType=TIMESTAMP},
370 371
      </if>
      <if test="updateTime != null">
372
        update_time = #{updateTime,jdbcType=TIMESTAMP},
373
      </if>
374 375
      <if test="copyFromId != null">
        copy_from_id = #{copyFromId,jdbcType=BIGINT},
376 377
      </if>
      <if test="dataType != null">
378
        data_type = #{dataType,jdbcType=INTEGER},
379 380
      </if>
      <if test="isReadOnly != null">
381
        is_read_only = #{isReadOnly,jdbcType=SMALLINT},
382
      </if>
383 384 385 386 387 388
      <if test="createBy != null">
        create_by = #{createBy,jdbcType=VARCHAR},
      </if>
      <if test="updateBy != null">
        update_by = #{updateBy,jdbcType=VARCHAR},
      </if>
389
    </set>
390
    where id = #{id,jdbcType=BIGINT}
391 392 393 394 395 396
  </update>
  <update id="updateByPrimaryKey" parameterType="pwc.taxtech.atms.entitiy.CellTemplate">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
397 398 399 400 401 402 403 404 405 406 407
    update cell_template
    set report_template_id = #{reportTemplateId,jdbcType=BIGINT},
      row_index = #{rowIndex,jdbcType=INTEGER},
      row_name = #{rowName,jdbcType=VARCHAR},
      column_index = #{columnIndex,jdbcType=INTEGER},
      column_name = #{columnName,jdbcType=VARCHAR},
      comment = #{comment,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      copy_from_id = #{copyFromId,jdbcType=BIGINT},
      data_type = #{dataType,jdbcType=INTEGER},
408 409 410
      is_read_only = #{isReadOnly,jdbcType=SMALLINT},
      create_by = #{createBy,jdbcType=VARCHAR},
      update_by = #{updateBy,jdbcType=VARCHAR}
411
    where id = #{id,jdbcType=BIGINT}
412 413 414 415 416 417 418 419 420 421 422
  </update>
  <select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.entitiy.CellTemplateExample" resultMap="BaseResultMap">
    <!--
      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" />
423
    from cell_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>
eddie.woo's avatar
eddie.woo committed
431 432 433 434 435 436 437 438

  <insert id="batchInsert">
    insert into CellTemplate (ID, ReportTemplateID, RowIndex,
    RowName, ColumnIndex, ColumnName,
    Comment, CreateTime, UpdateTime,
    CopyFromID, DataType, IsReadOnly
    )
    values
439
    <foreach collection="list" item="item" separator=",">
eddie.woo's avatar
eddie.woo committed
440 441 442 443 444
      (#{item.ID,jdbcType=VARCHAR}, #{item.reportTemplateID,jdbcType=VARCHAR}, #{item.rowIndex,jdbcType=INTEGER},
      #{item.rowName,jdbcType=VARCHAR}, #{item.columnIndex,jdbcType=INTEGER}, #{item.columnName,jdbcType=VARCHAR},
      #{item.comment,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.updateTime,jdbcType=TIMESTAMP},
      #{item.copyFromID,jdbcType=VARCHAR}, #{item.dataType,jdbcType=INTEGER}, #{item.isReadOnly,jdbcType=INTEGER}
      )
445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462
    </foreach>
  </insert>

  <insert id="batchInsert2">
    insert into cell_template (id, report_template_id, row_index,
    row_name, column_index, column_name,
    comment, create_time, update_time,
    copy_from_id, data_type, is_read_only, create_by, update_by
    )
    values
    <foreach collection="list" item="item" separator=",">
      (#{item.id,jdbcType=INTEGER}, #{item.reportTemplateId,jdbcType=INTEGER}, #{item.rowIndex,jdbcType=INTEGER},
      #{item.rowName,jdbcType=VARCHAR}, #{item.columnIndex,jdbcType=INTEGER}, #{item.columnName,jdbcType=VARCHAR},
      #{item.comment,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.updateTime,jdbcType=TIMESTAMP},
      #{item.copyFromId,jdbcType=INTEGER}, #{item.dataType,jdbcType=INTEGER}, #{item.isReadOnly,jdbcType=SMALLINT},
      #{item.createBy,jdbcType=VARCHAR}, #{item.updateBy,jdbcType=VARCHAR}
      )
    </foreach>
eddie.woo's avatar
eddie.woo committed
463
  </insert>
464
</mapper>