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

    <resultMap id="BaseResultMap" type="com.brilliance.isc.esb.newmodel.cecm.Cecmset">
        <result property="ownref" column="ownref" jdbcType="VARCHAR"/>
        <result property="ldbh" column="ldbh" jdbcType="VARCHAR"/>
        <result property="fkrq" column="fkrq" jdbcType="VARCHAR"/>
        <result property="fkje" column="fkje" jdbcType="VARCHAR"/>
        <result property="bzjfkje" column="bzjfkje" jdbcType="VARCHAR"/>
        <result property="xyzbdje" column="xyzbdje" jdbcType="VARCHAR"/>
        <result property="battrninr" column="battrninr" jdbcType="VARCHAR"/>
        <result property="trninr" column="trninr" jdbcType="VARCHAR"/>
        <result property="inr" column="inr" jdbcType="VARCHAR"/>
    </resultMap>

    <sql id="Base_Column_List">
        ownref,ldbh,fkrq,fkje,bzjfkje,xyzbdje,battrninr,trninr,inr
    </sql>

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

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

    <insert id="insert">
        insert into cecmset (<include refid="Base_Column_List" />)
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            #{ownref,jdbcType=VARCHAR},
            #{ldbh,jdbcType=VARCHAR},
            #{fkrq,jdbcType=VARCHAR},
            #{fkje,jdbcType=VARCHAR},
            #{bzjfkje,jdbcType=VARCHAR},
            #{xyzbdje,jdbcType=VARCHAR},
            #{battrninr,jdbcType=VARCHAR},
            #{trninr,jdbcType=VARCHAR},
            #{inr,jdbcType=VARCHAR},
        </trim>
    </insert>

    <insert id="insertSelective">
        insert into cecmset
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="ownref != null">ownref,</if>
            <if test="ldbh != null">ldbh,</if>
            <if test="fkrq != null">fkrq,</if>
            <if test="fkje != null">fkje,</if>
            <if test="bzjfkje != null">bzjfkje,</if>
            <if test="xyzbdje != null">xyzbdje,</if>
            <if test="battrninr != null">battrninr,</if>
            <if test="trninr != null">trninr,</if>
            <if test="inr != null">trninr,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="ownref != null">#{ownref,jdbcType=VARCHAR}, </if>
            <if test="ldbh != null">#{ldbh,jdbcType=VARCHAR}, </if>
            <if test="fkrq != null">#{fkrq,jdbcType=VARCHAR}, </if>
            <if test="fkje != null">#{fkje,jdbcType=VARCHAR}, </if>
            <if test="bzjfkje != null">#{bzjfkje,jdbcType=VARCHAR}, </if>
            <if test="xyzbdje != null">#{xyzbdje,jdbcType=VARCHAR}, </if>
            <if test="battrninr != null">#{battrninr,jdbcType=VARCHAR}, </if>
            <if test="trninr != null">#{trninr,jdbcType=VARCHAR}, </if>
            <if test="inr != null">#{inr,jdbcType=VARCHAR}, </if>
        </trim>
    </insert>

    <update id="updateByPrimaryKeySelective">
        update cecmset
        <set>
            <if test="ownref != null">ownref = #{ownref,jdbcType=VARCHAR},</if>
            <if test="ldbh != null">ldbh = #{ldbh,jdbcType=VARCHAR},</if>
            <if test="fkrq != null">fkrq = #{fkrq,jdbcType=VARCHAR},</if>
            <if test="fkje != null">fkje = #{fkje,jdbcType=VARCHAR},</if>
            <if test="bzjfkje != null">bzjfkje = #{bzjfkje,jdbcType=VARCHAR},</if>
            <if test="xyzbdje != null">xyzbdje = #{xyzbdje,jdbcType=VARCHAR},</if>
            <if test="battrninr != null">battrninr = #{battrninr,jdbcType=VARCHAR},</if>
            <if test="trninr != null">trninr = #{trninr,jdbcType=VARCHAR},</if>
            <if test="inr != null">inr = #{inr,jdbcType=VARCHAR},</if>
        </set>
        where inr = #{inr,jdbcType=VARCHAR}
    </update>

    <update id="updateByPrimaryKey">
        update cecmset
        <set>
            ownref = #{ownref,jdbcType=VARCHAR},
            ldbh = #{ldbh,jdbcType=VARCHAR},
            fkrq = #{fkrq,jdbcType=VARCHAR},
            fkje = #{fkje,jdbcType=VARCHAR},
            bzjfkje = #{bzjfkje,jdbcType=VARCHAR},
            xyzbdje = #{xyzbdje,jdbcType=VARCHAR},
            battrninr = #{battrninr,jdbcType=VARCHAR},
            trninr = #{trninr,jdbcType=VARCHAR},
            inr = #{inr,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 cecmset
        <set>
            <if test="module.ownref != null">ownref = #{module.ownref,jdbcType=VARCHAR},</if>
            <if test="module.ldbh != null">ldbh = #{module.ldbh,jdbcType=VARCHAR},</if>
            <if test="module.fkrq != null">fkrq = #{module.fkrq,jdbcType=VARCHAR},</if>
            <if test="module.fkje != null">fkje = #{module.fkje,jdbcType=VARCHAR},</if>
            <if test="module.bzjfkje != null">bzjfkje = #{module.bzjfkje,jdbcType=VARCHAR},</if>
            <if test="module.xyzbdje != null">xyzbdje = #{module.xyzbdje,jdbcType=VARCHAR},</if>
            <if test="module.battrninr != null">battrninr = #{module.battrninr,jdbcType=VARCHAR},</if>
            <if test="module.trninr != null">trninr = #{module.trninr,jdbcType=VARCHAR},</if>
            <if test="module.inr != null">inr = #{module.inr,jdbcType=VARCHAR},</if>
        </set>
        ${conditions}
    </update>

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

    <select id="dyncRead" resultMap="BaseResultMap">
        ${sql}
    </select>
    <select id="selectByTrninr" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from cecmset
        where trninr = #{trninr,jdbcType=VARCHAR}
    </select>
    <delete id="deleteByTrninr">
        delete from cecmset
        where trninr = #{trninr,jdbcType=VARCHAR}
    </delete>
</mapper>