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