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