wfsmapper.xml 4.15 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
<?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.WfsMapper">

    <resultMap id="BaseResultMap" type="com.brilliance.isc.bo.Wfs">
        <result property="inr" column="inr" jdbcType="VARCHAR"/>
        <result property="objtyp" column="objtyp" jdbcType="VARCHAR"/>
        <result property="objinr" column="objinr" jdbcType="VARCHAR"/>
        <result property="objnam" column="objnam" jdbcType="VARCHAR"/>
        <result property="etyextkey" column="etyextkey" jdbcType="VARCHAR"/>
    </resultMap>

    <sql id="Base_Column_List">
        inr,objtyp,objinr,objnam,etyextkey
    </sql>

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

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

    <insert id="insert">
        insert into wfs (<include refid="Base_Column_List" />)
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            #{inr,jdbcType=VARCHAR},
            #{objtyp,jdbcType=VARCHAR},
            #{objinr,jdbcType=VARCHAR},
            #{objnam,jdbcType=VARCHAR},
            #{etyextkey,jdbcType=VARCHAR},
        </trim>
    </insert>

    <insert id="insertSelective">
        insert into wfs
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="inr != null">inr,</if>
            <if test="objtyp != null">objtyp,</if>
            <if test="objinr != null">objinr,</if>
            <if test="objnam != null">objnam,</if>
            <if test="etyextkey != null">etyextkey,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="inr != null">#{inr,jdbcType=VARCHAR}, </if>
            <if test="objtyp != null">#{objtyp,jdbcType=VARCHAR}, </if>
            <if test="objinr != null">#{objinr,jdbcType=VARCHAR}, </if>
            <if test="objnam != null">#{objnam,jdbcType=VARCHAR}, </if>
            <if test="etyextkey != null">#{etyextkey,jdbcType=VARCHAR}, </if>
        </trim>
    </insert>

    <update id="updateByPrimaryKeySelective">
        update wfs
        <set>
            <if test="objtyp != null">objtyp = #{objtyp,jdbcType=VARCHAR},</if>
            <if test="objinr != null">objinr = #{objinr,jdbcType=VARCHAR},</if>
            <if test="objnam != null">objnam = #{objnam,jdbcType=VARCHAR},</if>
            <if test="etyextkey != null">etyextkey = #{etyextkey,jdbcType=VARCHAR},</if>
        </set>
        where inr = #{inr,jdbcType=VARCHAR}
    </update>

    <update id="updateByPrimaryKey">
        update wfs
        <set>
            objtyp = #{objtyp,jdbcType=VARCHAR},
            objinr = #{objinr,jdbcType=VARCHAR},
            objnam = #{objnam,jdbcType=VARCHAR},
            etyextkey = #{etyextkey,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 wfs
        <set>
            <if test="module.objtyp != null">objtyp = #{module.objtyp,jdbcType=VARCHAR},</if>
            <if test="module.objinr != null">objinr = #{module.objinr,jdbcType=VARCHAR},</if>
            <if test="module.objnam != null">objnam = #{module.objnam,jdbcType=VARCHAR},</if>
            <if test="module.etyextkey != null">etyextkey = #{module.etyextkey,jdbcType=VARCHAR},</if>
        </set>
        ${conditions}
    </update>

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

    <select id="dyncRead" resultMap="BaseResultMap">
        ${sql}
    </select>
    <select id="selectByObjtypAndObjinr" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from wfs
        where
        objtyp = #{objtyp,jdbcType=VARCHAR}
        AND objinr = #{objinr,jdbcType=VARCHAR}
    </select>

</mapper>