fepmapper.xml 33.1 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 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 77 78 79 80 81 82 83 84 85 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 127 128 129 130 131 132 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 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 210 211 212 213 214 215 216 217 218 219 220 221 222 223 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 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 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 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 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 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 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 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 632 633 634
<?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.brilliance.isc.mda.dao.FepMapper">

    <resultMap id="BaseResultMap" type="com.brilliance.isc.bo.Fep">
        <result property="inr" column="inr" jdbcType="VARCHAR"/>
        <result property="feecod" column="feecod" jdbcType="VARCHAR"/>
        <result property="objtyp" column="objtyp" jdbcType="VARCHAR"/>
        <result property="objinr" column="objinr" jdbcType="VARCHAR"/>
        <result property="relobjtyp" column="relobjtyp" jdbcType="VARCHAR"/>
        <result property="relobjinr" column="relobjinr" jdbcType="VARCHAR"/>
        <result property="extkey" column="extkey" jdbcType="VARCHAR"/>
        <result property="nam" column="nam" jdbcType="VARCHAR"/>
        <result property="relcur" column="relcur" jdbcType="VARCHAR"/>
        <result property="relamt" column="relamt" jdbcType="DECIMAL"/>
        <result property="dat1" column="dat1" jdbcType="DATE"/>
        <result property="dat2" column="dat2" jdbcType="DATE"/>
        <result property="modflg" column="modflg" jdbcType="VARCHAR"/>
        <result property="unt" column="unt" jdbcType="INTEGER"/>
        <result property="untamt" column="untamt" jdbcType="DECIMAL"/>
        <result property="ratcal" column="ratcal" jdbcType="DECIMAL"/>
        <result property="rat" column="rat" jdbcType="DECIMAL"/>
        <result property="minmaxflg" column="minmaxflg" jdbcType="VARCHAR"/>
        <result property="cur" column="cur" jdbcType="VARCHAR"/>
        <result property="amt" column="amt" jdbcType="DECIMAL"/>
        <result property="xrfcur" column="xrfcur" jdbcType="VARCHAR"/>
        <result property="xrfamt" column="xrfamt" jdbcType="DECIMAL"/>
        <result property="feeacc" column="feeacc" jdbcType="VARCHAR"/>
        <result property="infdetstm" column="infdetstm" jdbcType="VARCHAR"/>
        <result property="ptyinr" column="ptyinr" jdbcType="VARCHAR"/>
        <result property="srctrninr" column="srctrninr" jdbcType="VARCHAR"/>
        <result property="srcdat" column="srcdat" jdbcType="DATE"/>
        <result property="rpltrninr" column="rpltrninr" jdbcType="VARCHAR"/>
        <result property="rpldat" column="rpldat" jdbcType="DATE"/>
        <result property="dontrninr" column="dontrninr" jdbcType="VARCHAR"/>
        <result property="dondat" column="dondat" jdbcType="DATE"/>
        <result property="advtrninr" column="advtrninr" jdbcType="VARCHAR"/>
        <result property="advdat" column="advdat" jdbcType="DATE"/>
        <result property="acrinr" column="acrinr" jdbcType="VARCHAR"/>
        <result property="sepinr" column="sepinr" jdbcType="VARCHAR"/>
        <result property="rol" column="rol" jdbcType="VARCHAR"/>
        <result property="ogiamt" column="ogiamt" jdbcType="DECIMAL"/>
        <result property="dctamt" column="dctamt" jdbcType="DECIMAL"/>
    </resultMap>

    <resultMap id="BaseResultMap2" type="com.brilliance.isc.vo.lg.ComcalVo">
        <result property="objinr" column="objinr" jdbcType="VARCHAR"/>
        <result property="objtyp" column="objtyp" jdbcType="VARCHAR"/>
        <result property="objref" column="objref" jdbcType="VARCHAR"/>
        <result property="trntyp" column="trntyp" jdbcType="VARCHAR"/>
        <result property="beginDate" column="beginDate" jdbcType="DATE"/>
        <result property="endDate" column="endDate" jdbcType="DATE"/>
        <result property="ptyinr" column="ptyinr" jdbcType="VARCHAR"/>
        <result property="ptyextkey" column="ptyextkey" jdbcType="VARCHAR"/>
        <result property="ptynam" column="ptynam" jdbcType="VARCHAR"/>
        <result property="feecod" column="feecod" jdbcType="VARCHAR"/>
        <result property="bchnam" column="bchnam" jdbcType="VARCHAR"/>
        <result property="opndat" column="opndat" jdbcType="DATE"/>
        <result property="expdat" column="expdat" jdbcType="DATE"/>
    </resultMap>

    <sql id="Base_Column_List">
        inr,feecod,objtyp,objinr,relobjtyp,relobjinr,extkey,nam,relcur,relamt,dat1,dat2,modflg,unt,untamt,ratcal,rat,minmaxflg,cur,amt,xrfcur,xrfamt,feeacc,infdetstm,ptyinr,srctrninr,srcdat,rpltrninr,rpldat,dontrninr,dondat,advtrninr,advdat,acrinr,sepinr,rol,ogiamt,dctamt
    </sql>

    <select id="selectByPrimaryKey" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from fep
        where inr = #{inr,jdbcType=VARCHAR}
    </select>

    <select id="selectByInr" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from fep
        where inr = #{inr,jdbcType=VARCHAR}
    </select>

    <select id="selectByCommonConditions" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from fep
        where relobjtyp = #{relObjTyp,jdbcType=VARCHAR} and relobjinr = #{relObjInr,jdbcType=VARCHAR} and feecod =
        #{feeCod,jdbcType=VARCHAR} and rpltrninr = #{rplTrnInr,jdbcType=VARCHAR} and inr = #{inr,jdbcType=VARCHAR}
        <if test="src!=null and (src=='P' or src=='D' or src=='A' or src=='O')">
            and (not inr = #{fepInr,jdbcType=VARCHAR})
        </if>
        <if test="dat1!=null and dat2!=null">
            <![CDATA[
            and ( not dat1 < #{dat1,jdbcType=DATE} ) and ( not dat2 > #{dat2,jdbcType=DATE})
            ]]>
        </if>
    </select>

    <select id="selectMinDat1" resultMap="BaseResultMap">
        select min(dat1) from fep where relobjinr = #{relObjInr,jdbcType=VARCHAR} and relobjtyp ='PTE' and dat2 =
        #{dat2,jdbcType=DATE}
    </select>

    <delete id="deleteByPrimaryKey">
        delete from fep
        where inr = #{inr,jdbcType=VARCHAR}
    </delete>

    <insert id="insert">
        insert into fep (<include refid="Base_Column_List"/>)
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            #{inr,jdbcType=VARCHAR},
            #{feecod,jdbcType=VARCHAR},
            #{objtyp,jdbcType=VARCHAR},
            #{objinr,jdbcType=VARCHAR},
            #{relobjtyp,jdbcType=VARCHAR},
            #{relobjinr,jdbcType=VARCHAR},
            #{extkey,jdbcType=VARCHAR},
            #{nam,jdbcType=VARCHAR},
            #{relcur,jdbcType=VARCHAR},
            #{relamt,jdbcType=DECIMAL},
            #{dat1,jdbcType=DATE},
            #{dat2,jdbcType=DATE},
            #{modflg,jdbcType=VARCHAR},
            #{unt,jdbcType=INTEGER},
            #{untamt,jdbcType=DECIMAL},
            #{ratcal,jdbcType=DECIMAL},
            #{rat,jdbcType=DECIMAL},
            #{minmaxflg,jdbcType=VARCHAR},
            #{cur,jdbcType=VARCHAR},
            #{amt,jdbcType=DECIMAL},
            #{xrfcur,jdbcType=VARCHAR},
            #{xrfamt,jdbcType=DECIMAL},
            #{feeacc,jdbcType=VARCHAR},
            #{infdetstm,jdbcType=VARCHAR},
            #{ptyinr,jdbcType=VARCHAR},
            #{srctrninr,jdbcType=VARCHAR},
            #{srcdat,jdbcType=DATE},
            #{rpltrninr,jdbcType=VARCHAR},
            #{rpldat,jdbcType=DATE},
            #{dontrninr,jdbcType=VARCHAR},
            #{dondat,jdbcType=DATE},
            #{advtrninr,jdbcType=VARCHAR},
            #{advdat,jdbcType=DATE},
            #{acrinr,jdbcType=VARCHAR},
            #{sepinr,jdbcType=VARCHAR},
            #{rol,jdbcType=VARCHAR},
            #{ogiamt,jdbcType=DECIMAL},
            #{dctamt,jdbcType=DECIMAL},
        </trim>
    </insert>

    <insert id="insertSelective">
        insert into fep
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="inr != null">inr,</if>
            <if test="feecod != null">feecod,</if>
            <if test="objtyp != null">objtyp,</if>
            <if test="objinr != null">objinr,</if>
            <if test="relobjtyp != null">relobjtyp,</if>
            <if test="relobjinr != null">relobjinr,</if>
            <if test="extkey != null">extkey,</if>
            <if test="nam != null">nam,</if>
            <if test="relcur != null">relcur,</if>
            <if test="relamt != null">relamt,</if>
            <if test="dat1 != null">dat1,</if>
            <if test="dat2 != null">dat2,</if>
            <if test="modflg != null">modflg,</if>
            <if test="unt != null">unt,</if>
            <if test="untamt != null">untamt,</if>
            <if test="ratcal != null">ratcal,</if>
            <if test="rat != null">rat,</if>
            <if test="minmaxflg != null">minmaxflg,</if>
            <if test="cur != null">cur,</if>
            <if test="amt != null">amt,</if>
            <if test="xrfcur != null">xrfcur,</if>
            <if test="xrfamt != null">xrfamt,</if>
            <if test="feeacc != null">feeacc,</if>
            <if test="infdetstm != null">infdetstm,</if>
            <if test="ptyinr != null">ptyinr,</if>
            <if test="srctrninr != null">srctrninr,</if>
            <if test="srcdat != null">srcdat,</if>
            <if test="rpltrninr != null">rpltrninr,</if>
            <if test="rpldat != null">rpldat,</if>
            <if test="dontrninr != null">dontrninr,</if>
            <if test="dondat != null">dondat,</if>
            <if test="advtrninr != null">advtrninr,</if>
            <if test="advdat != null">advdat,</if>
            <if test="acrinr != null">acrinr,</if>
            <if test="sepinr != null">sepinr,</if>
            <if test="rol != null">rol,</if>
            <if test="ogiamt != null">ogiamt,</if>
            <if test="dctamt != null">dctamt,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="inr != null">#{inr,jdbcType=VARCHAR},</if>
            <if test="feecod != null">#{feecod,jdbcType=VARCHAR},</if>
            <if test="objtyp != null">#{objtyp,jdbcType=VARCHAR},</if>
            <if test="objinr != null">#{objinr,jdbcType=VARCHAR},</if>
            <if test="relobjtyp != null">#{relobjtyp,jdbcType=VARCHAR},</if>
            <if test="relobjinr != null">#{relobjinr,jdbcType=VARCHAR},</if>
            <if test="extkey != null">#{extkey,jdbcType=VARCHAR},</if>
            <if test="nam != null">#{nam,jdbcType=VARCHAR},</if>
            <if test="relcur != null">#{relcur,jdbcType=VARCHAR},</if>
            <if test="relamt != null">#{relamt,jdbcType=DECIMAL},</if>
            <if test="dat1 != null">#{dat1,jdbcType=DATE},</if>
            <if test="dat2 != null">#{dat2,jdbcType=DATE},</if>
            <if test="modflg != null">#{modflg,jdbcType=VARCHAR},</if>
            <if test="unt != null">#{unt,jdbcType=INTEGER},</if>
            <if test="untamt != null">#{untamt,jdbcType=DECIMAL},</if>
            <if test="ratcal != null">#{ratcal,jdbcType=DECIMAL},</if>
            <if test="rat != null">#{rat,jdbcType=DECIMAL},</if>
            <if test="minmaxflg != null">#{minmaxflg,jdbcType=VARCHAR},</if>
            <if test="cur != null">#{cur,jdbcType=VARCHAR},</if>
            <if test="amt != null">#{amt,jdbcType=DECIMAL},</if>
            <if test="xrfcur != null">#{xrfcur,jdbcType=VARCHAR},</if>
            <if test="xrfamt != null">#{xrfamt,jdbcType=DECIMAL},</if>
            <if test="feeacc != null">#{feeacc,jdbcType=VARCHAR},</if>
            <if test="infdetstm != null">#{infdetstm,jdbcType=VARCHAR},</if>
            <if test="ptyinr != null">#{ptyinr,jdbcType=VARCHAR},</if>
            <if test="srctrninr != null">#{srctrninr,jdbcType=VARCHAR},</if>
            <if test="srcdat != null">#{srcdat,jdbcType=DATE},</if>
            <if test="rpltrninr != null">#{rpltrninr,jdbcType=VARCHAR},</if>
            <if test="rpldat != null">#{rpldat,jdbcType=DATE},</if>
            <if test="dontrninr != null">#{dontrninr,jdbcType=VARCHAR},</if>
            <if test="dondat != null">#{dondat,jdbcType=DATE},</if>
            <if test="advtrninr != null">#{advtrninr,jdbcType=VARCHAR},</if>
            <if test="advdat != null">#{advdat,jdbcType=DATE},</if>
            <if test="acrinr != null">#{acrinr,jdbcType=VARCHAR},</if>
            <if test="sepinr != null">#{sepinr,jdbcType=VARCHAR},</if>
            <if test="rol != null">#{rol,jdbcType=VARCHAR},</if>
            <if test="ogiamt != null">#{ogiamt,jdbcType=DECIMAL},</if>
            <if test="dctamt != null">#{dctamt,jdbcType=DECIMAL},</if>
        </trim>
    </insert>

    <update id="updateByPrimaryKeySelective">
        update fep
        <set>
            <if test="feecod != null">feecod = #{feecod,jdbcType=VARCHAR},</if>
            <if test="objtyp != null">objtyp = #{objtyp,jdbcType=VARCHAR},</if>
            <if test="objinr != null">objinr = #{objinr,jdbcType=VARCHAR},</if>
            <if test="relobjtyp != null">relobjtyp = #{relobjtyp,jdbcType=VARCHAR},</if>
            <if test="relobjinr != null">relobjinr = #{relobjinr,jdbcType=VARCHAR},</if>
            <if test="extkey != null">extkey = #{extkey,jdbcType=VARCHAR},</if>
            <if test="nam != null">nam = #{nam,jdbcType=VARCHAR},</if>
            <if test="relcur != null">relcur = #{relcur,jdbcType=VARCHAR},</if>
            <if test="relamt != null">relamt = #{relamt,jdbcType=DECIMAL},</if>
            <if test="dat1 != null">dat1 = #{dat1,jdbcType=DATE},</if>
            <if test="dat2 != null">dat2 = #{dat2,jdbcType=DATE},</if>
            <if test="modflg != null">modflg = #{modflg,jdbcType=VARCHAR},</if>
            <if test="unt != null">unt = #{unt,jdbcType=INTEGER},</if>
            <if test="untamt != null">untamt = #{untamt,jdbcType=DECIMAL},</if>
            <if test="ratcal != null">ratcal = #{ratcal,jdbcType=DECIMAL},</if>
            <if test="rat != null">rat = #{rat,jdbcType=DECIMAL},</if>
            <if test="minmaxflg != null">minmaxflg = #{minmaxflg,jdbcType=VARCHAR},</if>
            <if test="cur != null">cur = #{cur,jdbcType=VARCHAR},</if>
            <if test="amt != null">amt = #{amt,jdbcType=DECIMAL},</if>
            <if test="xrfcur != null">xrfcur = #{xrfcur,jdbcType=VARCHAR},</if>
            <if test="xrfamt != null">xrfamt = #{xrfamt,jdbcType=DECIMAL},</if>
            <if test="feeacc != null">feeacc = #{feeacc,jdbcType=VARCHAR},</if>
            <if test="infdetstm != null">infdetstm = #{infdetstm,jdbcType=VARCHAR},</if>
            <if test="ptyinr != null">ptyinr = #{ptyinr,jdbcType=VARCHAR},</if>
            <if test="srctrninr != null">srctrninr = #{srctrninr,jdbcType=VARCHAR},</if>
            <if test="srcdat != null">srcdat = #{srcdat,jdbcType=DATE},</if>
            <if test="rpltrninr != null">rpltrninr = #{rpltrninr,jdbcType=VARCHAR},</if>
            <if test="rpldat != null">rpldat = #{rpldat,jdbcType=DATE},</if>
            <if test="dontrninr != null">dontrninr = #{dontrninr,jdbcType=VARCHAR},</if>
            <if test="dondat != null">dondat = #{dondat,jdbcType=DATE},</if>
            <if test="advtrninr != null">advtrninr = #{advtrninr,jdbcType=VARCHAR},</if>
            <if test="advdat != null">advdat = #{advdat,jdbcType=DATE},</if>
            <if test="acrinr != null">acrinr = #{acrinr,jdbcType=VARCHAR},</if>
            <if test="sepinr != null">sepinr = #{sepinr,jdbcType=VARCHAR},</if>
            <if test="rol != null">rol = #{rol,jdbcType=VARCHAR},</if>
            <if test="ogiamt != null">ogiamt = #{ogiamt,jdbcType=DECIMAL},</if>
            <if test="dctamt != null">dctamt = #{dctamt,jdbcType=DECIMAL},</if>
        </set>
        where inr = #{inr,jdbcType=VARCHAR}
    </update>

    <update id="updateByPrimaryKey">
        update fep
        <set>
            feecod = #{feecod,jdbcType=VARCHAR},
            objtyp = #{objtyp,jdbcType=VARCHAR},
            objinr = #{objinr,jdbcType=VARCHAR},
            relobjtyp = #{relobjtyp,jdbcType=VARCHAR},
            relobjinr = #{relobjinr,jdbcType=VARCHAR},
            extkey = #{extkey,jdbcType=VARCHAR},
            nam = #{nam,jdbcType=VARCHAR},
            relcur = #{relcur,jdbcType=VARCHAR},
            relamt = #{relamt,jdbcType=DECIMAL},
            dat1 = #{dat1,jdbcType=DATE},
            dat2 = #{dat2,jdbcType=DATE},
            modflg = #{modflg,jdbcType=VARCHAR},
            unt = #{unt,jdbcType=INTEGER},
            untamt = #{untamt,jdbcType=DECIMAL},
            ratcal = #{ratcal,jdbcType=DECIMAL},
            rat = #{rat,jdbcType=DECIMAL},
            minmaxflg = #{minmaxflg,jdbcType=VARCHAR},
            cur = #{cur,jdbcType=VARCHAR},
            amt = #{amt,jdbcType=DECIMAL},
            xrfcur = #{xrfcur,jdbcType=VARCHAR},
            xrfamt = #{xrfamt,jdbcType=DECIMAL},
            feeacc = #{feeacc,jdbcType=VARCHAR},
            infdetstm = #{infdetstm,jdbcType=VARCHAR},
            ptyinr = #{ptyinr,jdbcType=VARCHAR},
            srctrninr = #{srctrninr,jdbcType=VARCHAR},
            srcdat = #{srcdat,jdbcType=DATE},
            rpltrninr = #{rpltrninr,jdbcType=VARCHAR},
            rpldat = #{rpldat,jdbcType=DATE},
            dontrninr = #{dontrninr,jdbcType=VARCHAR},
            dondat = #{dondat,jdbcType=DATE},
            advtrninr = #{advtrninr,jdbcType=VARCHAR},
            advdat = #{advdat,jdbcType=DATE},
            acrinr = #{acrinr,jdbcType=VARCHAR},
            sepinr = #{sepinr,jdbcType=VARCHAR},
            rol = #{rol,jdbcType=VARCHAR},
            ogiamt = #{ogiamt,jdbcType=DECIMAL},
            dctamt = #{dctamt,jdbcType=DECIMAL},
        </set>
        where inr = #{inr,jdbcType=VARCHAR}
    </update>

    <delete id="deleteByIds">
        delete from act where inr in
        <foreach item="item" index="index" collection="collection" open="(" separator="," close=")">
            #{item}
        </foreach>
    </delete>

    <update id="dyncUpdate">
        update fep
        <set>
            <if test="module.feecod != null">feecod = #{module.feecod,jdbcType=VARCHAR},</if>
            <if test="module.objtyp != null">objtyp = #{module.objtyp,jdbcType=VARCHAR},</if>
            <if test="module.objinr != null">objinr = #{module.objinr,jdbcType=VARCHAR},</if>
            <if test="module.relobjtyp != null">relobjtyp = #{module.relobjtyp,jdbcType=VARCHAR},</if>
            <if test="module.relobjinr != null">relobjinr = #{module.relobjinr,jdbcType=VARCHAR},</if>
            <if test="module.extkey != null">extkey = #{module.extkey,jdbcType=VARCHAR},</if>
            <if test="module.nam != null">nam = #{module.nam,jdbcType=VARCHAR},</if>
            <if test="module.relcur != null">relcur = #{module.relcur,jdbcType=VARCHAR},</if>
            <if test="module.relamt != null">relamt = #{module.relamt,jdbcType=DECIMAL},</if>
            <if test="module.dat1 != null">dat1 = #{module.dat1,jdbcType=DATE},</if>
            <if test="module.dat2 != null">dat2 = #{module.dat2,jdbcType=DATE},</if>
            <if test="module.modflg != null">modflg = #{module.modflg,jdbcType=VARCHAR},</if>
            <if test="module.unt != null">unt = #{module.unt,jdbcType=INTEGER},</if>
            <if test="module.untamt != null">untamt = #{module.untamt,jdbcType=DECIMAL},</if>
            <if test="module.ratcal != null">ratcal = #{module.ratcal,jdbcType=DECIMAL},</if>
            <if test="module.rat != null">rat = #{module.rat,jdbcType=DECIMAL},</if>
            <if test="module.minmaxflg != null">minmaxflg = #{module.minmaxflg,jdbcType=VARCHAR},</if>
            <if test="module.cur != null">cur = #{module.cur,jdbcType=VARCHAR},</if>
            <if test="module.amt != null">amt = #{module.amt,jdbcType=DECIMAL},</if>
            <if test="module.xrfcur != null">xrfcur = #{module.xrfcur,jdbcType=VARCHAR},</if>
            <if test="module.xrfamt != null">xrfamt = #{module.xrfamt,jdbcType=DECIMAL},</if>
            <if test="module.feeacc != null">feeacc = #{module.feeacc,jdbcType=VARCHAR},</if>
            <if test="module.infdetstm != null">infdetstm = #{module.infdetstm,jdbcType=VARCHAR},</if>
            <if test="module.ptyinr != null">ptyinr = #{module.ptyinr,jdbcType=VARCHAR},</if>
            <if test="module.srctrninr != null">srctrninr = #{module.srctrninr,jdbcType=VARCHAR},</if>
            <if test="module.srcdat != null">srcdat = #{module.srcdat,jdbcType=DATE},</if>
            <if test="module.rpltrninr != null">rpltrninr = #{module.rpltrninr,jdbcType=VARCHAR},</if>
            <if test="module.rpldat != null">rpldat = #{module.rpldat,jdbcType=DATE},</if>
            <if test="module.dontrninr != null">dontrninr = #{module.dontrninr,jdbcType=VARCHAR},</if>
            <if test="module.dondat != null">dondat = #{module.dondat,jdbcType=DATE},</if>
            <if test="module.advtrninr != null">advtrninr = #{module.advtrninr,jdbcType=VARCHAR},</if>
            <if test="module.advdat != null">advdat = #{module.advdat,jdbcType=DATE},</if>
            <if test="module.acrinr != null">acrinr = #{module.acrinr,jdbcType=VARCHAR},</if>
            <if test="module.sepinr != null">sepinr = #{module.sepinr,jdbcType=VARCHAR},</if>
            <if test="module.rol != null">rol = #{module.rol,jdbcType=VARCHAR},</if>
            <if test="module.ogiamt != null">ogiamt = #{module.ogiamt,jdbcType=DECIMAL},</if>
            <if test="module.dctamt != null">dctamt = #{module.dctamt,jdbcType=DECIMAL},</if>
        </set>
        ${conditions}
    </update>

    <delete id="dyncDelete">
        ${sql}
    </delete>

    <select id="dyncRead" resultMap="BaseResultMap">
        ${sql}
    </select>


    <select id="queryFep" resultType="com.brilliance.isc.vo.lg.FepFcpInfVo">
        select fep.ptyinr ptyinr,fep.rol rol,fep.dontrninr dontrninr,fep.advtrninr advtrninr,fep.feecod feecod,fep.nam nam,
        fep.cur cur,fep.amt amt, fep.srcdat srcdat,trn.inifrm inifrm,trn.inr trninr,trn.relflg relflg,
        (case when (fep.dontrninr is not null and fep.dontrninr != '') then 'S'
        when (fep.advtrninr is not null and fep.advtrninr != '')  then 'A'
        else  'P' end)  disposition
        from fep fep,trn trn where fep.objtyp = #{objtyp} and fep.objinr = #{objinr} and  FEP.RPLTRNINR = ' ' AND FEP.SEPINR = ' '
        and trn.inr = fep.srctrninr
        <if test="feecod != null and feecod != ''">
            and  fep.feecod = #{feecod}
        </if>
        <if test="fepdsp != null and fepdsp != ''">
            <if test="fepdsp == 'A'.toString() ">
                and FEP.ADVTRNINR &lt;&gt; ' '
            </if>
            <if test="fepdsp == 'P'.toString() ">
                and   FEP.DONTRNINR = ' ' and FEP.ADVTRNINR = ' '
            </if>
            <if test="fepdsp == 'S'.toString() ">
                and   FEP.DONTRNINR &lt;&gt; ' '
            </if>
        </if>
        order by fep.ptyinr,fep.feecod
    </select>

    <delete id="deleteBySrctrninr">
        delete from FEP where SRCTRNINR = #{srctrninr}
    </delete>

    <update id="updateDontrninrByDontrninr">
        Update FEP set DONTRNINR = ' ', DONDAT = NULL where DONTRNINR = #{dontrninr}
    </update>

    <update id="updateRpltrninrByRpltrninr">
        Update FEP set RPLTRNINR = ' ', RPLDAT = NULL where RPLTRNINR =#{rpltrninr}
    </update>
    <select id="selectByDontrninr" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from fep
        where
        dontrninr = #{dontrninr,jdbcType=VARCHAR}
    </select>

    <select id="getComselList" resultType="com.brilliance.isc.vo.lg.ComselVo">
        select objtyp, objinr, objref, fecinr, ptyextkey, ptynam, trntyp, frm,
        beginDate, endDate, unt, feecod, calrul, ratcal, ratcur, untamt, feecur, feeamt,
        mincur, minamt, maxcur, maxamt, pertyp, calcbs from
        (select t1.objtyp objtyp, t1.objinr objinr, t2.ownref objref, t3.inr fecinr,
        t5.EXTKEY ptyextkey, t5.NAM1 ptynam, 'GJBH' trntyp, 'GITCOM' frm, max(dat2) beginDate,
        case t3.PERTYP
        when 'd' then DATE_ADD(max(dat2), INTERVAL 1 day)
        when 'm' then DATE_ADD(max(dat2), INTERVAL 30 day)
        when 'CALQTR' then DATE_ADD(max(dat2), INTERVAL 90 day)
        when 'y' then DATE_ADD(max(dat2), INTERVAL 360 day)
        when 'CALMON' then DATE_ADD(max(dat2), INTERVAL 1 month)
        when 'q' then DATE_ADD(max(dat2), INTERVAL 3 month)
        when 'DURHLF' then DATE_ADD(max(dat2), INTERVAL 6 month)
        end endDate,
        1 unt,t1.feecod feecod, t3.CALRUL calrul, t3.RATCAL ratcal, t3.RATCUR ratcur, t3.UNTAMT untamt, t1.cur feecur,
        t1.ogiamt feeamt, t3.MINCUR mincur, t3.MINAMT minamt, t3.MAXCUR maxcur,t3.MAXAMT maxamt, t3.PERTYP pertyp, t3.CALCBS calcbs
        from fep t1, gid t2, fec t3, fee t4, pty t5
        where t1.OBJTYP = 'GID' and t1.OBJINR = t2.INR and t1.FEECOD = t4.COD and t2.CLSDAT is null
        and t3.OBJTYP = 'GID' and t3.OBJINR = t2.INR and t3.FEEPRI = '6'
        and t3.FEEINR = t4.INR and t3.ENDDAT = '2299-12-31'
        and t1.PTYINR = t5.inr
        <if test="bchLst != null and bchLst.size() >0 ">
            and t2.bchkeyinr in
            <foreach item="bch" collection="bchLst" open="(" separator="," close=")">
                #{bch.inr}
            </foreach>
        </if>
        group by t1.objtyp desc, t1.objinr desc, t1.feecod desc
        union all
        select t1.objtyp objtyp, t1.objinr objinr, t2.ownref objref, t3.inr fecinr,
        t5.EXTKEY ptyextkey, t5.NAM1 ptynam, (case when t2.GARTYP = 'F' and t2.segtyp = '02' then 'HGBH' else 'GNBH' end) trntyp, 'NITCOM' frm, max(dat2) beginDate,
        case t3.PERTYP
        when 'd' then DATE_ADD(max(dat2), INTERVAL 1 day)
        when 'm' then DATE_ADD(max(dat2), INTERVAL 30 day)
        when 'CALQTR' then DATE_ADD(max(dat2), INTERVAL 90 day)
        when 'y' then DATE_ADD(max(dat2), INTERVAL 360 day)
        when 'CALMON' then DATE_ADD(max(dat2), INTERVAL 1 month)
        when 'q' then DATE_ADD(max(dat2), INTERVAL 3 month)
        when 'DURHLF' then DATE_ADD(max(dat2), INTERVAL 6 month)
        end endDate,
        1 unt,t1.feecod feecod, t3.CALRUL calrul, t3.RATCAL ratcal, t3.RATCUR ratcur, t3.UNTAMT untamt, t1.cur feecur,
        t1.ogiamt feeamt, t3.MINCUR mincur, t3.MINAMT minamt, t3.MAXCUR maxcur,t3.MAXAMT maxamt, t3.PERTYP pertyp, t3.CALCBS calcbs
        from fep t1, nid t2, fec t3, fee t4, pty t5, bch t6
        where t1.OBJTYP = 'NID' and t1.OBJINR = t2.INR and t1.FEECOD = t4.COD and t2.CLSDAT is null
        and t3.OBJTYP = 'NID' and t3.OBJINR = t2.INR and t3.FEEPRI = '6'
        and t3.FEEINR = t4.INR and t3.ENDDAT = '2299-12-31'
        and t1.PTYINR = t5.inr
        <if test="bchLst != null and bchLst.size() >0 ">
            and t2.bchkeyinr in
            <foreach item="bch" collection="bchLst" open="(" separator="," close=")">
                #{bch.inr}
            </foreach>
        </if>
        group by t1.objtyp desc, t1.objinr desc, t1.feecod) t
        where objinr != ''
        <if test="ptyExtkey != null and ptyExtkey != ''">
            AND (
            PTYEXTKEY LIKE concat(concat('%', #{ptyExtkey}), '%')
            or PTYNAM LIKE concat(concat('%', #{ptyExtkey}), '%')
            )
        </if>
        <if test="opndatfrom != null and opndatto != null">
            AND beginDate &gt;= #{opndatfrom}
            AND beginDate &lt;= #{opndatto}
        </if>
        <if test="gidopentyps != null and gidopentyps.length>0">
            and trntyp in
            <foreach item="gidopentypItem" collection="gidopentyps" open="(" separator="," close=")">
                #{gidopentypItem}
            </foreach>
        </if>
    </select>

    <select id="getComcalList" resultMap="BaseResultMap2">
        select objinr,objtyp,objref,trntyp,beginDate,endDate,ptyinr,ptyextkey,ptynam,feecod,bchnam,opndat,expdat,
        (select sum(amt) from fep where objinr = t.objinr and objtyp = t.objtyp and DONTRNINR = '' and RPLTRNINR = '' and feecod like 'GIAME%') ameamt,
        (select sum(amt) from fep where objinr = t.objinr and objtyp = t.objtyp and DONTRNINR = '' and RPLTRNINR = '' and feecod like 'TELEX%') telamt
        from
        (select distinct t1.inr objinr, 'GID' objtyp, t1.ownref objref,'GJBH' trntyp,
        (case when t1.FEECOLDAT is not null then t1.FEECOLDAT else t1.opndat end) beginDate,
        (case when t1.PURPOS = 'ISCO' or  t1.PURPOS = 'ICCO' then t1.LIADAT else t1.EXPDAT end) endDate,
        t1.opndat opndat,
        (case when t1.PURPOS = 'ISCO' or  t1.PURPOS = 'ICCO' then t1.LIADAT else t1.EXPDAT end) expdat,
        t3.inr ptyinr, t3.extkey ptyextkey, t3.NAM1 ptynam, t2.feecod, t4.bchname bchnam from gid t1,fep t2, pty t3, bch t4 where CLSDAT is null
        and t1.HNDTYP in ('OC','OL','OT') and t1.flwsta = 'R'
        and t2.objinr = t1.inr and t2.objtyp = 'GID'
        and t2.ptyinr = t3.inr and t2.feecod like 'GIOPN%'
        and t1.bchkeyinr = t4.inr
        <if test="bchLst != null and bchLst.size() >0 ">
            and t1.bchkeyinr in
            <foreach item="bch" collection="bchLst" open="(" separator="," close=")">
                #{bch.inr}
            </foreach>
        </if>
        union all
        select distinct t1.inr objinr, 'NID' objtyp, t1.ownref objref,
        (case when t1.GARTYP = 'F' and t1.segtyp = '02' then 'HGBH' else 'GNBH' end) trntyp,
        (case when t1.FEECOLDAT is not null then t1.FEECOLDAT else t1.opndat end) beginDate,
        (case when t1.HNDTYP = 'OC' then t1.LIADAT else t1.EXPDAT end) endDate,
        t1.opndat opndat,
        (case when t1.HNDTYP = 'OC' then t1.LIADAT else t1.EXPDAT end) expdat,
        t3.inr ptyinr, t3.extkey ptyextkey, t3.NAM1 ptynam, t2.feecod, t4.bchname bchnam from nid t1,fep t2, pty t3, bch t4 where CLSDAT is null
        and t1.HNDTYP in ('OC','OL','OT') and t1.flwsta = 'R'
        and t2.objinr = t1.inr and t2.objtyp = 'NID'
        and t2.ptyinr = t3.inr and t2.feecod like 'GIOPN%'
        and t1.bchkeyinr = t4.inr
        <if test="bchLst != null and bchLst.size() >0 ">
            and t1.bchkeyinr in
            <foreach item="bch" collection="bchLst" open="(" separator="," close=")">
                #{bch.inr}
            </foreach>
        </if>
        ) t
        where (endDate is null or beginDate &lt; endDate
        or exists (select inr from fep where objinr = t.objinr and objtyp = t.objtyp and DONTRNINR = '' and RPLTRNINR = '' and feecod like 'GIAME%')
        or exists (select inr from fep where objinr = t.objinr and objtyp = t.objtyp and DONTRNINR = '' and RPLTRNINR = '' and feecod like 'TELEX%'))
        <if test="ptyExtkey != null and ptyExtkey != ''">
            AND (
            PTYEXTKEY LIKE concat(concat('%', #{ptyExtkey}), '%')
            or PTYNAM LIKE concat(concat('%', #{ptyExtkey}), '%')
            )
        </if>
        <if test="seaownref != null and seaownref != ''">
            AND objref LIKE concat(concat('%', #{seaownref}), '%')
        </if>
        <if test="opndatfrom != null and opndatto != null">
            AND beginDate &gt;= #{opndatfrom}
            AND beginDate &lt;= #{opndatto}
        </if>
        <if test="gidopentyps != null and gidopentyps.length>0">
            and trntyp in
            <foreach item="gidopentypItem" collection="gidopentyps" open="(" separator="," close=")">
                #{gidopentypItem}
            </foreach>
        </if>
        order by opndat desc
    </select>

    <select id="listByFeeConVo" resultType="com.brilliance.isc.vo.manager.FeeConVo">
        select trn.OWNREF ownref,trn.BCHKEYINR bchkeyinr,f.inr fepinr,f.FEECOD feecod,f.OBJTYP OBJTYP ,f.objinr
        objinr,f.NAM nam,
        f.PTYINR ptyinr, y.EXTKEY ptyextkey,y.NAM1 ptynam,
        f.DAT1 dat1,f.DAT2 dat2, f.DONDAT dondat,f.cur cur,f.amt amt,f.OGIAMT ogiamt,(f.OGIAMT-f.amt) dctamt
        from fep f,pty y,trn trn
        where f.PTYINR = y.inr and f.ogiamt > 0
        and f.dontrninr = trn.inr and trn.relflg = 'R'
        <if test="ownref != null and ownref != ''">
            and trn.OWNREF like concat('%',#{ownref,jdbcType=VARCHAR},'%')
        </if>
        <if test="feecods != null and feecods.size() > 0">
            and f.FEECOD in
            <foreach collection="feecods" item="item" index="index" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
        <if test="ptyextkey != null and ptyextkey != ''">
            and (
            y.EXTKEY like concat('%',#{ptyextkey,jdbcType=VARCHAR},'%')
            or y.NAM1 like concat('%',#{ptyextkey,jdbcType=VARCHAR},'%')
            )
        </if>
        <if test="bchLst != null and bchLst.size() >0 ">
            and trn.bchkeyinr in
            <foreach item="bch" collection="bchLst" open="(" separator="," close=")">
                #{bch.inr}
            </foreach>
        </if>
        <if test="bustyps != null and bustyps.length > 0">
            and f.objtyp in
            <foreach item="bustyp" collection="bustyps" open="(" separator="," close=")">
                #{bustyp}
            </foreach>
        </if>
        <if test="dondat1 != null">
            and DONDAT &gt;= #{dondat1}
        </if>
        <if test="dondat2 != null">
            and DONDAT &lt;= #{dondat2}
        </if>
        order by dondat desc
    </select>

    <select id="getDomLcReport" resultType="com.brilliance.isc.vo.report.DomLcFeeReportVo">
        select b.bchkey,b.branch, f.feecod, f.xrfamt
        from fep f, trn partition (${part1},${part2}) t, bch b
        where f.srctrninr = t.inr
        and t.bchkeyinr = b.inr
        and t.relflg = 'R'
        and f.feecod in
        ('DISCOM', 'DAMEFE', 'DCANFE', 'DBACOM', 'DDISCR',
        'DSENBK', 'GYLFEE', 'DMJFEE', 'DADVFE', 'DADVAM', 'DPRECK')
        <if test="bchLst != null and bchLst.size() >0 and branch != '1000'.toString()">
            and t.BRANCHINR in
            <foreach item="bch" collection="bchLst" open="(" separator="," close=")">
                #{bch.inr}
            </foreach>
        </if>
        <if test="begdat != null and begdat != ''">
            and f.dondat >= #{begdat}
        </if>
        <if test="enddat != null and enddat != ''">
            and f.dondat &lt;= #{enddat}
        </if>
    </select>

</mapper>