FundNavMapper.xml 27.6 KB
Newer Older
张亚辉's avatar
张亚辉 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
<?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.FundNavMapper">
  <resultMap id="BaseResultMap" type="com.tanpu.fund.entity.generator.FundNav">
    <!--@mbg.generated-->
    <!--@Table fund_nav-->
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="fund_id" jdbcType="VARCHAR" property="fundId" />
    <result column="price_date" jdbcType="DATE" property="priceDate" />
    <result column="nav" jdbcType="DECIMAL" property="nav" />
    <result column="cumulative_nav" jdbcType="DECIMAL" property="cumulativeNav" />
    <result column="cumulative_nav_withdrawal" jdbcType="DECIMAL" property="cumulativeNavWithdrawal" />
    <result column="ishigh_or_low" jdbcType="INTEGER" property="ishighOrLow" />
    <result column="tohigh_nav_ratio" jdbcType="DECIMAL" property="tohighNavRatio" />
    <result column="create_by" jdbcType="VARCHAR" property="createBy" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_by" jdbcType="VARCHAR" property="updateBy" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="delete_tag" jdbcType="INTEGER" property="deleteTag" />
zp's avatar
zp committed
20
    <result column="pre_nav" jdbcType="DECIMAL" property="preNav" />
张亚辉's avatar
张亚辉 committed
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
  </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-->
    id, fund_id, price_date, nav, cumulative_nav, cumulative_nav_withdrawal, ishigh_or_low, 
zp's avatar
zp committed
85
    tohigh_nav_ratio, create_by, create_time, update_by, update_time, delete_tag, pre_nav
张亚辉's avatar
张亚辉 committed
86 87 88 89 90 91 92 93 94 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
  </sql>
  <select id="selectByExample" parameterType="com.tanpu.fund.entity.generator.FundNavExample" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from fund_nav
    <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">
    <!--@mbg.generated-->
    select 
    <include refid="Base_Column_List" />
    from fund_nav
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    <!--@mbg.generated-->
    delete from fund_nav
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="com.tanpu.fund.entity.generator.FundNavExample">
    <!--@mbg.generated-->
    delete from fund_nav
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.tanpu.fund.entity.generator.FundNav">
    <!--@mbg.generated-->
    insert into fund_nav (id, fund_id, price_date, 
      nav, cumulative_nav, cumulative_nav_withdrawal, 
      ishigh_or_low, tohigh_nav_ratio, create_by, 
      create_time, update_by, update_time, 
zp's avatar
zp committed
127
      delete_tag, pre_nav)
