IfaImportedFundNavMapper.xml 16.8 KB
Newer Older
张亚辉's avatar
张亚辉 committed
1 2 3 4 5 6
<?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="com.tanpu.fund.mapper.generator.IfaImportedFundNavMapper">
  <resultMap id="BaseResultMap" type="com.tanpu.fund.entity.generator.IfaImportedFundNav">
    <!--@mbg.generated-->
    <!--@Table ifa_imported_fund_nav-->
zp's avatar
zp committed
7
    <id column="id" jdbcType="BIGINT" property="id" />
张亚辉's avatar
张亚辉 committed
8
    <result column="fund_id" jdbcType="VARCHAR" property="fundId" />
zp's avatar
zp committed
9
    <result column="price_date" jdbcType="DATE" property="priceDate" />
张亚辉's avatar
张亚辉 committed
10 11 12
    <result column="nav" jdbcType="DECIMAL" property="nav" />
    <result column="cumulative_nav" jdbcType="DECIMAL" property="cumulativeNav" />
    <result column="delete_tag" jdbcType="INTEGER" property="deleteTag" />
zp's avatar
zp committed
13
    <result column="org_id" jdbcType="VARCHAR" property="orgId" />
张亚辉's avatar
张亚辉 committed
14 15 16 17 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
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--@mbg.generated-->
    <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">
    <!--@mbg.generated-->
    <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">
    <!--@mbg.generated-->
zp's avatar
zp committed
77
    id, fund_id, price_date, nav, cumulative_nav, delete_tag, org_id
张亚辉's avatar
张亚辉 committed
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
  </sql>
  <select id="selectByExample" parameterType="com.tanpu.fund.entity.generator.IfaImportedFundNavExample" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from ifa_imported_fund_nav
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
zp's avatar
zp committed
94
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
张亚辉's avatar
张亚辉 committed
95
    <!--@mbg.generated-->
张亚辉's avatar
张亚辉 committed
96
    select
张亚辉's avatar
张亚辉 committed
97 98
    <include refid="Base_Column_List" />
    from ifa_imported_fund_nav
zp's avatar
zp committed
99
    where id = #{id,jdbcType=BIGINT}
张亚辉's avatar
张亚辉 committed
100
  </select>
zp's avatar
zp committed
101
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
张亚辉's avatar
张亚辉 committed
102 103
    <!--@mbg.generated-->
    delete from ifa_imported_fund_nav
zp's avatar
zp committed
104
    where id = #{id,jdbcType=BIGINT}
张亚辉's avatar
张亚辉 committed
105 106 107 108 109 110 111 112 113 114
  </delete>
  <delete id="deleteByExample" parameterType="com.tanpu.fund.entity.generator.IfaImportedFundNavExample">
    <!--@mbg.generated-->
    delete from ifa_imported_fund_nav
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.tanpu.fund.entity.generator.IfaImportedFundNav" useGeneratedKeys="true">
    <!--@mbg.generated-->
张亚辉's avatar
张亚辉 committed
115
    insert into ifa_imported_fund_nav (fund_id, price_date, nav,
zp's avatar
zp committed
116 117
      cumulative_nav, delete_tag, org_id
      )
张亚辉's avatar
张亚辉 committed
118
    values (#{fundId,jdbcType=VARCHAR}, #{priceDate,jdbcType=DATE}, #{nav,jdbcType=DECIMAL},
zp's avatar
zp committed
119 120
      #{cumulativeNav,jdbcType=DECIMAL}, #{deleteTag,jdbcType=INTEGER}, #{orgId,jdbcType=VARCHAR}
      )
张亚辉's avatar
张亚辉 committed
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
  </insert>
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.tanpu.fund.entity.generator.IfaImportedFundNav" useGeneratedKeys="true">
    <!--@mbg.generated-->
    insert into ifa_imported_fund_nav
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="fundId != null">
        fund_id,
      </if>
      <if test="priceDate != null">
        price_date,
      </if>
      <if test="nav != null">
        nav,
      </if>
      <if test="cumulativeNav != null">
        cumulative_nav,
      </if>
      <if test="deleteTag != null">
        delete_tag,
      </if>
zp's avatar
zp committed
141 142 143
      <if test="orgId != null">
        org_id,
      </if>
张亚辉's avatar
张亚辉 committed
144 145 146 147 148 149
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="fundId != null">
        #{fundId,jdbcType=VARCHAR},
      </if>
      <if test="priceDate != null">
zp's avatar
zp committed
150
        #{priceDate,jdbcType=DATE},
