tgfmapper.xml 6.74 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
<?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.TgfMapper">

    <resultMap id="BaseResultMap" type="com.brilliance.isc.common.rmbbop.entity.Tgf">
        <result property="inr" column="inr" jdbcType="VARCHAR"/>
        <result property="ver" column="ver" jdbcType="VARCHAR"/>
        <result property="sta" column="sta" jdbcType="VARCHAR"/>
        <result property="objtyp" column="objtyp" jdbcType="VARCHAR"/>
        <result property="objinr" column="objinr" jdbcType="VARCHAR"/>
        <result property="listopertype" column="listopertype" jdbcType="VARCHAR"/>
        <result property="seqno" column="seqno" jdbcType="INTEGER"/>
        <result property="contractamt" column="contractamt" jdbcType="DECIMAL"/>
        <result property="tradedate" column="tradedate" jdbcType="DATE"/>
        <result property="enddate" column="enddate" jdbcType="DATE"/>
        <result property="tradedirection" column="tradedirection" jdbcType="VARCHAR"/>
        <result property="csta" column="csta" jdbcType="VARCHAR"/>
    </resultMap>

    <sql id="Base_Column_List">
        inr,ver,sta,objtyp,objinr,listopertype,seqno,contractamt,tradedate,enddate,tradedirection,csta
    </sql>

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

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

    <insert id="insert">
        insert into tgf (<include refid="Base_Column_List"/>)
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            #{inr,jdbcType=VARCHAR},
            #{ver,jdbcType=VARCHAR},
            #{sta,jdbcType=VARCHAR},
            #{objtyp,jdbcType=VARCHAR},
            #{objinr,jdbcType=VARCHAR},
            #{listopertype,jdbcType=VARCHAR},
            #{seqno,jdbcType=INTEGER},
            #{contractamt,jdbcType=DECIMAL},
            #{tradedate,jdbcType=DATE},
            #{enddate,jdbcType=DATE},
            #{tradedirection,jdbcType=VARCHAR},
            #{csta,jdbcType=VARCHAR},
        </trim>
    </insert>

    <insert id="insertSelective">
        insert into tgf
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="inr != null">inr,</if>
            <if test="ver != null">ver,</if>
            <if test="sta != null">sta,</if>
            <if test="objtyp != null">objtyp,</if>
            <if test="objinr != null">objinr,</if>
            <if test="listopertype != null">listopertype,</if>
            <if test="seqno != null">seqno,</if>
            <if test="contractamt != null">contractamt,</if>
            <if test="tradedate != null">tradedate,</if>
            <if test="enddate != null">enddate,</if>
            <if test="tradedirection != null">tradedirection,</if>
            <if test="csta != null">csta,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="inr != null">#{inr,jdbcType=VARCHAR},</if>
            <if test="ver != null">#{ver,jdbcType=VARCHAR},</if>
            <if test="sta != null">#{sta,jdbcType=VARCHAR},</if>
            <if test="objtyp != null">#{objtyp,jdbcType=VARCHAR},</if>
            <if test="objinr != null">#{objinr,jdbcType=VARCHAR},</if>
            <if test="listopertype != null">#{listopertype,jdbcType=VARCHAR},</if>
            <if test="seqno != null">#{seqno,jdbcType=INTEGER},</if>
            <if test="contractamt != null">#{contractamt,jdbcType=DECIMAL},</if>
            <if test="tradedate != null">#{tradedate,jdbcType=DATE},</if>
            <if test="enddate != null">#{enddate,jdbcType=DATE},</if>
            <if test="tradedirection != null">#{tradedirection,jdbcType=VARCHAR},</if>
            <if test="csta != null">#{csta,jdbcType=VARCHAR},</if>
        </trim>
    </insert>

    <update id="updateByPrimaryKeySelective">
        update tgf
        <set>
            <if test="ver != null">ver = #{ver,jdbcType=VARCHAR},</if>
            <if test="sta != null">sta = #{sta,jdbcType=VARCHAR},</if>
            <if test="objtyp != null">objtyp = #{objtyp,jdbcType=VARCHAR},</if>
            <if test="objinr != null">objinr = #{objinr,jdbcType=VARCHAR},</if>
            <if test="listopertype != null">listopertype = #{listopertype,jdbcType=VARCHAR},</if>
            <if test="seqno != null">seqno = #{seqno,jdbcType=INTEGER},</if>
            <if test="contractamt != null">contractamt = #{contractamt,jdbcType=DECIMAL},</if>
            <if test="tradedate != null">tradedate = #{tradedate,jdbcType=DATE},</if>
            <if test="enddate != null">enddate = #{enddate,jdbcType=DATE},</if>
            <if test="tradedirection != null">tradedirection = #{tradedirection,jdbcType=VARCHAR},</if>
            <if test="csta != null">csta = #{csta,jdbcType=VARCHAR},</if>
        </set>
        where inr = #{inr,jdbcType=VARCHAR}
    </update>

    <update id="updateByPrimaryKey">
        update tgf
        <set>
            ver = #{ver,jdbcType=VARCHAR},
            sta = #{sta,jdbcType=VARCHAR},
            objtyp = #{objtyp,jdbcType=VARCHAR},
            objinr = #{objinr,jdbcType=VARCHAR},
            listopertype = #{listopertype,jdbcType=VARCHAR},
            seqno = #{seqno,jdbcType=INTEGER},
            contractamt = #{contractamt,jdbcType=DECIMAL},
            tradedate = #{tradedate,jdbcType=DATE},
            enddate = #{enddate,jdbcType=DATE},
            tradedirection = #{tradedirection,jdbcType=VARCHAR},
            csta = #{csta,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>

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

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

    <select id="selectByObjInfo" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from tgf
        where objinr = #{objinr,jdbcType=VARCHAR} and objtyp = #{objtyp,jdbcType=VARCHAR} and seqno =
        #{seqno,jdbcType=VARCHAR}
    </select>

    <select id="selectByObjtypAndObjinr" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from tgf
        where 1=1 and objinr = #{objinr,jdbcType=VARCHAR} and objtyp = #{objtyp,jdbcType=VARCHAR}
    </select>

    <delete id="deleteByobjtypAndobjinr">
        delete from tgf
        where objtyp = #{objtyp,jdbcType=VARCHAR} and objinr = #{objinr,jdbcType=VARCHAR}
    </delete>
</mapper>