张亚辉's avatar
张亚辉 committed
128 129 130 131
    values (#{id,jdbcType=VARCHAR}, #{fundId,jdbcType=VARCHAR}, #{priceDate,jdbcType=DATE}, 
      #{nav,jdbcType=DECIMAL}, #{cumulativeNav,jdbcType=DECIMAL}, #{cumulativeNavWithdrawal,jdbcType=DECIMAL}, 
      #{ishighOrLow,jdbcType=INTEGER}, #{tohighNavRatio,jdbcType=DECIMAL}, #{createBy,jdbcType=VARCHAR}, 
      #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, 
zp's avatar
zp committed
132
      #{deleteTag,jdbcType=INTEGER}, #{preNav,jdbcType=DECIMAL})
张亚辉's avatar
张亚辉 committed
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176
  </insert>
  <insert id="insertSelective" parameterType="com.tanpu.fund.entity.generator.FundNav">
    <!--@mbg.generated-->
    insert into 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="cumulativeNavWithdrawal != null">
        cumulative_nav_withdrawal,
      </if>
      <if test="ishighOrLow != null">
        ishigh_or_low,
      </if>
      <if test="tohighNavRatio != null">
        tohigh_nav_ratio,
      </if>
      <if test="createBy != null">
        create_by,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="updateBy != null">
        update_by,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="deleteTag != null">
        delete_tag,
      </if>
zp's avatar
zp committed
177 178 179
      <if test="preNav != null">
        pre_nav,
      </if>
张亚辉's avatar
张亚辉 committed
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 210 211 212 213 214 215 216 217 218 219 220
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="fundId != null">
        #{fundId,jdbcType=VARCHAR},
      </if>
      <if test="priceDate != null">
        #{priceDate,jdbcType=DATE},
      </if>
      <if test="nav != null">
        #{nav,jdbcType=DECIMAL},
      </if>
      <if test="cumulativeNav != null">
        #{cumulativeNav,jdbcType=DECIMAL},
      </if>
      <if test="cumulativeNavWithdrawal != null">
        #{cumulativeNavWithdrawal,jdbcType=DECIMAL},
      </if>
      <if test="ishighOrLow != null">
        #{ishighOrLow,jdbcType=INTEGER},
      </if>
      <if test="tohighNavRatio != null">
        #{tohighNavRatio,jdbcType=DECIMAL},
      </if>
      <if test="createBy != null">
        #{createBy,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateBy != null">
        #{updateBy,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="deleteTag != null">
        #{deleteTag,jdbcType=INTEGER},
      </if>
zp's avatar
zp committed
221 222 223
      <if test="preNav != null">
        #{preNav,jdbcType=DECIMAL},
      </if>
张亚辉's avatar
张亚辉 committed
224 225 226 227 228 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 265 266 267 268 269 270 271 272 273 274 275
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.tanpu.fund.entity.generator.FundNavExample" resultType="java.lang.Long">
    <!--@mbg.generated-->
    select count(*) from fund_nav
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    <!--@mbg.generated-->
    update fund_nav
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=VARCHAR},
      </if>
      <if test="record.fundId != null">
        fund_id = #{record.fundId,jdbcType=VARCHAR},
      </if>
      <if test="record.priceDate != null">
        price_date = #{record.priceDate,jdbcType=DATE},
      </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.cumulativeNavWithdrawal != null">
        cumulative_nav_withdrawal = #{record.cumulativeNavWithdrawal,jdbcType=DECIMAL},
      </if>
      <if test="record.ishighOrLow != null">
        ishigh_or_low = #{record.ishighOrLow,jdbcType=INTEGER},
      </if>
      <if test="record.tohighNavRatio != null">
        tohigh_nav_ratio = #{record.tohighNavRatio,jdbcType=DECIMAL},
      </if>
      <if test="record.createBy != null">
        create_by = #{record.createBy,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updateBy != null">
        update_by = #{record.updateBy,jdbcType=VARCHAR},
      </if>
      <if test="record.updateTime != null">
        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.deleteTag != null">
        delete_tag = #{record.deleteTag,jdbcType=INTEGER},
      </if>
zp's avatar
zp committed
276 277 278
      <if test="record.preNav != null">
        pre_nav = #{record.preNav,jdbcType=DECIMAL},
      </if>
张亚辉's avatar
张亚辉 committed
279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    <!--@mbg.generated-->
    update fund_nav
    set id = #{record.id,jdbcType=VARCHAR},
      fund_id = #{record.fundId,jdbcType=VARCHAR},
      price_date = #{record.priceDate,jdbcType=DATE},
      nav = #{record.nav,jdbcType=DECIMAL},
      cumulative_nav = #{record.cumulativeNav,jdbcType=DECIMAL},
      cumulative_nav_withdrawal = #{record.cumulativeNavWithdrawal,jdbcType=DECIMAL},
      ishigh_or_low = #{record.ishighOrLow,jdbcType=INTEGER},
      tohigh_nav_ratio = #{record.tohighNavRatio,jdbcType=DECIMAL},
      create_by = #{record.createBy,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      update_by = #{record.updateBy,jdbcType=VARCHAR},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
zp's avatar
zp committed
299 300
      delete_tag = #{record.deleteTag,jdbcType=INTEGER},
      pre_nav = #{record.preNav,jdbcType=DECIMAL}
张亚辉's avatar
张亚辉 committed
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.tanpu.fund.entity.generator.FundNav">
    <!--@mbg.generated-->
    update fund_nav
    <set>
      <if test="fundId != null">
        fund_id = #{fundId,jdbcType=VARCHAR},
      </if>
      <if test="priceDate != null">
        price_date = #{priceDate,jdbcType=DATE},
      </if>
      <if test="nav != null">
        nav = #{nav,jdbcType=DECIMAL},
      </if>
      <if test="cumulativeNav != null">
        cumulative_nav = #{cumulativeNav,jdbcType=DECIMAL},
      </if>
      <if test="cumulativeNavWithdrawal != null">
        cumulative_nav_withdrawal = #{cumulativeNavWithdrawal,jdbcType=DECIMAL},
      </if>
      <if test="ishighOrLow != null">
        ishigh_or_low = #{ishighOrLow,jdbcType=INTEGER},
      </if>
      <if test="tohighNavRatio != null">
        tohigh_nav_ratio = #{tohighNavRatio,jdbcType=DECIMAL},
      </if>
      <if test="createBy != null">
        create_by = #{createBy,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateBy != null">
        update_by = #{updateBy,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="deleteTag != null">
        delete_tag = #{deleteTag,jdbcType=INTEGER},
      </if>