张亚辉's avatar
张亚辉 committed
151 152 153 154 155 156 157 158 159 160
      </if>
      <if test="nav != null">
        #{nav,jdbcType=DECIMAL},
      </if>
      <if test="cumulativeNav != null">
        #{cumulativeNav,jdbcType=DECIMAL},
      </if>
      <if test="deleteTag != null">
        #{deleteTag,jdbcType=INTEGER},
      </if>
zp's avatar
zp committed
161 162 163
      <if test="orgId != null">
        #{orgId,jdbcType=VARCHAR},
      </if>
张亚辉's avatar
张亚辉 committed
164 165 166 167 168 169 170 171 172 173 174 175 176 177
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.tanpu.fund.entity.generator.IfaImportedFundNavExample" resultType="java.lang.Long">
    <!--@mbg.generated-->
    select count(*) from ifa_imported_fund_nav
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    <!--@mbg.generated-->
    update ifa_imported_fund_nav
    <set>
      <if test="record.id != null">
zp's avatar
zp committed
178
        id = #{record.id,jdbcType=BIGINT},
张亚辉's avatar
张亚辉 committed
179 180 181 182 183
      </if>
      <if test="record.fundId != null">
        fund_id = #{record.fundId,jdbcType=VARCHAR},
      </if>
      <if test="record.priceDate != null">
zp's avatar
zp committed
184
        price_date = #{record.priceDate,jdbcType=DATE},
张亚辉's avatar
张亚辉 committed
185 186 187 188 189 190 191 192 193 194
      </if>
      <if test="record.nav != null">
        nav = #{record.nav,jdbcType=DECIMAL},
      </if>
      <if test="record.cumulativeNav != null">
        cumulative_nav = #{record.cumulativeNav,jdbcType=DECIMAL},
      </if>
      <if test="record.deleteTag != null">
        delete_tag = #{record.deleteTag,jdbcType=INTEGER},
      </if>
zp's avatar
zp committed
195 196 197
      <if test="record.orgId != null">
        org_id = #{record.orgId,jdbcType=VARCHAR},
      </if>
张亚辉's avatar
张亚辉 committed
198 199 200 201 202 203 204 205
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    <!--@mbg.generated-->
    update ifa_imported_fund_nav
zp's avatar
zp committed
206
    set id = #{record.id,jdbcType=BIGINT},
张亚辉's avatar
张亚辉 committed
207
      fund_id = #{record.fundId,jdbcType=VARCHAR},
zp's avatar
zp committed
208
      price_date = #{record.priceDate,jdbcType=DATE},
张亚辉's avatar
张亚辉 committed
209 210
      nav = #{record.nav,jdbcType=DECIMAL},
      cumulative_nav = #{record.cumulativeNav,jdbcType=DECIMAL},
zp's avatar
zp committed
211 212
      delete_tag = #{record.deleteTag,jdbcType=INTEGER},
      org_id = #{record.orgId,jdbcType=VARCHAR}
张亚辉's avatar
张亚辉 committed
213 214 215 216 217 218 219 220 221 222 223 224
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.tanpu.fund.entity.generator.IfaImportedFundNav">
    <!--@mbg.generated-->
    update ifa_imported_fund_nav
    <set>
      <if test="fundId != null">
        fund_id = #{fundId,jdbcType=VARCHAR},
      </if>
      <if test="priceDate != null">
zp's avatar
zp committed
225
        price_date = #{priceDate,jdbcType=DATE},
张亚辉's avatar
张亚辉 committed
226 227 228 229 230 231 232 233 234 235
      </if>
      <if test="nav != null">
        nav = #{nav,jdbcType=DECIMAL},
      </if>
      <if test="cumulativeNav != null">
        cumulative_nav = #{cumulativeNav,jdbcType=DECIMAL},
      </if>
      <if test="deleteTag != null">
        delete_tag = #{deleteTag,jdbcType=INTEGER},
      </if>
zp's avatar
zp committed
236 237 238
      <if test="orgId != null">
        org_id = #{orgId,jdbcType=VARCHAR},
      </if>
张亚辉's avatar
张亚辉 committed
239
    </set>
zp's avatar
zp committed
240
    where id = #{id,jdbcType=BIGINT}
张亚辉's avatar
张亚辉 committed
241 242 243 244 245
  </update>
  <update id="updateByPrimaryKey" parameterType="com.tanpu.fund.entity.generator.IfaImportedFundNav">
    <!--@mbg.generated-->
    update ifa_imported_fund_nav
    set fund_id = #{fundId,jdbcType=VARCHAR},
zp's avatar
zp committed
246
      price_date = #{priceDate,jdbcType=DATE},
张亚辉's avatar
张亚辉 committed
247 248
      nav = #{nav,jdbcType=DECIMAL},
      cumulative_nav = #{cumulativeNav,jdbcType=DECIMAL},
