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