zp's avatar
zp committed
345 346 347
      <if test="preNav != null">
        pre_nav = #{preNav,jdbcType=DECIMAL},
      </if>
张亚辉's avatar
张亚辉 committed
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.tanpu.fund.entity.generator.FundNav">
    <!--@mbg.generated-->
    update fund_nav
    set fund_id = #{fundId,jdbcType=VARCHAR},
      price_date = #{priceDate,jdbcType=DATE},
      nav = #{nav,jdbcType=DECIMAL},
      cumulative_nav = #{cumulativeNav,jdbcType=DECIMAL},
      cumulative_nav_withdrawal = #{cumulativeNavWithdrawal,jdbcType=DECIMAL},
      ishigh_or_low = #{ishighOrLow,jdbcType=INTEGER},
      tohigh_nav_ratio = #{tohighNavRatio,jdbcType=DECIMAL},
      create_by = #{createBy,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_by = #{updateBy,jdbcType=VARCHAR},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
zp's avatar
zp committed
365 366
      delete_tag = #{deleteTag,jdbcType=INTEGER},
      pre_nav = #{preNav,jdbcType=DECIMAL}
张亚辉's avatar
张亚辉 committed
367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateBatch" parameterType="java.util.List">
    <!--@mbg.generated-->
    update fund_nav
    <trim prefix="set" suffixOverrides=",">
      <trim prefix="fund_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=VARCHAR} 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=VARCHAR} 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=VARCHAR} 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=VARCHAR} then #{item.cumulativeNav,jdbcType=DECIMAL}
        </foreach>
      </trim>
      <trim prefix="cumulative_nav_withdrawal = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=VARCHAR} then #{item.cumulativeNavWithdrawal,jdbcType=DECIMAL}
        </foreach>
      </trim>
      <trim prefix="ishigh_or_low = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=VARCHAR} then #{item.ishighOrLow,jdbcType=INTEGER}
        </foreach>
      </trim>
      <trim prefix="tohigh_nav_ratio = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=VARCHAR} then #{item.tohighNavRatio,jdbcType=DECIMAL}
        </foreach>
      </trim>
      <trim prefix="create_by = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=VARCHAR} then #{item.createBy,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="create_time = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
        </foreach>
      </trim>
      <trim prefix="update_by = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=VARCHAR} then #{item.updateBy,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="update_time = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=VARCHAR} then #{item.updateTime,jdbcType=TIMESTAMP}
        </foreach>
      </trim>
      <trim prefix="delete_tag = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=VARCHAR} then #{item.deleteTag,jdbcType=INTEGER}
        </foreach>
      </trim>
zp's avatar
zp committed
433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538
      <trim prefix="pre_nav = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=VARCHAR} then #{item.preNav,jdbcType=DECIMAL}
        </foreach>
      </trim>
    </trim>
    where id in
    <foreach close=")" collection="list" item="item" open="(" separator=", ">
      #{item.id,jdbcType=VARCHAR}
    </foreach>
  </update>
  <update id="updateBatchSelective" parameterType="java.util.List">
    <!--@mbg.generated-->
    update 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=VARCHAR} then #{item.fundId,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="price_date = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.priceDate != null">
            when id = #{item.id,jdbcType=VARCHAR} then #{item.priceDate,jdbcType=DATE}
          </if>
        </foreach>
      </trim>
      <trim prefix="nav = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.nav != null">
            when id = #{item.id,jdbcType=VARCHAR} then #{item.nav,jdbcType=DECIMAL}
          </if>
        </foreach>
      </trim>
      <trim prefix="cumulative_nav = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.cumulativeNav != null">
            when id = #{item.id,jdbcType=VARCHAR} then #{item.cumulativeNav,jdbcType=DECIMAL}
          </if>
        </foreach>
      </trim>
      <trim prefix="cumulative_nav_withdrawal = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.cumulativeNavWithdrawal != null">
            when id = #{item.id,jdbcType=VARCHAR} then #{item.cumulativeNavWithdrawal,jdbcType=DECIMAL}
          </if>
        </foreach>
      </trim>
      <trim prefix="ishigh_or_low = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.ishighOrLow != null">
            when id = #{item.id,jdbcType=VARCHAR} then #{item.ishighOrLow,jdbcType=INTEGER}
          </if>
        </foreach>
      </trim>
      <trim prefix="tohigh_nav_ratio = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.tohighNavRatio != null">
            when id = #{item.id,jdbcType=VARCHAR} then #{item.tohighNavRatio,jdbcType=DECIMAL}
          </if>
        </foreach>
      </trim>
      <trim prefix="create_by = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.createBy != null">
            when id = #{item.id,jdbcType=VARCHAR} then #{item.createBy,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="create_time = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.createTime != null">
            when id = #{item.id,jdbcType=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
          </if>
        </foreach>
      </trim>
      <trim prefix="update_by = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.updateBy != null">
            when id = #{item.id,jdbcType=VARCHAR} then #{item.updateBy,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="update_time = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.updateTime != null">
            when id = #{item.id,jdbcType=VARCHAR} then #{item.updateTime,jdbcType=TIMESTAMP}
          </if>
        </foreach>
      </trim>
      <trim prefix="delete_tag = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.deleteTag != null">
            when id = #{item.id,jdbcType=VARCHAR} then #{item.deleteTag,jdbcType=INTEGER}
          </if>
        </foreach>
      </trim>
      <trim prefix="pre_nav = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.preNav != null">
            when id = #{item.id,jdbcType=VARCHAR} then #{item.preNav,jdbcType=DECIMAL}
          </if>
        </foreach>
      </trim>
