gadmapper.xml 6.72 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
<?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.GadMapper">

    <resultMap id="BaseResultMap" type="com.brilliance.isc.bo.Gad">
        <result property="inr" column="inr" jdbcType="VARCHAR"/>
        <result property="gidinr" column="gidinr" jdbcType="VARCHAR"/>
        <result property="trninr" column="trninr" jdbcType="VARCHAR"/>
        <result property="opnsta" column="opnsta" jdbcType="VARCHAR"/>
        <result property="amesta" column="amesta" jdbcType="VARCHAR"/>
        <result property="cansta" column="cansta" jdbcType="VARCHAR"/>
        <result property="oldamt" column="oldamt" jdbcType="DECIMAL"/>
        <result property="olddat" column="olddat" jdbcType="DATE"/>
        <result property="ownref" column="ownref" jdbcType="VARCHAR"/>
        <result property="errmsg" column="errmsg" jdbcType="VARCHAR"/>
        <result property="ythmos" column="ythmos" jdbcType="VARCHAR"/>
    </resultMap>

    <sql id="Base_Column_List">
        inr,gidinr,trninr,opnsta,amesta,cansta,oldamt,olddat,ownref,errmsg,ythmos
    </sql>

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

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

    <insert id="insert">
        insert into gad (<include refid="Base_Column_List"/>)
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            #{inr,jdbcType=VARCHAR},
            #{gidinr,jdbcType=VARCHAR},
            #{trninr,jdbcType=VARCHAR},
            #{opnsta,jdbcType=VARCHAR},
            #{amesta,jdbcType=VARCHAR},
            #{cansta,jdbcType=VARCHAR},
            #{oldamt,jdbcType=DECIMAL},
            #{olddat,jdbcType=DATE},
            #{ownref,jdbcType=VARCHAR},
            #{errmsg,jdbcType=VARCHAR},
            #{ythmos,jdbcType=VARCHAR},
        </trim>
    </insert>

    <insert id="insertSelective">
        insert into gad
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="inr != null">inr,</if>
            <if test="gidinr != null">gidinr,</if>
            <if test="trninr != null">trninr,</if>
            <if test="opnsta != null">opnsta,</if>
            <if test="amesta != null">amesta,</if>
            <if test="cansta != null">cansta,</if>
            <if test="oldamt != null">oldamt,</if>
            <if test="olddat != null">olddat,</if>
            <if test="ownref != null">ownref,</if>
            <if test="errmsg != null">errmsg,</if>
            <if test="ythmos != null">ythmos,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="inr != null">#{inr,jdbcType=VARCHAR},</if>
            <if test="gidinr != null">#{gidinr,jdbcType=VARCHAR},</if>
            <if test="trninr != null">#{trninr,jdbcType=VARCHAR},</if>
            <if test="opnsta != null">#{opnsta,jdbcType=VARCHAR},</if>
            <if test="amesta != null">#{amesta,jdbcType=VARCHAR},</if>
            <if test="cansta != null">#{cansta,jdbcType=VARCHAR},</if>
            <if test="oldamt != null">#{oldamt,jdbcType=DECIMAL},</if>
            <if test="olddat != null">#{olddat,jdbcType=DATE},</if>
            <if test="ownref != null">#{ownref,jdbcType=VARCHAR},</if>
            <if test="errmsg != null">#{errmsg,jdbcType=VARCHAR},</if>
            <if test="ythmos != null">#{ythmos,jdbcType=VARCHAR},</if>
        </trim>
    </insert>

    <update id="updateByPrimaryKeySelective">
        update gad
        <set>
            <if test="gidinr != null">gidinr = #{gidinr,jdbcType=VARCHAR},</if>
            <if test="trninr != null">trninr = #{trninr,jdbcType=VARCHAR},</if>
            <if test="opnsta != null">opnsta = #{opnsta,jdbcType=VARCHAR},</if>
            <if test="amesta != null">amesta = #{amesta,jdbcType=VARCHAR},</if>
            <if test="cansta != null">cansta = #{cansta,jdbcType=VARCHAR},</if>
            <if test="oldamt != null">oldamt = #{oldamt,jdbcType=DECIMAL},</if>
            <if test="olddat != null">olddat = #{olddat,jdbcType=DATE},</if>
            <if test="ownref != null">ownref = #{ownref,jdbcType=VARCHAR},</if>
            <if test="errmsg != null">errmsg = #{errmsg,jdbcType=VARCHAR},</if>
            <if test="ythmos != null">ythmos = #{ythmos,jdbcType=VARCHAR},</if>
        </set>
        where inr = #{inr,jdbcType=VARCHAR}
    </update>

    <update id="updateByPrimaryKey">
        update gad
        <set>
            gidinr = #{gidinr,jdbcType=VARCHAR},
            trninr = #{trninr,jdbcType=VARCHAR},
            opnsta = #{opnsta,jdbcType=VARCHAR},
            amesta = #{amesta,jdbcType=VARCHAR},
            cansta = #{cansta,jdbcType=VARCHAR},
            oldamt = #{oldamt,jdbcType=DECIMAL},
            olddat = #{olddat,jdbcType=DATE},
            ownref = #{ownref,jdbcType=VARCHAR},
            errmsg = #{errmsg,jdbcType=VARCHAR},
            ythmos = #{ythmos,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 gad
        <set>
            <if test="module.gidinr != null">gidinr = #{module.gidinr,jdbcType=VARCHAR},</if>
            <if test="module.trninr != null">trninr = #{module.trninr,jdbcType=VARCHAR},</if>
            <if test="module.opnsta != null">opnsta = #{module.opnsta,jdbcType=VARCHAR},</if>
            <if test="module.amesta != null">amesta = #{module.amesta,jdbcType=VARCHAR},</if>
            <if test="module.cansta != null">cansta = #{module.cansta,jdbcType=VARCHAR},</if>
            <if test="module.oldamt != null">oldamt = #{module.oldamt,jdbcType=DECIMAL},</if>
            <if test="module.olddat != null">olddat = #{module.olddat,jdbcType=DATE},</if>
            <if test="module.ownref != null">ownref = #{module.ownref,jdbcType=VARCHAR},</if>
            <if test="module.errmsg != null">errmsg = #{module.errmsg,jdbcType=VARCHAR},</if>
            <if test="module.ythmos != null">ythmos = #{module.ythmos,jdbcType=VARCHAR},</if>
        </set>
        ${conditions}
    </update>

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

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

    <select id="selectGadByGidinr" resultMap="BaseResultMap">
        select <include refid="Base_Column_List"/>
        from GAD
        where gidinr=#{gidinr,jdbcType=VARCHAR}
    </select>

</mapper>