xdtmapper.xml 4.23 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
<?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.XdtMapper">

    <resultMap id="BaseResultMap" type="com.brilliance.isc.bo.Xdt">
        <result property="inr" column="inr" jdbcType="VARCHAR"/>
        <result property="cur" column="cur" jdbcType="VARCHAR"/>
        <result property="amt" column="amt" jdbcType="DECIMAL"/>
        <result property="typ" column="typ" jdbcType="VARCHAR"/>
        <result property="begdat" column="begdat" jdbcType="DATE"/>
        <result property="enddat" column="enddat" jdbcType="DATE"/>
        <result property="etgextkey" column="etgextkey" jdbcType="VARCHAR"/>
        <result property="ver" column="ver" jdbcType="VARCHAR"/>
    </resultMap>

    <sql id="Base_Column_List">
        inr,cur,amt,typ,begdat,enddat,etgextkey,ver
    </sql>

    <insert id="insert">
        insert into xdt (<include refid="Base_Column_List"/>)
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            #{inr,jdbcType=VARCHAR},
            #{cur,jdbcType=VARCHAR},
            #{amt,jdbcType=DECIMAL},
            #{typ,jdbcType=VARCHAR},
            #{begdat,jdbcType=DATE},
            #{enddat,jdbcType=DATE},
            #{etgextkey,jdbcType=VARCHAR},
            #{ver,jdbcType=VARCHAR},
        </trim>
    </insert>

    <insert id="insertSelective">
        insert into xdt
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="inr != null">inr,</if>
            <if test="cur != null">cur,</if>
            <if test="amt != null">amt,</if>
            <if test="typ != null">typ,</if>
            <if test="begdat != null">begdat,</if>
            <if test="enddat != null">enddat,</if>
            <if test="etgextkey != null">etgextkey,</if>
            <if test="ver != null">ver,</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="amt != null">#{amt,jdbcType=DECIMAL},</if>
            <if test="typ != null">#{typ,jdbcType=VARCHAR},</if>
            <if test="begdat != null">#{begdat,jdbcType=DATE},</if>
            <if test="enddat != null">#{enddat,jdbcType=DATE},</if>
            <if test="etgextkey != null">#{etgextkey,jdbcType=VARCHAR},</if>
            <if test="ver != null">#{ver,jdbcType=VARCHAR},</if>
        </trim>
    </insert>

    <update id="updateByPrimaryKeySelective">
        update xdt
        <set>
            <if test="cur != null">cur = #{cur,jdbcType=VARCHAR},</if>
            <if test="amt != null">amt = #{amt,jdbcType=DECIMAL},</if>
            <if test="typ != null">typ = #{typ,jdbcType=VARCHAR},</if>
            <if test="begdat != null">begdat = #{begdat,jdbcType=DATE},</if>
            <if test="enddat != null">enddat = #{enddat,jdbcType=DATE},</if>
            <if test="etgextkey != null">etgextkey = #{etgextkey,jdbcType=VARCHAR},</if>
            <if test="ver != null">ver = #{ver,jdbcType=VARCHAR},</if>
        </set>
        where inr = #{inr,jdbcType=VARCHAR}
    </update>

    <update id="updateByPrimaryKey">
        update xdt
        <set>
            cur = #{cur,jdbcType=VARCHAR},
            amt = #{amt,jdbcType=DECIMAL},
            typ = #{typ,jdbcType=VARCHAR},
            begdat = #{begdat,jdbcType=DATE},
            enddat = #{enddat,jdbcType=DATE},
            etgextkey = #{etgextkey,jdbcType=VARCHAR},
            ver = #{ver,jdbcType=VARCHAR},
        </set>
        where inr = #{inr,jdbcType=VARCHAR}
    </update>

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

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

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

</mapper>