<?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.ceb.gjjs.mda.dao.ImgMapper">

    <resultMap id="BaseResultMap" type="com.ceb.gjjs.mda.bo.Img">
        <result property="inr" column="inr" jdbcType="VARCHAR" />
        <result property="imgref" column="imgref" jdbcType="VARCHAR" />
        <result property="ownref" column="ownref" jdbcType="VARCHAR" />
        <result property="objinr" column="objinr" jdbcType="VARCHAR" />
        <result property="objtyp" column="objtyp" jdbcType="VARCHAR" />
        <result property="inifrm" column="inifrm" jdbcType="VARCHAR" />
        <result property="lgnnam" column="lgnnam" jdbcType="VARCHAR" />
        <result property="trninr" column="trninr" jdbcType="VARCHAR" />
        <result property="credat" column="credat" jdbcType="DATE" />
        <result property="reldattim" column="reldattim" jdbcType="DATE" />
        <result property="optdattim" column="optdattim" jdbcType="TIMESTAMP" />
        <result property="cnt" column="cnt" jdbcType="INTEGER" />
        <result property="ftysuc" column="ftysuc" jdbcType="VARCHAR" />
        <result property="guid" column="guid" jdbcType="VARCHAR" />
        <result property="bchcod" column="bchcod" jdbcType="VARCHAR" />
    </resultMap>

    <sql id="Base_Column_List">
        inr,imgref,ownref,objinr,objtyp,inifrm,lgnnam,trninr,credat,reldattim,optdattim,cnt,ftysuc,guid,bchcod
    </sql>

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

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

    <insert id="insert">
        insert into img (<include refid="Base_Column_List" />)
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            #{inr,jdbcType=VARCHAR},
            #{imgref,jdbcType=VARCHAR},
            #{ownref,jdbcType=VARCHAR},
            #{objinr,jdbcType=VARCHAR},
            #{objtyp,jdbcType=VARCHAR},
            #{inifrm,jdbcType=VARCHAR},
            #{lgnnam,jdbcType=VARCHAR},
            #{trninr,jdbcType=VARCHAR},
            #{credat,jdbcType=DATE},
            #{reldattim,jdbcType=DATE},
            #{optdattim,jdbcType=TIMESTAMP},
            #{cnt,jdbcType=INTEGER},
            #{ftysuc,jdbcType=VARCHAR},
            #{guid,jdbcType=VARCHAR},
            #{bchcod,jdbcType=VARCHAR},
        </trim>
    </insert>

    <insert id="insertSelective">
        insert into img
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="inr != null">inr,</if>
            <if test="imgref != null">imgref,</if>
            <if test="ownref != null">ownref,</if>
            <if test="objinr != null">objinr,</if>
            <if test="objtyp != null">objtyp,</if>
            <if test="inifrm != null">inifrm,</if>
            <if test="lgnnam != null">lgnnam,</if>
            <if test="trninr != null">trninr,</if>
            <if test="credat != null">credat,</if>
            <if test="reldattim != null">reldattim,</if>
            <if test="optdattim != null">optdattim,</if>
            <if test="cnt != null">cnt,</if>
            <if test="ftysuc != null">ftysuc,</if>
            <if test="guid != null">guid,</if>
            <if test="bchcod != null">bchcod,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="inr != null">#{inr,jdbcType=VARCHAR}, </if>
            <if test="imgref != null">#{imgref,jdbcType=VARCHAR}, </if>
            <if test="ownref != null">#{ownref,jdbcType=VARCHAR}, </if>
            <if test="objinr != null">#{objinr,jdbcType=VARCHAR}, </if>
            <if test="objtyp != null">#{objtyp,jdbcType=VARCHAR}, </if>
            <if test="inifrm != null">#{inifrm,jdbcType=VARCHAR}, </if>
            <if test="lgnnam != null">#{lgnnam,jdbcType=VARCHAR}, </if>
            <if test="trninr != null">#{trninr,jdbcType=VARCHAR}, </if>
            <if test="credat != null">#{credat,jdbcType=DATE}, </if>
            <if test="reldattim != null">#{reldattim,jdbcType=DATE}, </if>
            <if test="optdattim != null">#{optdattim,jdbcType=TIMESTAMP}, </if>
            <if test="cnt != null">#{cnt,jdbcType=INTEGER}, </if>
            <if test="ftysuc != null">#{ftysuc,jdbcType=VARCHAR}, </if>
            <if test="guid != null">#{guid,jdbcType=VARCHAR}, </if>
            <if test="bchcod != null">#{bchcod,jdbcType=VARCHAR}, </if>
        </trim>
    </insert>

    <update id="updateByPrimaryKeySelective">
        update img
        <set>
            <if test="imgref != null">imgref = #{imgref,jdbcType=VARCHAR},</if>
            <if test="ownref != null">ownref = #{ownref,jdbcType=VARCHAR},</if>
            <if test="objinr != null">objinr = #{objinr,jdbcType=VARCHAR},</if>
            <if test="objtyp != null">objtyp = #{objtyp,jdbcType=VARCHAR},</if>
            <if test="inifrm != null">inifrm = #{inifrm,jdbcType=VARCHAR},</if>
            <if test="lgnnam != null">lgnnam = #{lgnnam,jdbcType=VARCHAR},</if>
            <if test="trninr != null">trninr = #{trninr,jdbcType=VARCHAR},</if>
            <if test="credat != null">credat = #{credat,jdbcType=DATE},</if>
            <if test="reldattim != null">reldattim = #{reldattim,jdbcType=DATE},</if>
            <if test="optdattim != null">optdattim = #{optdattim,jdbcType=TIMESTAMP},</if>
            <if test="cnt != null">cnt = #{cnt,jdbcType=INTEGER},</if>
            <if test="ftysuc != null">ftysuc = #{ftysuc,jdbcType=VARCHAR},</if>
            <if test="guid != null">guid = #{guid,jdbcType=VARCHAR},</if>
            <if test="bchcod != null">bchcod = #{bchcod,jdbcType=VARCHAR},</if>
        </set>
        where inr = #{inr,jdbcType=VARCHAR}
    </update>

    <update id="updateByPrimaryKey">
        update img
        <set>
            imgref = #{imgref,jdbcType=VARCHAR},
            ownref = #{ownref,jdbcType=VARCHAR},
            objinr = #{objinr,jdbcType=VARCHAR},
            objtyp = #{objtyp,jdbcType=VARCHAR},
            inifrm = #{inifrm,jdbcType=VARCHAR},
            lgnnam = #{lgnnam,jdbcType=VARCHAR},
            trninr = #{trninr,jdbcType=VARCHAR},
            credat = #{credat,jdbcType=DATE},
            reldattim = #{reldattim,jdbcType=DATE},
            optdattim = #{optdattim,jdbcType=TIMESTAMP},
            cnt = #{cnt,jdbcType=INTEGER},
            ftysuc = #{ftysuc,jdbcType=VARCHAR},
            guid = #{guid,jdbcType=VARCHAR},
            bchcod = #{bchcod,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>

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

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

</mapper>