张亚辉's avatar
张亚辉 committed
539 540 541 542 543 544 545 546 547 548
    </trim>
    where id in
    <foreach close=")" collection="list" item="item" open="(" separator=", ">
      #{item.id,jdbcType=VARCHAR}
    </foreach>
  </update>
  <insert id="batchInsert" parameterType="map">
    <!--@mbg.generated-->
    insert into fund_nav
    (id, fund_id, price_date, nav, cumulative_nav, cumulative_nav_withdrawal, ishigh_or_low, 
zp's avatar
zp committed
549 550
      tohigh_nav_ratio, create_by, create_time, update_by, update_time, delete_tag, pre_nav
      )
张亚辉's avatar
张亚辉 committed
551 552 553 554 555 556
    values
    <foreach collection="list" item="item" separator=",">
      (#{item.id,jdbcType=VARCHAR}, #{item.fundId,jdbcType=VARCHAR}, #{item.priceDate,jdbcType=DATE}, 
        #{item.nav,jdbcType=DECIMAL}, #{item.cumulativeNav,jdbcType=DECIMAL}, #{item.cumulativeNavWithdrawal,jdbcType=DECIMAL}, 
        #{item.ishighOrLow,jdbcType=INTEGER}, #{item.tohighNavRatio,jdbcType=DECIMAL}, 
        #{item.createBy,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.updateBy,jdbcType=VARCHAR}, 
zp's avatar
zp committed
557 558
        #{item.updateTime,jdbcType=TIMESTAMP}, #{item.deleteTag,jdbcType=INTEGER}, #{item.preNav,jdbcType=DECIMAL}
        )
张亚辉's avatar
张亚辉 committed
559 560 561 562 563 564
    </foreach>
  </insert>
  <insert id="insertOrUpdate" parameterType="com.tanpu.fund.entity.generator.FundNav">
    <!--@mbg.generated-->
    insert into fund_nav
    (id, fund_id, price_date, nav, cumulative_nav, cumulative_nav_withdrawal, ishigh_or_low, 
zp's avatar
zp committed
565 566
      tohigh_nav_ratio, create_by, create_time, update_by, update_time, delete_tag, pre_nav
      )
