etgmapper.xml 4.96 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
<?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.EtgMapper">

    <resultMap id="BaseResultMap" type="com.brilliance.isc.bo.Etg">
        <result property="inr" column="inr" jdbcType="VARCHAR"/>
        <result property="extkey" column="extkey" jdbcType="VARCHAR"/>
        <result property="nam" column="nam" jdbcType="VARCHAR"/>
        <result property="syscur" column="syscur" jdbcType="VARCHAR"/>
        <result property="ratbascur" column="ratbascur" jdbcType="VARCHAR"/>
        <result property="ver" column="ver" jdbcType="VARCHAR"/>
        <result property="xrtratdir" column="xrtratdir" jdbcType="INTEGER"/>
    </resultMap>

    <sql id="Base_Column_List">
        inr,extkey,nam,syscur,ratbascur,ver,xrtratdir
    </sql>

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

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

    <insert id="insert">
        insert into etg (<include refid="Base_Column_List" />)
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            #{inr,jdbcType=VARCHAR},
            #{extkey,jdbcType=VARCHAR},
            #{nam,jdbcType=VARCHAR},
            #{syscur,jdbcType=VARCHAR},
            #{ratbascur,jdbcType=VARCHAR},
            #{ver,jdbcType=VARCHAR},
            #{xrtratdir,jdbcType=INTEGER},
        </trim>
    </insert>

    <insert id="insertSelective">
        insert into etg
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="inr != null">inr,</if>
            <if test="extkey != null">extkey,</if>
            <if test="nam != null">nam,</if>
            <if test="syscur != null">syscur,</if>
            <if test="ratbascur != null">ratbascur,</if>
            <if test="ver != null">ver,</if>
            <if test="xrtratdir != null">xrtratdir,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="inr != null">#{inr,jdbcType=VARCHAR}, </if>
            <if test="extkey != null">#{extkey,jdbcType=VARCHAR}, </if>
            <if test="nam != null">#{nam,jdbcType=VARCHAR}, </if>
            <if test="syscur != null">#{syscur,jdbcType=VARCHAR}, </if>
            <if test="ratbascur != null">#{ratbascur,jdbcType=VARCHAR}, </if>
            <if test="ver != null">#{ver,jdbcType=VARCHAR}, </if>
            <if test="xrtratdir != null">#{xrtratdir,jdbcType=INTEGER}, </if>
        </trim>
    </insert>

    <update id="updateByPrimaryKeySelective">
        update etg
        <set>
            <if test="extkey != null">extkey = #{extkey,jdbcType=VARCHAR},</if>
            <if test="nam != null">nam = #{nam,jdbcType=VARCHAR},</if>
            <if test="syscur != null">syscur = #{syscur,jdbcType=VARCHAR},</if>
            <if test="ratbascur != null">ratbascur = #{ratbascur,jdbcType=VARCHAR},</if>
            <if test="ver != null">ver = #{ver,jdbcType=VARCHAR},</if>
            <if test="xrtratdir != null">xrtratdir = #{xrtratdir,jdbcType=INTEGER},</if>
        </set>
        where inr = #{inr,jdbcType=VARCHAR}
    </update>

    <update id="updateByPrimaryKey">
        update etg
        <set>
            extkey = #{extkey,jdbcType=VARCHAR},
            nam = #{nam,jdbcType=VARCHAR},
            syscur = #{syscur,jdbcType=VARCHAR},
            ratbascur = #{ratbascur,jdbcType=VARCHAR},
            ver = #{ver,jdbcType=VARCHAR},
            xrtratdir = #{xrtratdir,jdbcType=INTEGER},
        </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 etg
        <set>
            <if test="module.extkey != null">extkey = #{module.extkey,jdbcType=VARCHAR},</if>
            <if test="module.nam != null">nam = #{module.nam,jdbcType=VARCHAR},</if>
            <if test="module.syscur != null">syscur = #{module.syscur,jdbcType=VARCHAR},</if>
            <if test="module.ratbascur != null">ratbascur = #{module.ratbascur,jdbcType=VARCHAR},</if>
            <if test="module.ver != null">ver = #{module.ver,jdbcType=VARCHAR},</if>
            <if test="module.xrtratdir != null">xrtratdir = #{module.xrtratdir,jdbcType=INTEGER},</if>
        </set>
        ${conditions}
    </update>

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

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

    <select id="getEtgByExtkey" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from etg
        where trim(extkey) = trim(#{extkey,jdbcType=VARCHAR})
    </select>

</mapper>