<?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="ru.nbch.indicsearchservice.repository.indic.IndicMapper">
    <select id="getTableColumnsByTableNames" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT TBNAME, NAME
        FROM SYSIBM.SYSCOLUMNS
        WHERE TBCREATOR = 'INDIC'
        AND TBNAME IN
        <foreach item="table" collection="tables" open="(" separator="," close=")">
            #{table}
        </foreach>
        WITH UR
    </select>

    <select id="findAllByFidFromRuUid" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_UID
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuTrade" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_TRADE
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, ACC_SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuApplication" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_APPLICATION
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuAccountAmt" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_ACCOUNT_AMT
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, ACC_SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuAcquirerIndivid" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_ACQUIRERINDIVID
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuAcquirerLegal" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_ACQUIRERLEGAL
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuAllArrears" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_ALL_ARREARS
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuAmendment" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_AMENDMENT
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, ACC_SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuAmountInfo" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_AMOUNT_INFO
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuArrear" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_ARREAR
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, ACC_SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuBankruptcy" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_BANKRUPTCY
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuBankruptcyBlocks" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_BANKRUPTCY_BLOCKS
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuCapability" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_CAPABILITY
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuCoborrower" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_COBORROWER
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, ACC_SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuCollateral" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_COLLATERAL
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuCollateralBlocks" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_COLLATERAL_BLOCKS
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuCollatInsured" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_COLLATINSURED
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuCollatRepay" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_COLLATREPAY
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuContractTermsChanges" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_CONTRACT_TERMS_CHANGES
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuDebtBurdenInfo" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_DEBT_BURDEN_INFO
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuDueArrear" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_DUEARREAR
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, ACC_SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuFundDate" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_FUNDDATE
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, ACC_SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuGuaranteeRepay" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_GUARANTEEREPAY
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuGuarantor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_GUARANTOR
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuIndepGuarantor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_INDEPGUARANTOR
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuLegalRecord" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_LEGALRECORD
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuMonthAverPaymt" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_MONTHAVERPAYMT
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, ACC_SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuObligAccount" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_OBLIGACCOUNT
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuObligPartTake" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_OBLIGPARTTAKE
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuObligsRcBankrupt" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_OBLIGSRCBANKRUPT
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuObligsRcLiquid" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_OBLIGSRCLIQUID
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuObligTermination" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_OBLIGTERMINATION
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuOtherLegal" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_OTHERLEGAL
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuOverallval" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_OVERALLVAL
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, ACC_SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuPastDueArrear" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_PASTDUEARREAR
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, ACC_SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuPaymtCondition" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_PAYMT_CONDITION
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, ACC_SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuPaymt" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_PAYMT
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, ACC_SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuServiceCo" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_SERVICECO
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuSettled" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_SETTLED
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuSourceNonMonetOblig" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_SOURCENONMONETOBLIG
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, ACC_SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuSubjectNonMonetOblig" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_SUBJECTNONMONETOBLIG
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, SERIAL_NUM
        WITH UR
    </select>

    <select id="findAllByFidFromRuSubmitHold" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT *
        FROM INDIC.RU_SUBMITHOLD
        WHERE FID IN
        <foreach item="fid" collection="fids" open="(" separator="," close=")">
            #{fid}
        </foreach>
        ORDER BY FID, SERIAL_NUM
        WITH UR
    </select>


    <select id="findAllByAcctNumAndMemberCodeFromRuUid" resultType="java.util.LinkedHashMap" timeout="60">
        SELECT ${columns}
        FROM INDIC.RU_UID
        WHERE CAST(ACCT_NUM AS VARCHAR(2000)) = #{acctNum}
          AND (MEMBER_CODE LIKE #{memberCode} || '%'
            OR REAL_MEMBERCODE LIKE #{memberCode} || '%')
            WITH UR
    </select>

    <select id="findAllByAcctNumAndMemberCodeFromRuUidCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="60">
        SELECT ${columns}
        FROM INDIC.RU_UID
        WHERE CAST(ACCT_NUM AS VARCHAR(2000)) = #{acctNum}
          AND (MEMBER_CODE LIKE #{memberCode} || '%'
            OR REAL_MEMBERCODE LIKE #{memberCode} || '%')
            WITH UR
    </select>

    <select id="findAllByApplicationNumberAndMemberCodeFromRuApplication" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_APPLICATION
        WHERE APPLICATION_NUMBER = #{applicationNumber}
          AND (MEMBER_CODE LIKE #{memberCode} || '%'
            OR REAL_MEMBERCODE LIKE #{memberCode} || '%')
          AND (CANCELLATION_FLAG != 'Y' OR CANCELLATION_FLAG IS NULL)
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByApplicationNumberAndMemberCodeFromRuApplicationCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_APPLICATION
        WHERE APPLICATION_NUMBER = #{applicationNumber}
          AND (MEMBER_CODE LIKE #{memberCode} || '%'
            OR REAL_MEMBERCODE LIKE #{memberCode} || '%')
          AND (CANCELLATION_FLAG != 'Y' OR CANCELLATION_FLAG IS NULL)
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="countAllByApplicationNumberAndMemberCodeFromRuApplication" resultType="long" timeout="3600">
        SELECT COUNT(*)
        FROM INDIC.RU_APPLICATION
        WHERE APPLICATION_NUMBER = #{applicationNumber}
          AND (MEMBER_CODE LIKE #{memberCode} || '%'
            OR REAL_MEMBERCODE LIKE #{memberCode} || '%')
          AND (CANCELLATION_FLAG != 'Y' OR CANCELLATION_FLAG IS NULL)
            WITH UR
    </select>

    <select id="findAllByUuidFromRuUid" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_UID
        WHERE UUID = #{uuid}
          AND (MEMBER_CODE LIKE #{memberCode} || '%'
            OR REAL_MEMBERCODE LIKE #{memberCode} || '%')
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByUuidFromRuUidCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_UID
        WHERE UUID = #{uuid}
          AND (MEMBER_CODE LIKE #{memberCode} || '%'
            OR REAL_MEMBERCODE LIKE #{memberCode} || '%')
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByOgrnFromId" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT FID
        FROM INDIC.ID
        WHERE CAST(ID_NORM AS VARCHAR(2000)) = #{idNorm}
          AND (ID_TYPE LIKE '34' OR ID_TYPE LIKE '35' OR ID_TYPE2 LIKE 'regnumUL')
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByOgrnFromIdCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT DISTINCT FID
        FROM INDIC.ID
        WHERE CAST(ID_NORM AS VARCHAR(2000)) = #{idNorm}
          AND (ID_TYPE LIKE '34' OR ID_TYPE LIKE '35' OR ID_TYPE2 LIKE 'regnumUL')
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllDistinctFidByOgrnFromId" resultType="string" timeout="3600">
        SELECT DISTINCT FID
        FROM INDIC.ID
        WHERE CAST(ID_NORM AS VARCHAR(2000)) = #{idNorm}
          AND (ID_TYPE LIKE '34' OR ID_TYPE LIKE '35' OR ID_TYPE2 LIKE 'regnumUL')
            WITH UR
    </select>

    <select id="findAllByOgrnTutdfFromId" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT FID
        FROM INDIC.ID
        WHERE CAST(ID_NORM AS VARCHAR(2000)) = #{idNorm}
          AND ID_TYPE in ('34')
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByOgrnTutdfFromIdCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT DISTINCT FID
        FROM INDIC.ID
        WHERE CAST(ID_NORM AS VARCHAR(2000)) = #{idNorm}
          AND ID_TYPE in ('34')
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllDistinctFidByOgrnTutdfFromId" resultType="string" timeout="3600">
        SELECT DISTINCT FID
        FROM INDIC.ID
        WHERE CAST(ID_NORM AS VARCHAR(2000)) = #{idNorm}
          AND ID_TYPE in ('34')
            WITH UR
    </select>

    <select id="findAllByPassportFromId" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT FID
        FROM INDIC.ID
        WHERE CAST(ID_NORM AS VARCHAR(2000)) = #{idNorm}
          AND (ID_TYPE LIKE '21' OR ID_TYPE2 LIKE '21' OR ID_TYPE LIKE '10' OR ID_TYPE2 LIKE '31')
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByPassportFromIdCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT DISTINCT FID
        FROM INDIC.ID
        WHERE CAST(ID_NORM AS VARCHAR(2000)) = #{idNorm}
          AND (ID_TYPE LIKE '21' OR ID_TYPE2 LIKE '21' OR ID_TYPE LIKE '10' OR ID_TYPE2 LIKE '31')
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllDistinctFidByPassportFromId" resultType="string" timeout="3600">
        SELECT DISTINCT FID
        FROM INDIC.ID
        WHERE CAST(ID_NORM AS VARCHAR(2000)) = #{idNorm}
          AND (ID_TYPE LIKE '21' OR ID_TYPE2 LIKE '21' OR ID_TYPE LIKE '10' OR ID_TYPE2 LIKE '31')
            WITH UR
    </select>

    <select id="findAllByPassportTutdfFromId" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT FID
        FROM INDIC.ID
        WHERE CAST(ID_NORM AS VARCHAR(2000)) = #{idNorm}
          AND ID_TYPE in ('10', '21')
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByPassportTutdfFromIdCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="60">
        SELECT DISTINCT FID
        FROM INDIC.ID
        WHERE CAST(ID_NORM AS VARCHAR(2000)) = #{idNorm}
          AND ID_TYPE in ('10', '21')
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllDistinctFidByPassportTutdfFromId" resultType="string" timeout="3600">
        SELECT DISTINCT FID
        FROM INDIC.ID
        WHERE CAST(ID_NORM AS VARCHAR(2000)) = #{idNorm}
          AND ID_TYPE in ('10', '21')
            WITH UR
    </select>

    <select id="findAllByOldAppNumFromRuApplication" resultType="java.util.LinkedHashMap" timeout="60">
        SELECT ${columns}
        FROM INDIC.RU_APPLICATION
        WHERE CAST(OLD_APP_NUM AS VARCHAR(2000)) = #{oldAppNum}
          AND (MEMBER_CODE LIKE #{memberCode} || '%'
            OR REAL_MEMBERCODE LIKE #{memberCode} || '%')
          AND (CANCELLATION_FLAG != 'Y' OR CANCELLATION_FLAG IS NULL)
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByOldAppNumFromRuApplicationCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="60">
        SELECT ${columns}
        FROM INDIC.RU_APPLICATION
        WHERE CAST(OLD_APP_NUM AS VARCHAR(2000)) = #{oldAppNum}
          AND (MEMBER_CODE LIKE #{memberCode} || '%'
            OR REAL_MEMBERCODE LIKE #{memberCode} || '%')
          AND (CANCELLATION_FLAG != 'Y' OR CANCELLATION_FLAG IS NULL)
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="countAllByOldAppNumFromRuApplication" resultType="long" timeout="60">
        SELECT COUNT(*)
        FROM INDIC.RU_APPLICATION
        WHERE CAST(OLD_APP_NUM AS VARCHAR(2000)) = #{oldAppNum}
          AND (MEMBER_CODE LIKE #{memberCode} || '%'
            OR REAL_MEMBERCODE LIKE #{memberCode} || '%')
          AND (CANCELLATION_FLAG != 'Y' OR CANCELLATION_FLAG IS NULL)
            WITH UR
    </select>

    <select id="findAllByAcctNumFromAccount" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.ACCOUNT
        WHERE CAST(ACCT_NUM AS VARCHAR(2000)) = #{acctNum}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAcctNumFromAccountCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.ACCOUNT
        WHERE CAST(ACCT_NUM AS VARCHAR(2000)) = #{acctNum}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllBySerialNumFromAccount" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.ACCOUNT
        WHERE SERIAL_NUM = #{serialNum}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllBySerialNumFromAccountCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.ACCOUNT
        WHERE SERIAL_NUM = #{serialNum}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByUuidFromAccount" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.ACCOUNT
        WHERE UUID = #{uuid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByUuidFromAccountCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.ACCOUNT
        WHERE UUID = #{uuid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllBySerialNumAndMemberCodeFromInformation" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.INFORMATION
        WHERE SERIAL_NUM = #{serialNum}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
          AND (CANCELLATION_FLAG != 'Y' OR CANCELLATION_FLAG IS NULL)
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllBySerialNumAndMemberCodeFromInformationCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.INFORMATION
        WHERE SERIAL_NUM = #{serialNum}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
          AND (CANCELLATION_FLAG != 'Y' OR CANCELLATION_FLAG IS NULL)
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="countAllBySerialNumAndMemberCodeFromInformation" resultType="long" timeout="3600">
        SELECT COUNT(*)
        FROM INDIC.INFORMATION
        WHERE SERIAL_NUM = #{serialNum}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
          AND (CANCELLATION_FLAG != 'Y' OR CANCELLATION_FLAG IS NULL)
            WITH UR
    </select>

    <select id="findAllByAppNumAndMemberCodeFromInformation" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.INFORMATION
        WHERE CAST(APP_NUM AS VARCHAR(2000)) = #{appNum}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
          AND (CANCELLATION_FLAG != 'Y' OR CANCELLATION_FLAG IS NULL)
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAppNumAndMemberCodeFromInformationCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.INFORMATION
        WHERE CAST(APP_NUM AS VARCHAR(2000)) = #{appNum}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
          AND (CANCELLATION_FLAG != 'Y' OR CANCELLATION_FLAG IS NULL)
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="countAllByAppNumAndMemberCodeFromInformation" resultType="long" timeout="3600">
        SELECT COUNT(*)
        FROM INDIC.INFORMATION
        WHERE CAST(APP_NUM AS VARCHAR(2000)) = #{appNum}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
          AND (CANCELLATION_FLAG != 'Y' OR CANCELLATION_FLAG IS NULL)
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuTrade" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_TRADE
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuTradeCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_TRADE
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuAccountAmt" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_ACCOUNT_AMT
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuAccountAmtCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_ACCOUNT_AMT
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuCoborrower" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_COBORROWER
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuCoborrowerCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_COBORROWER
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuPaymtCondition" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_PAYMT_CONDITION
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuPaymtConditionCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_PAYMT_CONDITION
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuOverallval" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_OVERALLVAL
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuOverallvalCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_OVERALLVAL
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuAmendment" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_AMENDMENT
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuAmendmentCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_AMENDMENT
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuFunddate" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_FUNDDATE
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuFunddateCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_FUNDDATE
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuArrear" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_ARREAR
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuArrearCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_ARREAR
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuDuearrear" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_DUEARREAR
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuDuearrearCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_DUEARREAR
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuPastduearrear" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_PASTDUEARREAR
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuPastduearrearCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_PASTDUEARREAR
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuPaymt" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_PAYMT
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuPaymtCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_PAYMT
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuMonthaverpaymt" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_MONTHAVERPAYMT
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuMonthaverpaymtCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_MONTHAVERPAYMT
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuSourcenonmonetoblig" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_SOURCENONMONETOBLIG
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuSourcenonmonetobligCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_SOURCENONMONETOBLIG
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuSubjectnonmonetoblig" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_SUBJECTNONMONETOBLIG
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuSubjectnonmonetobligCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_SUBJECTNONMONETOBLIG
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuCollateral" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_COLLATERAL
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuCollateralCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_COLLATERAL
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="countAllByAccSerialNumAndFidFromRuCollateralWithBlocks" resultType="long" timeout="3600">
        SELECT COUNT(*)
        FROM (SELECT 1
              FROM INDIC.RU_COLLATERAL c
              WHERE c.ACC_SERIAL_NUM = #{accSerialNum}
                AND c.FID = #{fid}

              UNION ALL

              SELECT 1
              FROM INDIC.RU_COLLATERAL_BLOCKS b
                       JOIN INDIC.RU_COLLATERAL c
                            ON b.PARENT_SERIAL_NUM = c.SERIAL_NUM
                                AND b.FID = c.FID
              WHERE c.ACC_SERIAL_NUM = #{accSerialNum}
                AND c.FID = #{fid}) t
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuGuarantor" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_GUARANTOR
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuGuarantorCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_GUARANTOR
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuIndepguarantor" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_INDEPGUARANTOR
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuIndepguarantorCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_INDEPGUARANTOR
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuCollatinsured" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_COLLATINSURED
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuCollatinsuredCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_COLLATINSURED
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuCollatrepay" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_COLLATREPAY
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuCollatrepayCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_COLLATREPAY
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuGuaranteerepay" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_GUARANTEEREPAY
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuGuaranteerepayCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_GUARANTEEREPAY
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuObligtermination" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_OBLIGTERMINATION
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuObligterminationCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_OBLIGTERMINATION
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuSubmithold" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_SUBMITHOLD
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuSubmitholdCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_SUBMITHOLD
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuAcquirerlegal" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_ACQUIRERLEGAL
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuAcquirerlegalCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_ACQUIRERLEGAL
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuAcquirerindivid" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_ACQUIRERINDIVID
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuAcquirerindividCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_ACQUIRERINDIVID
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuServiceco" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_SERVICECO
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuServicecoCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_SERVICECO
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuObligaccount" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_OBLIGACCOUNT
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuObligaccountCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_OBLIGACCOUNT
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuLegalrecord" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_LEGALRECORD
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuLegalrecordCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_LEGALRECORD
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuObligsrcbankrupt" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_OBLIGSRCBANKRUPT
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuObligsrcbankruptCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_OBLIGSRCBANKRUPT
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuObligsrcliquid" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_OBLIGSRCLIQUID
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuObligsrcliquidCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_OBLIGSRCLIQUID
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuAmountInfo" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_AMOUNT_INFO
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuAmountInfoCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_AMOUNT_INFO
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuContractTermsChanges" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_CONTRACT_TERMS_CHANGES
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuContractTermsChangesCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_CONTRACT_TERMS_CHANGES
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuAllArrears" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_ALL_ARREARS
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromRuAllArrearsCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_ALL_ARREARS
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromAccountAmend" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.ACCOUNT_AMEND
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromAccountAmendCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.ACCOUNT_AMEND
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromPayment" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.PAYMENT
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromPaymentCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.PAYMENT
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromCollateral" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.COLLATERAL
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromCollateralCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.COLLATERAL
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromGuarantor" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.GUARANTOR
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromGuarantorCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.GUARANTOR
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromBankGuarantee" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.BANK_GUARANTEE
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByAccSerialNumAndFidFromBankGuaranteeCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.BANK_GUARANTEE
        WHERE ACC_SERIAL_NUM = #{accSerialNum}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
          AND FID = #{fid}
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByFidAndMemberCodeFromRuUid" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_UID
        WHERE FID = #{fid}
          AND (MEMBER_CODE LIKE #{memberCode} || '%'
            OR REAL_MEMBERCODE LIKE #{memberCode} || '%')
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByFidAndMemberCodeFromRuUidCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_UID
        WHERE FID = #{fid}
          AND (MEMBER_CODE LIKE #{memberCode} || '%'
            OR REAL_MEMBERCODE LIKE #{memberCode} || '%')
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByFidAndMemberCodeFromRuUidWithoutRealMemberCode" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_UID
        WHERE FID = #{fid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByFidAndMemberCodeFromRuUidWithoutRealMemberCodeCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_UID
        WHERE FID = #{fid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByFidAndMemberCodeFromRuApplication" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_APPLICATION
        WHERE FID = #{fid}
          AND (MEMBER_CODE LIKE #{memberCode} || '%'
            OR REAL_MEMBERCODE LIKE #{memberCode} || '%')
          AND (CANCELLATION_FLAG != 'Y' OR CANCELLATION_FLAG IS NULL)
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByFidAndMemberCodeFromRuApplicationCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_APPLICATION
        WHERE FID = #{fid}
          AND (MEMBER_CODE LIKE #{memberCode} || '%'
            OR REAL_MEMBERCODE LIKE #{memberCode} || '%')
          AND (CANCELLATION_FLAG != 'Y' OR CANCELLATION_FLAG IS NULL)
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="countAllByFidAndMemberCodeFromRuApplication" resultType="long" timeout="3600">
        SELECT COUNT(*)
        FROM INDIC.RU_APPLICATION
        WHERE FID = #{fid}
          AND (MEMBER_CODE LIKE #{memberCode} || '%'
            OR REAL_MEMBERCODE LIKE #{memberCode} || '%')
          AND (CANCELLATION_FLAG != 'Y' OR CANCELLATION_FLAG IS NULL)
            WITH UR
    </select>

    <select id="findAllByFidAndMemberCodeFromRuObligparttake" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_OBLIGPARTTAKE
        WHERE FID = #{fid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
          AND (CANCELLATION_FLAG != 'Y' OR CANCELLATION_FLAG IS NULL)
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByFidAndMemberCodeFromRuObligparttakeCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_OBLIGPARTTAKE
        WHERE FID = #{fid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
          AND (CANCELLATION_FLAG != 'Y' OR CANCELLATION_FLAG IS NULL)
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="countAllByFidAndMemberCodeFromRuObligparttake" resultType="long" timeout="3600">
        SELECT COUNT(*)
        FROM INDIC.RU_OBLIGPARTTAKE
        WHERE FID = #{fid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
          AND (CANCELLATION_FLAG != 'Y' OR CANCELLATION_FLAG IS NULL)
            WITH UR
    </select>

    <select id="findAllByFidAndMemberCodeFromRuBankruptcy" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_BANKRUPTCY
        WHERE FID = #{fid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByFidAndMemberCodeFromRuBankruptcyCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_BANKRUPTCY
        WHERE FID = #{fid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="countAllByFidAndMemberCodeFromRuBankruptcyWithBlocks" resultType="long" timeout="3600">
        SELECT COUNT(*)
        FROM (SELECT 1
              FROM INDIC.RU_BANKRUPTCY b
              WHERE CAST(b.FID AS VARCHAR(2000)) = #{fid}
                AND b.MEMBER_CODE LIKE #{memberCode} || '%'

              UNION ALL

              SELECT 1
              FROM INDIC.RU_BANKRUPTCY_BLOCKS bb
                       JOIN INDIC.RU_BANKRUPTCY b
                            ON bb.PARENT_SERIAL_NUM = b.SERIAL_NUM
                                AND CAST(bb.FID AS VARCHAR(2000)) = CAST(b.FID AS VARCHAR(2000))
              WHERE CAST(b.FID AS VARCHAR(2000)) = #{fid}
                AND b.MEMBER_CODE LIKE #{memberCode} || '%') t
            WITH UR
    </select>

    <select id="findAllByFidAndMemberCodeFromRuSettled" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_SETTLED
        WHERE FID = #{fid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByFidAndMemberCodeFromRuSettledCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_SETTLED
        WHERE FID = #{fid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="countAllByFidAndMemberCodeFromRuSettled" resultType="long" timeout="3600">
        SELECT COUNT(*)
        FROM INDIC.RU_SETTLED
        WHERE FID = #{fid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
            WITH UR
    </select>

    <select id="findAllByFidAndMemberCodeFromRuOtherlegal" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_OTHERLEGAL
        WHERE FID = #{fid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByFidAndMemberCodeFromRuOtherlegalCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_OTHERLEGAL
        WHERE FID = #{fid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="countAllByFidAndMemberCodeFromRuOtherlegal" resultType="long" timeout="3600">
        SELECT COUNT(*)
        FROM INDIC.RU_OTHERLEGAL
        WHERE FID = #{fid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
            WITH UR
    </select>

    <select id="findAllByFidAndMemberCodeFromRuCapability" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_CAPABILITY
        WHERE FID = #{fid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByFidAndMemberCodeFromRuCapabilityCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_CAPABILITY
        WHERE FID = #{fid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="countAllByFidAndMemberCodeFromRuCapability" resultType="long" timeout="3600">
        SELECT COUNT(*)
        FROM INDIC.RU_CAPABILITY
        WHERE FID = #{fid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
            WITH UR
    </select>

    <select id="findAllByFidAndMemberCodeFromRuDebtBurdenInfo" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_DEBT_BURDEN_INFO
        WHERE FID = #{fid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByFidAndMemberCodeFromRuDebtBurdenInfoCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_DEBT_BURDEN_INFO
        WHERE FID = #{fid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="countAllByFidAndMemberCodeFromRuDebtBurdenInfo" resultType="long" timeout="3600">
        SELECT COUNT(*)
        FROM INDIC.RU_DEBT_BURDEN_INFO
        WHERE FID = #{fid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
            WITH UR
    </select>

    <select id="findAllByFidAndMemberCodeFromAccount" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.ACCOUNT
        WHERE FID = #{fid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByFidAndMemberCodeFromAccountCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.ACCOUNT
        WHERE FID = #{fid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByFidAndMemberCodeFromInformation" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.INFORMATION
        WHERE FID = #{fid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
          AND (CANCELLATION_FLAG != 'Y' OR CANCELLATION_FLAG IS NULL)
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByFidAndMemberCodeFromInformationCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.INFORMATION
        WHERE FID = #{fid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
          AND (CANCELLATION_FLAG != 'Y' OR CANCELLATION_FLAG IS NULL)
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="countAllByFidAndMemberCodeFromInformation" resultType="long" timeout="3600">
        SELECT COUNT(*)
        FROM INDIC.INFORMATION
        WHERE FID = #{fid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
          AND (CANCELLATION_FLAG != 'Y' OR CANCELLATION_FLAG IS NULL)
            WITH UR
    </select>

    <select id="findAllByFidAndMemberCodeFromBankruptcy" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.BANKRUPTCY
        WHERE FID = #{fid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByFidAndMemberCodeFromBankruptcyCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.BANKRUPTCY
        WHERE FID = #{fid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="countAllByFidAndMemberCodeFromBankruptcy" resultType="long" timeout="3600">
        SELECT COUNT(*)
        FROM INDIC.BANKRUPTCY
        WHERE FID = #{fid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
            WITH UR
    </select>

    <select id="findAllByFidAndMemberCodeFromConsumerBankruptcy" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.CONSUMER_BANKRUPTCY
        WHERE FID = #{fid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByFidAndMemberCodeFromConsumerBankruptcyCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.CONSUMER_BANKRUPTCY
        WHERE FID = #{fid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="countAllByFidAndMemberCodeFromConsumerBankruptcy" resultType="long" timeout="3600">
        SELECT COUNT(*)
        FROM INDIC.CONSUMER_BANKRUPTCY
        WHERE FID = #{fid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
            WITH UR
    </select>

    <select id="findAllByFidAndMemberCodeFromLegal" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.LEGAL
        WHERE FID = #{fid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="findAllByFidAndMemberCodeFromLegalCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.LEGAL
        WHERE FID = #{fid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
        ORDER BY LAST_UPDATED_DT DESC
            WITH UR
    </select>

    <select id="countAllByFidAndMemberCodeFromLegal" resultType="long" timeout="3600">
        SELECT COUNT(*)
        FROM INDIC.LEGAL
        WHERE FID = #{fid}
          AND MEMBER_CODE LIKE #{memberCode} || '%'
            WITH UR
    </select>

    <select id="findAllByFidAndParentSerialNumFromRuCollateralBlocks" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_COLLATERAL_BLOCKS
        WHERE FID = #{fid}
          AND PARENT_SERIAL_NUM = #{parentSerialNum}
            WITH UR
    </select>

    <select id="findAllByFidAndParentSerialNumFromRuCollateralBlocksCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_COLLATERAL_BLOCKS
        WHERE FID = #{fid}
          AND PARENT_SERIAL_NUM = #{parentSerialNum}
            WITH UR
    </select>

    <select id="findAllByFidAndParentSerialNumFromRuBankruptcyBlocks" resultType="java.util.LinkedHashMap" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_BANKRUPTCY_BLOCKS
        WHERE FID = #{fid}
          AND PARENT_SERIAL_NUM = #{parentSerialNum}
            WITH UR
    </select>

    <select id="findAllByFidAndParentSerialNumFromRuBankruptcyBlocksCursor" resultType="java.util.LinkedHashMap" fetchSize="1000" timeout="3600">
        SELECT ${columns}
        FROM INDIC.RU_BANKRUPTCY_BLOCKS
        WHERE FID = #{fid}
          AND PARENT_SERIAL_NUM = #{parentSerialNum}
            WITH UR
    </select>

    <sql id="ruUidChildSelect">
        SELECT COUNT(*)                                    AS UID_COUNT,

               (SELECT COUNT(*)
                FROM INDIC.RU_TRADE ru_trade
                WHERE ru_trade.ACC_SERIAL_NUM = u.SERIAL_NUM
                  AND ru_trade.FID = u.FID)                AS RU_TRADE_COUNT,

               (SELECT COUNT(*)
                FROM INDIC.RU_ACCOUNT_AMT ru_accountAmt
                WHERE ru_accountAmt.ACC_SERIAL_NUM = u.SERIAL_NUM
                  AND ru_accountAmt.FID = u.FID)           AS RU_ACCOUNT_AMT_COUNT,

               (SELECT COUNT(*)
                FROM INDIC.RU_COBORROWER ru_coborrower
                WHERE ru_coborrower.ACC_SERIAL_NUM = u.SERIAL_NUM
                  AND ru_coborrower.FID = u.FID)           AS RU_COBORROWER_COUNT,

               (SELECT COUNT(*)
                FROM INDIC.RU_PAYMT_CONDITION ru_paymtCondition
                WHERE ru_paymtCondition.ACC_SERIAL_NUM = u.SERIAL_NUM
                  AND ru_paymtCondition.FID = u.FID)       AS RU_PAYMT_CONDITION_COUNT,

               (SELECT COUNT(*)
                FROM INDIC.RU_OVERALLVAL ru_overallval
                WHERE ru_overallval.ACC_SERIAL_NUM = u.SERIAL_NUM
                  AND ru_overallval.FID = u.FID)           AS RU_OVERALLVAL_COUNT,

               (SELECT COUNT(*)
                FROM INDIC.RU_AMENDMENT ru_amendment
                WHERE ru_amendment.ACC_SERIAL_NUM = u.SERIAL_NUM
                  AND ru_amendment.FID = u.FID)            AS RU_AMENDMENT_COUNT,

               (SELECT COUNT(*)
                FROM INDIC.RU_FUNDDATE ru_funddate
                WHERE ru_funddate.ACC_SERIAL_NUM = u.SERIAL_NUM
                  AND ru_funddate.FID = u.FID)             AS RU_FUNDDATE_COUNT,

               (SELECT COUNT(*)
                FROM INDIC.RU_ARREAR ru_arrear
                WHERE ru_arrear.ACC_SERIAL_NUM = u.SERIAL_NUM
                  AND ru_arrear.FID = u.FID)               AS RU_ARREAR_COUNT,

               (SELECT COUNT(*)
                FROM INDIC.RU_DUEARREAR ru_duearrear
                WHERE ru_duearrear.ACC_SERIAL_NUM = u.SERIAL_NUM
                  AND ru_duearrear.FID = u.FID)            AS RU_DUEARREAR_COUNT,

               (SELECT COUNT(*)
                FROM INDIC.RU_PASTDUEARREAR ru_pastduearrear
                WHERE ru_pastduearrear.ACC_SERIAL_NUM = u.SERIAL_NUM
                  AND ru_pastduearrear.FID = u.FID)        AS RU_PASTDUEARREAR_COUNT,

               (SELECT COUNT(*)
                FROM INDIC.RU_PAYMT ru_paymt
                WHERE ru_paymt.ACC_SERIAL_NUM = u.SERIAL_NUM
                  AND ru_paymt.FID = u.FID)                AS RU_PAYMT_COUNT,

               (SELECT COUNT(*)
                FROM INDIC.RU_MONTHAVERPAYMT ru_monthaverpaymt
                WHERE ru_monthaverpaymt.ACC_SERIAL_NUM = u.SERIAL_NUM
                  AND ru_monthaverpaymt.FID = u.FID)       AS RU_MONTHAVERPAYMT_COUNT,

               (SELECT COUNT(*)
                FROM INDIC.RU_SOURCENONMONETOBLIG ru_sourcenonmonetoblig
                WHERE ru_sourcenonmonetoblig.ACC_SERIAL_NUM = u.SERIAL_NUM
                  AND ru_sourcenonmonetoblig.FID = u.FID)  AS RU_SOURCENONMONETOBLIG_COUNT,

               (SELECT COUNT(*)
                FROM INDIC.RU_SUBJECTNONMONETOBLIG ru_subjectnonmonetoblig
                WHERE ru_subjectnonmonetoblig.ACC_SERIAL_NUM = u.SERIAL_NUM
                  AND ru_subjectnonmonetoblig.FID = u.FID) AS RU_SUBJECTNONMONETOBLIG_COUNT,

               (SELECT COUNT(*)
                FROM INDIC.RU_COLLATERAL ru_collateral
                WHERE ru_collateral.ACC_SERIAL_NUM = u.SERIAL_NUM
                  AND ru_collateral.FID = u.FID)           AS RU_COLLATERAL_COUNT,

               (SELECT COUNT(*)
                FROM INDIC.RU_GUARANTOR ru_guarantor
                WHERE ru_guarantor.ACC_SERIAL_NUM = u.SERIAL_NUM
                  AND ru_guarantor.FID = u.FID)            AS RU_GUARANTOR_COUNT,

               (SELECT COUNT(*)
                FROM INDIC.RU_INDEPGUARANTOR ru_indepguarantor
                WHERE ru_indepguarantor.ACC_SERIAL_NUM = u.SERIAL_NUM
                  AND ru_indepguarantor.FID = u.FID)       AS RU_INDEPGUARANTOR_COUNT,

               (SELECT COUNT(*)
                FROM INDIC.RU_COLLATINSURED ru_collatinsured
                WHERE ru_collatinsured.ACC_SERIAL_NUM = u.SERIAL_NUM
                  AND ru_collatinsured.FID = u.FID)        AS RU_COLLATINSURED_COUNT,

               (SELECT COUNT(*)
                FROM INDIC.RU_COLLATREPAY ru_collatrepay
                WHERE ru_collatrepay.ACC_SERIAL_NUM = u.SERIAL_NUM
                  AND ru_collatrepay.FID = u.FID)          AS RU_COLLATREPAY_COUNT,

               (SELECT COUNT(*)
                FROM INDIC.RU_GUARANTEEREPAY ru_guaranteerepay
                WHERE ru_guaranteerepay.ACC_SERIAL_NUM = u.SERIAL_NUM
                  AND ru_guaranteerepay.FID = u.FID)       AS RU_GUARANTEEREPAY_COUNT,

               (SELECT COUNT(*)
                FROM INDIC.RU_OBLIGTERMINATION ru_obligtermination
                WHERE ru_obligtermination.ACC_SERIAL_NUM = u.SERIAL_NUM
                  AND ru_obligtermination.FID = u.FID)     AS RU_OBLIGTERMINATION_COUNT,

               (SELECT COUNT(*)
                FROM INDIC.RU_SUBMITHOLD ru_submithold
                WHERE ru_submithold.ACC_SERIAL_NUM = u.SERIAL_NUM
                  AND ru_submithold.FID = u.FID)           AS RU_SUBMITHOLD_COUNT,

               (SELECT COUNT(*)
                FROM INDIC.RU_ACQUIRERLEGAL ru_acquirerlegal
                WHERE ru_acquirerlegal.ACC_SERIAL_NUM = u.SERIAL_NUM
                  AND ru_acquirerlegal.FID = u.FID)        AS RU_ACQUIRERLEGAL_COUNT,

               (SELECT COUNT(*)
                FROM INDIC.RU_ACQUIRERINDIVID ru_acquirerindivid
                WHERE ru_acquirerindivid.ACC_SERIAL_NUM = u.SERIAL_NUM
                  AND ru_acquirerindivid.FID = u.FID)      AS RU_ACQUIRERINDIVID_COUNT,

               (SELECT COUNT(*)
                FROM INDIC.RU_SERVICECO ru_serviceco
                WHERE ru_serviceco.ACC_SERIAL_NUM = u.SERIAL_NUM
                  AND ru_serviceco.FID = u.FID)            AS RU_SERVICECO_COUNT,

               (SELECT COUNT(*)
                FROM INDIC.RU_OBLIGACCOUNT ru_obligaccount
                WHERE ru_obligaccount.ACC_SERIAL_NUM = u.SERIAL_NUM
                  AND ru_obligaccount.FID = u.FID)         AS RU_OBLIGACCOUNT_COUNT,

               (SELECT COUNT(*)
                FROM INDIC.RU_LEGALRECORD ru_legalrecord
                WHERE ru_legalrecord.ACC_SERIAL_NUM = u.SERIAL_NUM
                  AND ru_legalrecord.FID = u.FID)          AS RU_LEGALRECORD_COUNT,

               (SELECT COUNT(*)
                FROM INDIC.RU_OBLIGSRCBANKRUPT ru_obligsrcbankrupt
                WHERE ru_obligsrcbankrupt.ACC_SERIAL_NUM = u.SERIAL_NUM
                  AND ru_obligsrcbankrupt.FID = u.FID)     AS RU_OBLIGSRCBANKRUPT_COUNT,

               (SELECT COUNT(*)
                FROM INDIC.RU_OBLIGSRCLIQUID ru_obligsrcliquid
                WHERE ru_obligsrcliquid.ACC_SERIAL_NUM = u.SERIAL_NUM
                  AND ru_obligsrcliquid.FID = u.FID)       AS RU_OBLIGSRCLIQUID_COUNT,

               (SELECT COUNT(*)
                FROM INDIC.RU_AMOUNT_INFO ru_amountInfo
                WHERE ru_amountInfo.ACC_SERIAL_NUM = u.SERIAL_NUM
                  AND ru_amountInfo.FID = u.FID)           AS RU_AMOUNT_INFO_COUNT,

               (SELECT COUNT(*)
                FROM INDIC.RU_CONTRACT_TERMS_CHANGES ru_contractTermsChanges
                WHERE ru_contractTermsChanges.ACC_SERIAL_NUM = u.SERIAL_NUM
                  AND ru_contractTermsChanges.FID = u.FID) AS RU_CONTRACT_TERMS_CHANGES_COUNT,

               (SELECT COUNT(*)
                FROM INDIC.RU_ALL_ARREARS ru_allArrears
                WHERE ru_allArrears.ACC_SERIAL_NUM = u.SERIAL_NUM
                  AND ru_allArrears.FID = u.FID)           AS RU_ALL_ARREARS_COUNT

        FROM INDIC.RU_UID u
    </sql>

    <sql id="accountChildSelect">
        SELECT COUNT(*)                           AS ACCOUNT_COUNT,
               (SELECT COUNT(*)
                FROM INDIC.ACCOUNT_AMEND account_amend
                WHERE account_amend.ACC_SERIAL_NUM = a.SERIAL_NUM
                  AND account_amend.FID = a.FID)  AS ACCOUNT_AMEND_COUNT,
               (SELECT COUNT(*)
                FROM INDIC.PAYMENT payment
                WHERE payment.ACC_SERIAL_NUM = a.SERIAL_NUM
                  AND MEMBER_CODE LIKE #{memberCode} || '%'
                  AND payment.FID = a.FID)        AS PAYMENT_COUNT,
               (SELECT COUNT(*)
                FROM INDIC.COLLATERAL collateral
                WHERE collateral.ACC_SERIAL_NUM = a.SERIAL_NUM
                  AND MEMBER_CODE LIKE #{memberCode} || '%'
                  AND collateral.FID = a.FID)     AS COLLATERAL_COUNT,
               (SELECT COUNT(*)
                FROM INDIC.GUARANTOR guarantor
                WHERE guarantor.ACC_SERIAL_NUM = a.SERIAL_NUM
                  AND MEMBER_CODE LIKE #{memberCode} || '%'
                  AND guarantor.FID = a.FID)      AS GUARANTOR_COUNT,
               (SELECT COUNT(*)
                FROM INDIC.BANK_GUARANTEE bank_guarantee
                WHERE bank_guarantee.ACC_SERIAL_NUM = a.SERIAL_NUM
                  AND MEMBER_CODE LIKE #{memberCode} || '%'
                  AND bank_guarantee.FID = a.FID) AS BANK_GUARANTEE_COUNT

        FROM INDIC.ACCOUNT a
    </sql>

    <select id="countAllRuUidChildTablesByAcctNum" resultType="java.util.LinkedHashMap" timeout="3600">
        <include refid="ruUidChildSelect"/>
        WHERE CAST(u.ACCT_NUM AS VARCHAR(2000)) = #{acctNum}
        AND (
        u.MEMBER_CODE LIKE #{memberCode} || '%'
        OR u.REAL_MEMBERCODE LIKE #{memberCode} || '%'
        )
        GROUP BY u.FID, u.SERIAL_NUM
        WITH UR
    </select>

    <select id="countAllRuUidChildTablesByFid" resultType="java.util.LinkedHashMap" timeout="3600">
        <include refid="ruUidChildSelect"/>
        WHERE FID = #{fid}
        AND (MEMBER_CODE LIKE #{memberCode} || '%'
        OR REAL_MEMBERCODE LIKE #{memberCode} || '%')
        GROUP BY u.FID, u.SERIAL_NUM
        WITH UR
    </select>

    <select id="countAllRuUidChildTablesByFidWithoutRealMemberCode" resultType="java.util.LinkedHashMap" timeout="3600">
        <include refid="ruUidChildSelect"/>
        WHERE FID = #{fid}
        AND MEMBER_CODE LIKE #{memberCode} || '%'
        GROUP BY u.FID, u.SERIAL_NUM
        WITH UR
    </select>

    <select id="countAllRuUidChildTablesByUuid" resultType="java.util.LinkedHashMap" timeout="3600">
        <include refid="ruUidChildSelect"/>
        WHERE UUID = #{uuid}
        AND (MEMBER_CODE LIKE #{memberCode} || '%'
        OR REAL_MEMBERCODE LIKE #{memberCode} || '%')
        GROUP BY u.FID, u.SERIAL_NUM
        WITH UR
    </select>

    <select id="countAllAccountChildTablesByAcctNum" resultType="java.util.LinkedHashMap" timeout="3600">
        <include refid="accountChildSelect"/>
        WHERE CAST(ACCT_NUM AS VARCHAR(2000)) = #{acctNum}
        AND MEMBER_CODE LIKE #{memberCode} || '%'
        GROUP BY u.FID, u.SERIAL_NUM
        WITH UR
    </select>

    <select id="countAllAccountChildTablesByFid" resultType="java.util.LinkedHashMap" timeout="3600">
        <include refid="accountChildSelect"/>
        WHERE FID = #{fid}
        AND MEMBER_CODE LIKE #{memberCode} || '%'
        GROUP BY u.FID, u.SERIAL_NUM
        WITH UR
    </select>

    <select id="countAllAccountChildTablesBySerialNum" resultType="java.util.LinkedHashMap" timeout="3600">
        <include refid="accountChildSelect"/>
        WHERE SERIAL_NUM = #{serialNum}
        AND MEMBER_CODE LIKE #{memberCode} || '%'
        GROUP BY u.FID, u.SERIAL_NUM
        WITH UR
    </select>

    <select id="countAllAccountChildTablesByUuid" resultType="java.util.LinkedHashMap" timeout="3600">
        <include refid="accountChildSelect"/>
        WHERE UUID = #{uuid}
        AND MEMBER_CODE LIKE #{memberCode} || '%'
        GROUP BY u.FID, u.SERIAL_NUM
        WITH UR
    </select>
</mapper>