zp's avatar
zp committed
249 250 251
      delete_tag = #{deleteTag,jdbcType=INTEGER},
      org_id = #{orgId,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
张亚辉's avatar
张亚辉 committed
252 253 254 255 256 257 258
  </update>
  <update id="updateBatch" parameterType="java.util.List">
    <!--@mbg.generated-->
    update ifa_imported_fund_nav
    <trim prefix="set" suffixOverrides=",">
      <trim prefix="fund_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
zp's avatar
zp committed
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301
          when id = #{item.id,jdbcType=BIGINT} then #{item.fundId,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="price_date = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.priceDate,jdbcType=DATE}
        </foreach>
      </trim>
      <trim prefix="nav = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.nav,jdbcType=DECIMAL}
        </foreach>
      </trim>
      <trim prefix="cumulative_nav = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.cumulativeNav,jdbcType=DECIMAL}
        </foreach>
      </trim>
      <trim prefix="delete_tag = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.deleteTag,jdbcType=INTEGER}
        </foreach>
      </trim>
      <trim prefix="org_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.orgId,jdbcType=VARCHAR}
        </foreach>
      </trim>
    </trim>
    where id in
    <foreach close=")" collection="list" item="item" open="(" separator=", ">
      #{item.id,jdbcType=BIGINT}
    </foreach>
  </update>
  <update id="updateBatchSelective" parameterType="java.util.List">
    <!--@mbg.generated-->
    update ifa_imported_fund_nav
    <trim prefix="set" suffixOverrides=",">
      <trim prefix="fund_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.fundId != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.fundId,jdbcType=VARCHAR}
          </if>
张亚辉's avatar
张亚辉 committed
302 303 304 305
        </foreach>
      </trim>
      <trim prefix="price_date = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
zp's avatar
zp committed
306 307 308
          <if test="item.priceDate != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.priceDate,jdbcType=DATE}
          </if>
张亚辉's avatar
张亚辉 committed
309 310 311 312
        </foreach>
      </trim>
      <trim prefix="nav = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
zp's avatar
zp committed
313 314 315
          <if test="item.nav != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.nav,jdbcType=DECIMAL}
          </if>
张亚辉's avatar
张亚辉 committed
316 317 318 319
        </foreach>
      </trim>
      <trim prefix="cumulative_nav = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
zp's avatar
zp committed
320 321 322
          <if test="item.cumulativeNav != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.cumulativeNav,jdbcType=DECIMAL}
          </if>
张亚辉's avatar
张亚辉 committed
323 324 325 326
        </foreach>
      </trim>
      <trim prefix="delete_tag = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
zp's avatar
zp committed
327 328 329 330 331 332 333 334 335 336
          <if test="item.deleteTag != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.deleteTag,jdbcType=INTEGER}
          </if>
        </foreach>
      </trim>
      <trim prefix="org_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.orgId != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.orgId,jdbcType=VARCHAR}
          </if>
张亚辉's avatar
张亚辉 committed
337 338 339 340 341
        </foreach>
      </trim>
    </trim>
    where id in
    <foreach close=")" collection="list" item="item" open="(" separator=", ">
zp's avatar
zp committed
342
      #{item.id,jdbcType=BIGINT}
张亚辉's avatar
张亚辉 committed
343 344 345 346 347
    </foreach>
  </update>
  <insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
    <!--@mbg.generated-->
    insert into ifa_imported_fund_nav
zp's avatar
zp committed
348
    (fund_id, price_date, nav, cumulative_nav, delete_tag, org_id)
张亚辉's avatar
张亚辉 committed
349 350
    values
    <foreach collection="list" item="item" separator=",">
张亚辉's avatar
张亚辉 committed
351
      (#{item.fundId,jdbcType=VARCHAR}, #{item.priceDate,jdbcType=DATE}, #{item.nav,jdbcType=DECIMAL},
zp's avatar
zp committed
352 353
        #{item.cumulativeNav,jdbcType=DECIMAL}, #{item.deleteTag,jdbcType=INTEGER}, #{item.orgId,jdbcType=VARCHAR}
        )
张亚辉's avatar
张亚辉 committed
354 355 356 357 358 359 360 361 362 363 364 365 366 367
    </foreach>
  </insert>
  <insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.tanpu.fund.entity.generator.IfaImportedFundNav" useGeneratedKeys="true">
    <!--@mbg.generated-->
    insert into ifa_imported_fund_nav
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      fund_id,
      price_date,
      nav,
      cumulative_nav,
      delete_tag,
zp's avatar
zp committed
368
      org_id,
张亚辉's avatar
张亚辉 committed
369 370 371 372
    </trim>
    values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
zp's avatar
zp committed
373
        #{id,jdbcType=BIGINT},
