imgvpbsmapper.xml 3.89 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
<?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.ImgvpbsMapper">

    <resultMap id="BaseResultMap" type="com.brilliance.isc.bo.model.Imgvpbs">
        <result column="ftynum" property="ftynum" jdbcType="VARCHAR"/>
        <result column="filetype" property="filetype" jdbcType="VARCHAR"/>
        <result column="signaturetype" property="signaturetype" jdbcType="VARCHAR"/>
        <result column="filename" property="filename" jdbcType="VARCHAR"/>
        <result column="inr" property="inr" jdbcType="VARCHAR"/>
        <result column="trninr" property="trninr" jdbcType="VARCHAR"/>
        <result column="smhinr" property="smhinr" jdbcType="VARCHAR"/>
        <result column="sighfilenam" property="sighfilenam" jdbcType="VARCHAR"/>
        <result column="sighfilpath" property="sighfilpath" jdbcType="VARCHAR"/>
        <result column="sta" property="sta" jdbcType="VARCHAR"/>
        <result column="rstext" property="rstext" jdbcType="VARCHAR"/>
        <result column="docid" property="docid" jdbcType="VARCHAR"/>
        <result column="prtcnt" property="prtcnt" jdbcType="NUMERIC"/>
    </resultMap>

    <sql id="Base_Column_List">
        ftynum,filetype,signaturetype,filename,inr,trninr,smhinr,sighfilenam,sighfilpath,sta,rstext,docid,prtcnt
    </sql>

    <select id="selectByTrninrAndSta" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from imgvpbs
        where
        trninr = #{trninr,jdbcType=VARCHAR}
        AND sta = #{sta,jdbcType=VARCHAR}
    </select>

    <select id="selectByFtynum" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from imgvpbs
        where
        ftynum = #{ftynum,jdbcType=VARCHAR}
    </select>

    <insert id="insert">
        insert into imgvpbs (<include refid="Base_Column_List" />)
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            #{ftynum,jdbcType=VARCHAR},
            #{filetype,jdbcType=VARCHAR},
            #{signaturetype,jdbcType=VARCHAR},
            #{filename,jdbcType=VARCHAR},
            #{inr,jdbcType=VARCHAR},
            #{trninr,jdbcType=VARCHAR},
            #{smhinr,jdbcType=VARCHAR},
            #{sighfilenam,jdbcType=VARCHAR},
            #{sighfilpath,jdbcType=VARCHAR},
            #{sta,jdbcType=VARCHAR},
            #{rstext,jdbcType=VARCHAR},
            #{docid,jdbcType=VARCHAR},
            #{prtcnt,jdbcType=NUMERIC},
        </trim>
    </insert>

    <select id="selectByRecord" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from imgvpbs
        where
        trninr = #{trninr,jdbcType=VARCHAR}
        AND filetype = #{filetype,jdbcType=VARCHAR}
        AND smhinr = #{smhinr,jdbcType=VARCHAR}
    </select>

    <update id="updateByPrimaryKey">
        update imgvpbs
        <set>
            ftynum = #{ftynum,jdbcType=VARCHAR},
            filetype = #{filetype,jdbcType=VARCHAR},
            signaturetype = #{signaturetype,jdbcType=VARCHAR},
            filename = #{filename,jdbcType=VARCHAR},
            inr = #{inr,jdbcType=VARCHAR},
            trninr = #{trninr,jdbcType=VARCHAR},
            smhinr = #{smhinr,jdbcType=VARCHAR},
            sighfilenam = #{sighfilenam,jdbcType=VARCHAR},
            sighfilpath = #{sighfilpath,jdbcType=VARCHAR},
            sta = #{sta,jdbcType=VARCHAR},
            rstext = #{rstext,jdbcType=VARCHAR},
            docid = #{docid,jdbcType=VARCHAR},
            prtcnt = #{prtcnt,jdbcType=NUMERIC},
        </set>
        <where>
            inr = #{inr,jdbcType=VARCHAR}
        </where>
    </update>

    <update id="increasePrtcnt">
        update imgvpbs
        <set>
            prtcnt = prtcnt + 1,
        </set>
        <where>
            ftynum = #{ftynum,jdbcType=VARCHAR}
        </where>
    </update>
</mapper>