张亚辉's avatar
张亚辉 committed
567 568 569 570 571
    values
    (#{id,jdbcType=VARCHAR}, #{fundId,jdbcType=VARCHAR}, #{priceDate,jdbcType=DATE}, 
      #{nav,jdbcType=DECIMAL}, #{cumulativeNav,jdbcType=DECIMAL}, #{cumulativeNavWithdrawal,jdbcType=DECIMAL}, 
      #{ishighOrLow,jdbcType=INTEGER}, #{tohighNavRatio,jdbcType=DECIMAL}, #{createBy,jdbcType=VARCHAR}, 
      #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, 
zp's avatar
zp committed
572
      #{deleteTag,jdbcType=INTEGER}, #{preNav,jdbcType=DECIMAL})
张亚辉's avatar
张亚辉 committed
573 574 575 576 577 578 579 580 581 582 583 584 585
    on duplicate key update 
    id = #{id,jdbcType=VARCHAR}, 
    fund_id = #{fundId,jdbcType=VARCHAR}, 
    price_date = #{priceDate,jdbcType=DATE}, 
    nav = #{nav,jdbcType=DECIMAL}, 
    cumulative_nav = #{cumulativeNav,jdbcType=DECIMAL}, 
    cumulative_nav_withdrawal = #{cumulativeNavWithdrawal,jdbcType=DECIMAL}, 
    ishigh_or_low = #{ishighOrLow,jdbcType=INTEGER}, 
    tohigh_nav_ratio = #{tohighNavRatio,jdbcType=DECIMAL}, 
    create_by = #{createBy,jdbcType=VARCHAR}, 
    create_time = #{createTime,jdbcType=TIMESTAMP}, 
    update_by = #{updateBy,jdbcType=VARCHAR}, 
    update_time = #{updateTime,jdbcType=TIMESTAMP}, 
zp's avatar
zp committed
586 587
    delete_tag = #{deleteTag,jdbcType=INTEGER}, 
    pre_nav = #{preNav,jdbcType=DECIMAL}
张亚辉's avatar
张亚辉 committed
588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631
  </insert>
  <insert id="insertOrUpdateSelective" parameterType="com.tanpu.fund.entity.generator.FundNav">
    <!--@mbg.generated-->
    insert into 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="cumulativeNavWithdrawal != null">
        cumulative_nav_withdrawal,
      </if>
      <if test="ishighOrLow != null">
        ishigh_or_low,
      </if>
      <if test="tohighNavRatio != null">
        tohigh_nav_ratio,
      </if>
      <if test="createBy != null">
        create_by,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="updateBy != null">
        update_by,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="deleteTag != null">
        delete_tag,
      </if>
zp's avatar
zp committed
632 633 634
      <if test="preNav != null">
        pre_nav,
      </if>
张亚辉's avatar
张亚辉 committed
635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676
    </trim>
    values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="fundId != null">
        #{fundId,jdbcType=VARCHAR},
      </if>
      <if test="priceDate != null">
        #{priceDate,jdbcType=DATE},
      </if>
      <if test="nav != null">
        #{nav,jdbcType=DECIMAL},
      </if>
      <if test="cumulativeNav != null">
        #{cumulativeNav,jdbcType=DECIMAL},
      </if>
      <if test="cumulativeNavWithdrawal != null">
        #{cumulativeNavWithdrawal,jdbcType=DECIMAL},
      </if>
      <if test="ishighOrLow != null">
        #{ishighOrLow,jdbcType=INTEGER},
      </if>
      <if test="tohighNavRatio != null">
        #{tohighNavRatio,jdbcType=DECIMAL},
      </if>
      <if test="createBy != null">
        #{createBy,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateBy != null">
        #{updateBy,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="deleteTag != null">
        #{deleteTag,jdbcType=INTEGER},
      </if>
zp's avatar
zp committed
677 678 679
      <if test="preNav != null">
        #{preNav,jdbcType=DECIMAL},
      </if>
张亚辉's avatar
张亚辉 committed
680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721
    </trim>
    on duplicate key update 
    <trim suffixOverrides=",">
      <if test="id != null">
        id = #{id,jdbcType=VARCHAR},
      </if>
      <if test="fundId != null">
        fund_id = #{fundId,jdbcType=VARCHAR},
      </if>
      <if test="priceDate != null">
        price_date = #{priceDate,jdbcType=DATE},
      </if>
      <if test="nav != null">
        nav = #{nav,jdbcType=DECIMAL},
      </if>
      <if test="cumulativeNav != null">
        cumulative_nav = #{cumulativeNav,jdbcType=DECIMAL},
      </if>
      <if test="cumulativeNavWithdrawal != null">
        cumulative_nav_withdrawal = #{cumulativeNavWithdrawal,jdbcType=DECIMAL},
      </if>
      <if test="ishighOrLow != null">
        ishigh_or_low = #{ishighOrLow,jdbcType=INTEGER},
      </if>
      <if test="tohighNavRatio != null">
        tohigh_nav_ratio = #{tohighNavRatio,jdbcType=DECIMAL},
      </if>
      <if test="createBy != null">
        create_by = #{createBy,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateBy != null">
        update_by = #{updateBy,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="deleteTag != null">
        delete_tag = #{deleteTag,jdbcType=INTEGER},
      </if>
zp's avatar
zp committed
722 723 724
      <if test="preNav != null">
        pre_nav = #{preNav,jdbcType=DECIMAL},
      </if>
张亚辉's avatar
张亚辉 committed
725 726 727
    </trim>
  </insert>
</mapper>