zmqxrtmapper.xml 16.1 KB
Newer Older
hulei committed
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
<?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.ZmqxrtMapper">

    <resultMap id="BaseResultMap" type="com.brilliance.isc.bo.Zmqxrt">
        <result property="inr" column="inr" jdbcType="VARCHAR"/>
        <result property="cur" column="cur" jdbcType="VARCHAR"/>
        <result property="begdat" column="begdat" jdbcType="DATE"/>
        <result property="enddat" column="enddat" jdbcType="DATE"/>
        <result property="buyrat" column="buyrat" jdbcType="DECIMAL"/>
        <result property="midrat" column="midrat" jdbcType="DECIMAL"/>
        <result property="selrat" column="selrat" jdbcType="DECIMAL"/>
        <result property="ttrrat" column="ttrrat" jdbcType="DECIMAL"/>
        <result property="odrrat" column="odrrat" jdbcType="DECIMAL"/>
        <result property="ver" column="ver" jdbcType="VARCHAR"/>
        <result property="resrat" column="resrat" jdbcType="DECIMAL"/>
        <result property="rebrat" column="rebrat" jdbcType="DECIMAL"/>
        <result property="ibrrat" column="ibrrat" jdbcType="DECIMAL"/>
        <result property="sel1rat" column="sel1rat" jdbcType="DECIMAL"/>
        <result property="buy1rat" column="buy1rat" jdbcType="DECIMAL"/>
        <result property="etgextkey" column="etgextkey" jdbcType="VARCHAR"/>
        <result property="xrttim" column="xrttim" jdbcType="VARCHAR"/>
        <result property="caozbz" column="caozbz" jdbcType="VARCHAR"/>
        <result property="canssm" column="canssm" jdbcType="VARCHAR"/>
    </resultMap>

    <sql id="Base_Column_List">
        inr,cur,begdat,enddat,buyrat,midrat,selrat,ttrrat,odrrat,ver,resrat,rebrat,ibrrat,sel1rat,buy1rat,etgextkey,xrttim,caozbz,canssm
    </sql>

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

    <select id="selectByCurWithDatRng" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from zmqxrt
        where cur = #{cur,jdbcType=VARCHAR}
        <![CDATA[and begdat<= #{curDat,jdbcType=DATE} and enddat > #{curDat,jdbcType=DATE}]]>
    </select>

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

    <insert id="insert">
        insert into zmqxrt (<include refid="Base_Column_List"/>)
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            #{inr,jdbcType=VARCHAR},
            #{cur,jdbcType=VARCHAR},
            #{begdat,jdbcType=DATE},
            #{enddat,jdbcType=DATE},
            #{buyrat,jdbcType=DECIMAL},
            #{midrat,jdbcType=DECIMAL},
            #{selrat,jdbcType=DECIMAL},
            #{ttrrat,jdbcType=DECIMAL},
            #{odrrat,jdbcType=DECIMAL},
            #{ver,jdbcType=VARCHAR},
            #{resrat,jdbcType=DECIMAL},
            #{rebrat,jdbcType=DECIMAL},
            #{ibrrat,jdbcType=DECIMAL},
            #{sel1rat,jdbcType=DECIMAL},
            #{buy1rat,jdbcType=DECIMAL},
            'CEBGRP',
            #{xrttim,jdbcType=VARCHAR},
            #{caozbz,jdbcType=VARCHAR},
            #{canssm,jdbcType=VARCHAR},
        </trim>
    </insert>

    <insert id="insertSelective">
        insert into zmqxrt
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="inr != null">inr,</if>
            <if test="cur != null">cur,</if>
            <if test="begdat != null">begdat,</if>
            <if test="enddat != null">enddat,</if>
            <if test="buyrat != null">buyrat,</if>
            <if test="midrat != null">midrat,</if>
            <if test="selrat != null">selrat,</if>
            <if test="ttrrat != null">ttrrat,</if>
            <if test="odrrat != null">odrrat,</if>
            <if test="ver != null">ver,</if>
            <if test="resrat != null">resrat,</if>
            <if test="rebrat != null">rebrat,</if>
            <if test="ibrrat != null">ibrrat,</if>
            <if test="sel1rat != null">sel1rat,</if>
            <if test="buy1rat != null">buy1rat,</if>
            etgextkey,
            <if test="xrttim != null">xrttim,</if>
            <if test="caozbz != null">caozbz,</if>
            <if test="canssm != null">canssm,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="inr != null">#{inr,jdbcType=VARCHAR},</if>
            <if test="cur != null">#{cur,jdbcType=VARCHAR},</if>
            <if test="begdat != null">#{begdat,jdbcType=DATE},</if>
            <if test="enddat != null">#{enddat,jdbcType=DATE},</if>
            <if test="buyrat != null">#{buyrat,jdbcType=DECIMAL},</if>
            <if test="midrat != null">#{midrat,jdbcType=DECIMAL},</if>
            <if test="selrat != null">#{selrat,jdbcType=DECIMAL},</if>
            <if test="ttrrat != null">#{ttrrat,jdbcType=DECIMAL},</if>
            <if test="odrrat != null">#{odrrat,jdbcType=DECIMAL},</if>
            <if test="ver != null">#{ver,jdbcType=VARCHAR},</if>
            <if test="resrat != null">#{resrat,jdbcType=DECIMAL},</if>
            <if test="rebrat != null">#{rebrat,jdbcType=DECIMAL},</if>
            <if test="ibrrat != null">#{ibrrat,jdbcType=DECIMAL},</if>
            <if test="sel1rat != null">#{sel1rat,jdbcType=DECIMAL},</if>
            <if test="buy1rat != null">#{buy1rat,jdbcType=DECIMAL},</if>
            'CEBGRP',
            <if test="xrttim != null">#{xrttim,jdbcType=VARCHAR},</if>
            <if test="caozbz != null">#{caozbz,jdbcType=VARCHAR},</if>
            <if test="canssm != null">#{canssm,jdbcType=VARCHAR},</if>
        </trim>
    </insert>

    <update id="updateByPrimaryKeySelective">
        update zmqxrt
        <set>
            <if test="cur != null">cur = #{cur,jdbcType=VARCHAR},</if>
            <if test="begdat != null">begdat = #{begdat,jdbcType=DATE},</if>
            <if test="enddat != null">enddat = #{enddat,jdbcType=DATE},</if>
            <if test="buyrat != null">buyrat = #{buyrat,jdbcType=DECIMAL},</if>
            <if test="midrat != null">midrat = #{midrat,jdbcType=DECIMAL},</if>
            <if test="selrat != null">selrat = #{selrat,jdbcType=DECIMAL},</if>
            <if test="ttrrat != null">ttrrat = #{ttrrat,jdbcType=DECIMAL},</if>
            <if test="odrrat != null">odrrat = #{odrrat,jdbcType=DECIMAL},</if>
            <if test="ver != null">ver = #{ver,jdbcType=VARCHAR},</if>
            <if test="resrat != null">resrat = #{resrat,jdbcType=DECIMAL},</if>
            <if test="rebrat != null">rebrat = #{rebrat,jdbcType=DECIMAL},</if>
            <if test="ibrrat != null">ibrrat = #{ibrrat,jdbcType=DECIMAL},</if>
            <if test="sel1rat != null">sel1rat = #{sel1rat,jdbcType=DECIMAL},</if>
            <if test="buy1rat != null">buy1rat = #{buy1rat,jdbcType=DECIMAL},</if>
            etgextkey = 'CEBGRP',
            <if test="xrttim != null">xrttim = #{xrttim,jdbcType=VARCHAR},</if>
            <if test="caozbz != null">caozbz = #{caozbz,jdbcType=VARCHAR},</if>
            <if test="canssm != null">canssm = #{canssm,jdbcType=VARCHAR},</if>
        </set>
        where inr = #{inr,jdbcType=VARCHAR}
    </update>

    <update id="updateByPrimaryKey">
        update zmqxrt
        <set>
            cur = #{cur,jdbcType=VARCHAR},
            begdat = #{begdat,jdbcType=DATE},
            enddat = #{enddat,jdbcType=DATE},
            buyrat = #{buyrat,jdbcType=DECIMAL},
            midrat = #{midrat,jdbcType=DECIMAL},
            selrat = #{selrat,jdbcType=DECIMAL},
            ttrrat = #{ttrrat,jdbcType=DECIMAL},
            odrrat = #{odrrat,jdbcType=DECIMAL},
            ver = #{ver,jdbcType=VARCHAR},
            resrat = #{resrat,jdbcType=DECIMAL},
            rebrat = #{rebrat,jdbcType=DECIMAL},
            ibrrat = #{ibrrat,jdbcType=DECIMAL},
            sel1rat = #{sel1rat,jdbcType=DECIMAL},
            buy1rat = #{buy1rat,jdbcType=DECIMAL},
            etgextkey = 'CEBGRP',
            xrttim = #{xrttim,jdbcType=VARCHAR},
            caozbz = #{caozbz,jdbcType=VARCHAR},
            canssm = #{canssm,jdbcType=VARCHAR},
        </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 zmqxrt
        <set>
            <if test="module.cur != null">cur = #{module.cur,jdbcType=VARCHAR},</if>
            <if test="module.begdat != null">begdat = #{module.begdat,jdbcType=DATE},</if>
            <if test="module.enddat != null">enddat = #{module.enddat,jdbcType=DATE},</if>
            <if test="module.buyrat != null">buyrat = #{module.buyrat,jdbcType=DECIMAL},</if>
            <if test="module.midrat != null">midrat = #{module.midrat,jdbcType=DECIMAL},</if>
            <if test="module.selrat != null">selrat = #{module.selrat,jdbcType=DECIMAL},</if>
            <if test="module.ttrrat != null">ttrrat = #{module.ttrrat,jdbcType=DECIMAL},</if>
            <if test="module.odrrat != null">odrrat = #{module.odrrat,jdbcType=DECIMAL},</if>
            <if test="module.ver != null">ver = #{module.ver,jdbcType=VARCHAR},</if>
            <if test="module.resrat != null">resrat = #{module.resrat,jdbcType=DECIMAL},</if>
            <if test="module.rebrat != null">rebrat = #{module.rebrat,jdbcType=DECIMAL},</if>
            <if test="module.ibrrat != null">ibrrat = #{module.ibrrat,jdbcType=DECIMAL},</if>
            <if test="module.sel1rat != null">sel1rat = #{module.sel1rat,jdbcType=DECIMAL},</if>
            <if test="module.buy1rat != null">buy1rat = #{module.buy1rat,jdbcType=DECIMAL},</if>
            etgextkey = 'CEBGRP',
            <if test="module.xrttim != null">xrttim = #{module.xrttim,jdbcType=VARCHAR},</if>
            <if test="module.caozbz != null">caozbz = #{module.caozbz,jdbcType=VARCHAR},</if>
            <if test="module.canssm != null">canssm = #{module.canssm,jdbcType=VARCHAR},</if>
        </set>
        ${conditions}
    </update>

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

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

    <select id="getZmqxrtByConditionSql" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from zmqxrt
        ${conditionSql}
    </select>

    <!--查询单个-->
    <select id="queryById" resultMap="BaseResultMap">
        select INR,
               CUR,
               BEGDAT,
               ENDDAT,
               BUYRAT,
               MIDRAT,
               SELRAT,
               TTRRAT,
               ODRRAT,
               VER,
               RESRAT,
               REBRAT,
               IBRRAT,
               SEL1RAT,
               BUY1RAT,
               ETGEXTKEY,
               XRTTIM,
               CAOZBZ,
               CANSSM
        from ZMQXRT
        where INR = #{inr}
    </select>

    <!--查询指定行数据-->
    <select id="queryAllByLimit" resultMap="BaseResultMap">
        select
        INR, CUR, BEGDAT, ENDDAT, BUYRAT, MIDRAT, SELRAT, TTRRAT, ODRRAT, VER, RESRAT, REBRAT, IBRRAT, SEL1RAT, BUY1RAT,
        ETGEXTKEY, XRTTIM, CAOZBZ, CANSSM
        from ZMQXRT
        <where>
            <if test="inr != null and inr != ''">
                and INR = #{inr}
            </if>
            <if test="cur != null and cur != ''">
                and CUR = #{cur}
            </if>
            <if test="begdat != null">
                and XRTTIM <![CDATA[>=]]> #{begdat,jdbcType=TIMESTAMP}
            </if>
            <if test="enddat != null">
                and XRTTIM <![CDATA[<=]]> #{enddat,jdbcType=TIMESTAMP}
            </if>
        </where>
        order by length(INR) desc, INR desc
    </select>

    <select id="queryRiMoByPage" resultMap="BaseResultMap">
        select INR, CUR, BEGDAT, ENDDAT, BUYRAT, MIDRAT, SELRAT, TTRRAT, ODRRAT, VER, RESRAT, REBRAT, IBRRAT, SEL1RAT, BUY1RAT,
        ETGEXTKEY, XRTTIM, CAOZBZ, CANSSM from zmqxrt
        where XRTTIM <![CDATA[>=]]> #{begdat,jdbcType=TIMESTAMP} AND  XRTTIM <![CDATA[<=]]> #{enddat,jdbcType=TIMESTAMP} and begdat != enddat or enddat is null order by cur,xrttim
    </select>

    <!--统计总行数-->
    <select id="count" resultType="java.lang.Long">
        select count(1)
        from ZMQXRT
        <where>
            <if test="inr != null and inr != ''">
                and INR = #{inr}
            </if>
            <if test="cur != null and cur != ''">
                and CUR = #{cur}
            </if>
            <if test="begdat != null">
                and BEGDAT = #{begdat}
            </if>
            <if test="enddat != null">
                and ENDDAT = #{enddat}
            </if>
            <if test="buyrat != null">
                and BUYRAT = #{buyrat}
            </if>
            <if test="midrat != null">
                and MIDRAT = #{midrat}
            </if>
            <if test="selrat != null">
                and SELRAT = #{selrat}
            </if>
            <if test="ttrrat != null">
                and TTRRAT = #{ttrrat}
            </if>
            <if test="odrrat != null">
                and ODRRAT = #{odrrat}
            </if>
            <if test="ver != null and ver != ''">
                and VER = #{ver}
            </if>
            <if test="resrat != null">
                and RESRAT = #{resrat}
            </if>
            <if test="rebrat != null">
                and REBRAT = #{rebrat}
            </if>
            <if test="ibrrat != null">
                and IBRRAT = #{ibrrat}
            </if>
            <if test="sel1rat != null">
                and SEL1RAT = #{sel1rat}
            </if>
            <if test="buy1rat != null">
                and BUY1RAT = #{buy1rat}
            </if>
            <if test="etgextkey != null and etgextkey != ''">
                and ETGEXTKEY = 'CEBGRP'
            </if>
            <if test="xrttim != null and xrttim != ''">
                and XRTTIM = #{xrttim}
            </if>
            <if test="caozbz != null and caozbz != ''">
                and CAOZBZ = #{caozbz}
            </if>
            <if test="canssm != null and canssm != ''">
                and CANSSM = #{canssm}
            </if>
        </where>
    </select>

    <!--通过主键修改数据-->
    <update id="update">
        update ZMQXRT
        <set>
            <if test="inr != null and inr != ''">
                INR = #{inr},
            </if>
            <if test="cur != null and cur != ''">
                CUR = #{cur},
            </if>
            <if test="begdat != null">
                BEGDAT = #{begdat},
            </if>
            <if test="enddat != null">
                ENDDAT = #{enddat},
            </if>
            <if test="buyrat != null">
                BUYRAT = #{buyrat},
            </if>
            <if test="midrat != null">
                MIDRAT = #{midrat},
            </if>
            <if test="selrat != null">
                SELRAT = #{selrat},
            </if>
            <if test="ttrrat != null">
                TTRRAT = #{ttrrat},
            </if>
            <if test="odrrat != null">
                ODRRAT = #{odrrat},
            </if>
            <if test="ver != null and ver != ''">
                VER = #{ver},
            </if>
            <if test="resrat != null">
                RESRAT = #{resrat},
            </if>
            <if test="rebrat != null">
                REBRAT = #{rebrat},
            </if>
            <if test="ibrrat != null">
                IBRRAT = #{ibrrat},
            </if>
            <if test="sel1rat != null">
                SEL1RAT = #{sel1rat},
            </if>
            <if test="buy1rat != null">
                BUY1RAT = #{buy1rat},
            </if>
                ETGEXTKEY = 'CEBGRP',
            <if test="xrttim != null and xrttim != ''">
                XRTTIM = #{xrttim},
            </if>
            <if test="canssm != null and canssm != ''">
                CANSSM = #{canssm},
            </if>
        </set>
        where INR = #{inr}
    </update>

    <!--通过主键删除-->
    <delete id="deleteById">
        delete
        from ZMQXRT
        where INR = #{inr}
    </delete>

</mapper>