fctmapper.xml 2.93 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
<?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.FctMapper">

    <resultMap id="BaseResultMap" type="com.brilliance.isc.bo.Fct">
        <result property="inr" column="inr" jdbcType="VARCHAR"/>
        <result property="apladrblk" column="apladrblk" jdbcType="VARCHAR"/>
        <result property="narhis" column="narhis" jdbcType="VARCHAR"/>
        <result property="fldmodblk" column="fldmodblk" jdbcType="VARCHAR"/>

    </resultMap>

    <sql id="Base_Column_List">
        inr,apladrblk,narhis,fldmodblk
    </sql>

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

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

    <insert id="insert">
        insert into fct (<include refid="Base_Column_List"/>)
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            #{inr,jdbcType=VARCHAR},
            #{apladrblk,jdbcType=VARCHAR},
            #{narhis,jdbcType=VARCHAR},
            #{fldmodblk,jdbcType=VARCHAR},
        </trim>
    </insert>

    <insert id="insertSelective">
        insert into fct
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="inr != null">inr,</if>
            <if test="apladrblk != null">apladrblk,</if>
            <if test="narhis != null">narhis,</if>
            <if test="fldmodblk != null">fldmodblk,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="inr != null">#{inr,jdbcType=VARCHAR},</if>
            <if test="apladrblk != null">#{apladrblk,jdbcType=VARCHAR},</if>
            <if test="narhis != null">#{narhis,jdbcType=VARCHAR},</if>
            <if test="fldmodblk != null">#{fldmodblk,jdbcType=VARCHAR},</if>
        </trim>
    </insert>

    <update id="updateByPrimaryKeySelective">
        update fct
        <set>
            <if test="apladrblk != null">apladrblk = #{apladrblk,jdbcType=VARCHAR},</if>
            <if test="narhis != null">narhis = #{narhis,jdbcType=VARCHAR},</if>
            <if test="fldmodblk != null">fldmodblk = #{fldmodblk,jdbcType=VARCHAR},</if>
        </set>
        where inr = #{inr,jdbcType=VARCHAR}
    </update>

    <update id="updateByPrimaryKey">
        update fct
        <set>
            apladrblk = #{apladrblk,jdbcType=VARCHAR},
            narhis = #{narhis,jdbcType=VARCHAR},
            fldmodblk = #{fldmodblk,jdbcType=VARCHAR},
        </set>
        where inr = #{inr,jdbcType=VARCHAR}
    </update>

    <delete id="deleteByIds">
        delete from fct where inr in
        <foreach item="item" index="index" collection="collection" open="(" separator="," close=")">
            #{item}
        </foreach>
    </delete>

</mapper>