<?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.SweygeMapper">

    <resultMap id="BaseResultMap" type="com.brilliance.isc.bo.Sweyge">
        <result property="inr" column="inr" jdbcType="VARCHAR"/>
        <result property="sweinr" column="sweinr" jdbcType="VARCHAR"/>
        <result property="msgtyp" column="msgtyp" jdbcType="VARCHAR"/>
        <result property="relcur" column="relcur" jdbcType="VARCHAR"/>
        <result property="relamt" column="relamt" jdbcType="DECIMAL"/>
        <result property="sysno" column="sysno" jdbcType="VARCHAR"/>
        <result property="rcvdat" column="rcvdat" jdbcType="DATE"/>
        <result property="orcnam" column="orcnam" jdbcType="VARCHAR"/>
        <result property="pyenam" column="pyenam" jdbcType="VARCHAR"/>
        <result property="flg" column="flg" jdbcType="VARCHAR"/>
        <result property="pyeact" column="pyeact" jdbcType="VARCHAR"/>
        <result property="ecifno" column="ecifno" jdbcType="VARCHAR"/>
        <result property="accbch" column="accbch" jdbcType="VARCHAR"/>
    </resultMap>

    <sql id="Base_Column_List">
        inr,sweinr,msgtyp,relcur,relamt,sysno,rcvdat,orcnam,pyenam,flg,pyeact,ecifno,accbch
    </sql>

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

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

    <insert id="insert">
        insert into sweyge (<include refid="Base_Column_List" />)
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            #{inr,jdbcType=VARCHAR},
            #{sweinr,jdbcType=VARCHAR},
            #{msgtyp,jdbcType=VARCHAR},
            #{relcur,jdbcType=VARCHAR},
            #{relamt,jdbcType=DECIMAL},
            #{sysno,jdbcType=VARCHAR},
            #{rcvdat,jdbcType=DATE},
            #{orcnam,jdbcType=VARCHAR},
            #{pyenam,jdbcType=VARCHAR},
            #{flg,jdbcType=VARCHAR},
            #{pyeact,jdbcType=VARCHAR},
            #{ecifno,jdbcType=VARCHAR},
            #{accbch,jdbcType=VARCHAR},
        </trim>
    </insert>

    <insert id="insertSelective">
        insert into sweyge
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="inr != null">inr,</if>
            <if test="sweinr != null">sweinr,</if>
            <if test="msgtyp != null">msgtyp,</if>
            <if test="relcur != null">relcur,</if>
            <if test="relamt != null">relamt,</if>
            <if test="sysno != null">sysno,</if>
            <if test="rcvdat != null">rcvdat,</if>
            <if test="orcnam != null">orcnam,</if>
            <if test="pyenam != null">pyenam,</if>
            <if test="flg != null">flg,</if>
            <if test="pyeact != null">pyeact,</if>
            <if test="ecifno != null">ecifno,</if>
            <if test="accbch != null">accbch,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="inr != null">#{inr,jdbcType=VARCHAR}, </if>
            <if test="sweinr != null">#{sweinr,jdbcType=VARCHAR}, </if>
            <if test="msgtyp != null">#{msgtyp,jdbcType=VARCHAR}, </if>
            <if test="relcur != null">#{relcur,jdbcType=VARCHAR}, </if>
            <if test="relamt != null">#{relamt,jdbcType=DECIMAL}, </if>
            <if test="sysno != null">#{sysno,jdbcType=VARCHAR}, </if>
            <if test="rcvdat != null">#{rcvdat,jdbcType=DATE}, </if>
            <if test="orcnam != null">#{orcnam,jdbcType=VARCHAR}, </if>
            <if test="pyenam != null">#{pyenam,jdbcType=VARCHAR}, </if>
            <if test="flg != null">#{flg,jdbcType=VARCHAR}, </if>
            <if test="pyeact != null">#{pyeact,jdbcType=VARCHAR}, </if>
            <if test="ecifno != null">#{ecifno,jdbcType=VARCHAR}, </if>
            <if test="accbch != null">#{accbch,jdbcType=VARCHAR}, </if>
        </trim>
    </insert>

    <update id="updateByPrimaryKeySelective">
        update sweyge
        <set>
            <if test="sweinr != null">sweinr = #{sweinr,jdbcType=VARCHAR},</if>
            <if test="msgtyp != null">msgtyp = #{msgtyp,jdbcType=VARCHAR},</if>
            <if test="relcur != null">relcur = #{relcur,jdbcType=VARCHAR},</if>
            <if test="relamt != null">relamt = #{relamt,jdbcType=DECIMAL},</if>
            <if test="sysno != null">sysno = #{sysno,jdbcType=VARCHAR},</if>
            <if test="rcvdat != null">rcvdat = #{rcvdat,jdbcType=DATE},</if>
            <if test="orcnam != null">orcnam = #{orcnam,jdbcType=VARCHAR},</if>
            <if test="pyenam != null">pyenam = #{pyenam,jdbcType=VARCHAR},</if>
            <if test="flg != null">flg = #{flg,jdbcType=VARCHAR},</if>
            <if test="pyeact != null">pyeact = #{pyeact,jdbcType=VARCHAR},</if>
            <if test="ecifno != null">ecifno = #{ecifno,jdbcType=VARCHAR},</if>
            <if test="accbch != null">accbch = #{accbch,jdbcType=VARCHAR},</if>
        </set>
        where inr = #{inr,jdbcType=VARCHAR}
    </update>

    <update id="updateByPrimaryKey">
        update sweyge
        <set>
            sweinr = #{sweinr,jdbcType=VARCHAR},
            msgtyp = #{msgtyp,jdbcType=VARCHAR},
            relcur = #{relcur,jdbcType=VARCHAR},
            relamt = #{relamt,jdbcType=DECIMAL},
            sysno = #{sysno,jdbcType=VARCHAR},
            rcvdat = #{rcvdat,jdbcType=DATE},
            orcnam = #{orcnam,jdbcType=VARCHAR},
            pyenam = #{pyenam,jdbcType=VARCHAR},
            flg = #{flg,jdbcType=VARCHAR},
            pyeact = #{pyeact,jdbcType=VARCHAR},
            ecifno = #{ecifno,jdbcType=VARCHAR},
            accbch = #{accbch,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 sweyge
        <set>
            <if test="module.sweinr != null">sweinr = #{module.sweinr,jdbcType=VARCHAR},</if>
            <if test="module.msgtyp != null">msgtyp = #{module.msgtyp,jdbcType=VARCHAR},</if>
            <if test="module.relcur != null">relcur = #{module.relcur,jdbcType=VARCHAR},</if>
            <if test="module.relamt != null">relamt = #{module.relamt,jdbcType=DECIMAL},</if>
            <if test="module.sysno != null">sysno = #{module.sysno,jdbcType=VARCHAR},</if>
            <if test="module.rcvdat != null">rcvdat = #{module.rcvdat,jdbcType=DATE},</if>
            <if test="module.orcnam != null">orcnam = #{module.orcnam,jdbcType=VARCHAR},</if>
            <if test="module.pyenam != null">pyenam = #{module.pyenam,jdbcType=VARCHAR},</if>
            <if test="module.flg != null">flg = #{module.flg,jdbcType=VARCHAR},</if>
            <if test="module.pyeact != null">pyeact = #{module.pyeact,jdbcType=VARCHAR},</if>
            <if test="module.ecifno != null">ecifno = #{module.ecifno,jdbcType=VARCHAR},</if>
            <if test="module.accbch != null">accbch = #{module.accbch,jdbcType=VARCHAR},</if>
        </set>
        ${conditions}
    </update>

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

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

</mapper>