张亚辉's avatar
张亚辉 committed
374 375
      </if>
      #{fundId,jdbcType=VARCHAR},
zp's avatar
zp committed
376
      #{priceDate,jdbcType=DATE},
张亚辉's avatar
张亚辉 committed
377 378 379
      #{nav,jdbcType=DECIMAL},
      #{cumulativeNav,jdbcType=DECIMAL},
      #{deleteTag,jdbcType=INTEGER},
zp's avatar
zp committed
380
      #{orgId,jdbcType=VARCHAR},
张亚辉's avatar
张亚辉 committed
381
    </trim>
张亚辉's avatar
张亚辉 committed
382
    on duplicate key update
张亚辉's avatar
张亚辉 committed
383 384
    <trim suffixOverrides=",">
      <if test="id != null">
zp's avatar
zp committed
385
        id = #{id,jdbcType=BIGINT},
张亚辉's avatar
张亚辉 committed
386 387
      </if>
      fund_id = #{fundId,jdbcType=VARCHAR},
zp's avatar
zp committed
388
      price_date = #{priceDate,jdbcType=DATE},
张亚辉's avatar
张亚辉 committed
389 390 391
      nav = #{nav,jdbcType=DECIMAL},
      cumulative_nav = #{cumulativeNav,jdbcType=DECIMAL},
      delete_tag = #{deleteTag,jdbcType=INTEGER},
zp's avatar
zp committed
392
      org_id = #{orgId,jdbcType=VARCHAR},
张亚辉's avatar
张亚辉 committed
393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416
    </trim>
  </insert>
  <insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id" parameterType="com.tanpu.fund.entity.generator.IfaImportedFundNav" useGeneratedKeys="true">
    <!--@mbg.generated-->
    insert into ifa_imported_fund_nav
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="fundId != null">
        fund_id,
      </if>
      <if test="priceDate != null">
        price_date,
      </if>
      <if test="nav != null">
        nav,
      </if>
      <if test="cumulativeNav != null">
        cumulative_nav,
      </if>
      <if test="deleteTag != null">
        delete_tag,
      </if>
zp's avatar
zp committed
417 418 419
      <if test="orgId != null">
        org_id,
      </if>
张亚辉's avatar
张亚辉 committed
420 421 422 423
    </trim>
    values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
zp's avatar
zp committed
424
        #{id,jdbcType=BIGINT},
张亚辉's avatar
张亚辉 committed
425 426 427 428 429
      </if>
      <if test="fundId != null">
        #{fundId,jdbcType=VARCHAR},
      </if>
      <if test="priceDate != null">
zp's avatar
zp committed
430
        #{priceDate,jdbcType=DATE},
张亚辉's avatar
张亚辉 committed
431 432 433 434 435 436 437 438 439 440
      </if>
      <if test="nav != null">
        #{nav,jdbcType=DECIMAL},
      </if>
      <if test="cumulativeNav != null">
        #{cumulativeNav,jdbcType=DECIMAL},
      </if>
      <if test="deleteTag != null">
        #{deleteTag,jdbcType=INTEGER},
      </if>
zp's avatar
zp committed
441 442 443
      <if test="orgId != null">
        #{orgId,jdbcType=VARCHAR},
      </if>
张亚辉's avatar
张亚辉 committed
444
    </trim>
张亚辉's avatar
张亚辉 committed
445
    on duplicate key update
张亚辉's avatar
张亚辉 committed
446 447
    <trim suffixOverrides=",">
      <if test="id != null">
zp's avatar
zp committed
448
        id = #{id,jdbcType=BIGINT},
张亚辉's avatar
张亚辉 committed
449 450 451 452 453
      </if>
      <if test="fundId != null">
        fund_id = #{fundId,jdbcType=VARCHAR},
      </if>
      <if test="priceDate != null">
zp's avatar
zp committed
454
        price_date = #{priceDate,jdbcType=DATE},
张亚辉's avatar
张亚辉 committed
455 456 457 458 459 460 461 462 463 464
      </if>
      <if test="nav != null">
        nav = #{nav,jdbcType=DECIMAL},
      </if>
      <if test="cumulativeNav != null">
        cumulative_nav = #{cumulativeNav,jdbcType=DECIMAL},
      </if>
      <if test="deleteTag != null">
        delete_tag = #{deleteTag,jdbcType=INTEGER},
      </if>
zp's avatar
zp committed
465 466 467
      <if test="orgId != null">
        org_id = #{orgId,jdbcType=VARCHAR},
      </if>
张亚辉's avatar
张亚辉 committed
468 469
    </trim>
  </insert>
张亚辉's avatar
张亚辉 committed
470
</mapper>