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

    <resultMap id="BaseResultMap" type="com.brilliance.isc.esb.newmodel.cecm.Cecmame">
        <result property="ownref" column="ownref" jdbcType="VARCHAR"/>
        <result property="jerc" column="jerc" jdbcType="VARCHAR"/>
        <result property="yxqdqr" column="yxqdqr" jdbcType="VARCHAR"/>
        <result property="xgbz" column="xgbz" jdbcType="VARCHAR"/>
        <result property="xgje" column="xgje" jdbcType="VARCHAR"/>
        <result property="bdye" column="bdye" jdbcType="VARCHAR"/>
        <result property="fkqxlx" column="fkqxlx" jdbcType="VARCHAR"/>
        <result property="tzhbzjbl" column="tzhbzjbl" jdbcType="VARCHAR"/>
        <result property="bzjzh" column="bzjzh" 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,jerc,yxqdqr,xgbz,xgje,bdye,fkqxlx,tzhbzjbl,bzjzh,battrninr,trninr,inr
    </sql>

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

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

    <insert id="insert">
        insert into cecmame (<include refid="Base_Column_List" />)
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            #{ownref,jdbcType=VARCHAR},
            #{jerc,jdbcType=VARCHAR},
            #{yxqdqr,jdbcType=VARCHAR},
            #{xgbz,jdbcType=VARCHAR},
            #{xgje,jdbcType=VARCHAR},
            #{bdye,jdbcType=VARCHAR},
            #{fkqxlx,jdbcType=VARCHAR},
            #{tzhbzjbl,jdbcType=VARCHAR},
            #{bzjzh,jdbcType=VARCHAR},
            #{battrninr,jdbcType=VARCHAR},
            #{trninr,jdbcType=VARCHAR},
            #{inr,jdbcType=VARCHAR},
        </trim>
    </insert>

    <insert id="insertSelective">
        insert into cecmame
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="ownref != null">ownref,</if>
            <if test="jerc != null">jerc,</if>
            <if test="yxqdqr != null">yxqdqr,</if>
            <if test="xgbz != null">xgbz,</if>
            <if test="xgje != null">xgje,</if>
            <if test="bdye != null">bdye,</if>
            <if test="fkqxlx != null">fkqxlx,</if>
            <if test="tzhbzjbl != null">tzhbzjbl,</if>
            <if test="bzjzh != null">bzjzh,</if>
            <if test="battrninr != null">battrninr,</if>
            <if test="trninr != null">trninr,</if>
            <if test="inr != null">inr,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="ownref != null">#{ownref,jdbcType=VARCHAR}, </if>
            <if test="jerc != null">#{jerc,jdbcType=VARCHAR}, </if>
            <if test="yxqdqr != null">#{yxqdqr,jdbcType=VARCHAR}, </if>
            <if test="xgbz != null">#{xgbz,jdbcType=VARCHAR}, </if>
            <if test="xgje != null">#{xgje,jdbcType=VARCHAR}, </if>
            <if test="bdye != null">#{bdye,jdbcType=VARCHAR}, </if>
            <if test="fkqxlx != null">#{fkqxlx,jdbcType=VARCHAR}, </if>
            <if test="tzhbzjbl != null">#{tzhbzjbl,jdbcType=VARCHAR}, </if>
            <if test="bzjzh != null">#{bzjzh,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 cecmame
        <set>
            <if test="ownref != null">ownref = #{ownref,jdbcType=VARCHAR},</if>
            <if test="jerc != null">jerc = #{jerc,jdbcType=VARCHAR},</if>
            <if test="yxqdqr != null">yxqdqr = #{yxqdqr,jdbcType=VARCHAR},</if>
            <if test="xgbz != null">xgbz = #{xgbz,jdbcType=VARCHAR},</if>
            <if test="xgje != null">xgje = #{xgje,jdbcType=VARCHAR},</if>
            <if test="bdye != null">bdye = #{bdye,jdbcType=VARCHAR},</if>
            <if test="fkqxlx != null">fkqxlx = #{fkqxlx,jdbcType=VARCHAR},</if>
            <if test="tzhbzjbl != null">tzhbzjbl = #{tzhbzjbl,jdbcType=VARCHAR},</if>
            <if test="bzjzh != null">bzjzh = #{bzjzh,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 cecmame
        <set>
            ownref = #{ownref,jdbcType=VARCHAR},
            jerc = #{jerc,jdbcType=VARCHAR},
            yxqdqr = #{yxqdqr,jdbcType=VARCHAR},
            xgbz = #{xgbz,jdbcType=VARCHAR},
            xgje = #{xgje,jdbcType=VARCHAR},
            bdye = #{bdye,jdbcType=VARCHAR},
            fkqxlx = #{fkqxlx,jdbcType=VARCHAR},
            tzhbzjbl = #{tzhbzjbl,jdbcType=VARCHAR},
            bzjzh = #{bzjzh,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 cecmame
        <set>
            <if test="module.ownref != null">ownref = #{module.ownref,jdbcType=VARCHAR},</if>
            <if test="module.jerc != null">jerc = #{module.jerc,jdbcType=VARCHAR},</if>
            <if test="module.yxqdqr != null">yxqdqr = #{module.yxqdqr,jdbcType=VARCHAR},</if>
            <if test="module.xgbz != null">xgbz = #{module.xgbz,jdbcType=VARCHAR},</if>
            <if test="module.xgje != null">xgje = #{module.xgje,jdbcType=VARCHAR},</if>
            <if test="module.bdye != null">bdye = #{module.bdye,jdbcType=VARCHAR},</if>
            <if test="module.fkqxlx != null">fkqxlx = #{module.fkqxlx,jdbcType=VARCHAR},</if>
            <if test="module.tzhbzjbl != null">tzhbzjbl = #{module.tzhbzjbl,jdbcType=VARCHAR},</if>
            <if test="module.bzjzh != null">bzjzh = #{module.bzjzh,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 cecmame
        where trninr = #{trninr,jdbcType=VARCHAR}
    </select>
    <delete id="deleteByTrninr">
        delete from cecmame
        where trninr = #{trninr,jdbcType=VARCHAR}
    </delete>
</mapper>