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

    <resultMap id="BaseResultMap" type="com.brilliance.isc.bo.Spr">
        <result property="inr" column="inr" jdbcType="VARCHAR"/>
        <result property="sptinr" column="sptinr" jdbcType="VARCHAR"/>
        <result property="objtyp" column="objtyp" jdbcType="VARCHAR"/>
        <result property="objinr" column="objinr" jdbcType="VARCHAR"/>
        <result property="credat" column="credat" jdbcType="DATE"/>
        <result property="cretim" column="cretim" jdbcType="DECIMAL"/>
        <result property="creusr" column="creusr" jdbcType="VARCHAR"/>
        <result property="cressninr" column="cressninr" jdbcType="VARCHAR"/>
        <result property="rellev" column="rellev" jdbcType="VARCHAR"/>
        <result property="reldat" column="reldat" jdbcType="DATE"/>
        <result property="reltim" column="reltim" jdbcType="DECIMAL"/>
        <result property="relusr" column="relusr" jdbcType="VARCHAR"/>
        <result property="relssninr" column="relssninr" jdbcType="VARCHAR"/>
        <result property="relsta" column="relsta" jdbcType="VARCHAR"/>
        <result property="pupsta" column="pupsta" jdbcType="VARCHAR"/>
    </resultMap>

    <sql id="Base_Column_List">
        inr,sptinr,objtyp,objinr,credat,cretim,creusr,cressninr,rellev,reldat,reltim,relusr,relssninr,relsta,pupsta
    </sql>

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

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

    <insert id="insert">
        insert into spr (<include refid="Base_Column_List"/>)
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            #{inr,jdbcType=VARCHAR},
            #{sptinr,jdbcType=VARCHAR},
            #{objtyp,jdbcType=VARCHAR},
            #{objinr,jdbcType=VARCHAR},
            #{credat,jdbcType=DATE},
            #{cretim,jdbcType=DECIMAL},
            #{creusr,jdbcType=VARCHAR},
            #{cressninr,jdbcType=VARCHAR},
            #{rellev,jdbcType=VARCHAR},
            #{reldat,jdbcType=DATE},
            #{reltim,jdbcType=DECIMAL},
            #{relusr,jdbcType=VARCHAR},
            #{relssninr,jdbcType=VARCHAR},
            #{relsta,jdbcType=VARCHAR},
            #{pupsta,jdbcType=VARCHAR},
        </trim>
    </insert>

    <insert id="insertSelective">
        insert into spr
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="inr != null">inr,</if>
            <if test="sptinr != null">sptinr,</if>
            <if test="objtyp != null">objtyp,</if>
            <if test="objinr != null">objinr,</if>
            <if test="credat != null">credat,</if>
            <if test="cretim != null">cretim,</if>
            <if test="creusr != null">creusr,</if>
            <if test="cressninr != null">cressninr,</if>
            <if test="rellev != null">rellev,</if>
            <if test="reldat != null">reldat,</if>
            <if test="reltim != null">reltim,</if>
            <if test="relusr != null">relusr,</if>
            <if test="relssninr != null">relssninr,</if>
            <if test="relsta != null">relsta,</if>
            <if test="pupsta != null">pupsta,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="inr != null">#{inr,jdbcType=VARCHAR},</if>
            <if test="sptinr != null">#{sptinr,jdbcType=VARCHAR},</if>
            <if test="objtyp != null">#{objtyp,jdbcType=VARCHAR},</if>
            <if test="objinr != null">#{objinr,jdbcType=VARCHAR},</if>
            <if test="credat != null">#{credat,jdbcType=DATE},</if>
            <if test="cretim != null">#{cretim,jdbcType=DECIMAL},</if>
            <if test="creusr != null">#{creusr,jdbcType=VARCHAR},</if>
            <if test="cressninr != null">#{cressninr,jdbcType=VARCHAR},</if>
            <if test="rellev != null">#{rellev,jdbcType=VARCHAR},</if>
            <if test="reldat != null">#{reldat,jdbcType=DATE},</if>
            <if test="reltim != null">#{reltim,jdbcType=DECIMAL},</if>
            <if test="relusr != null">#{relusr,jdbcType=VARCHAR},</if>
            <if test="relssninr != null">#{relssninr,jdbcType=VARCHAR},</if>
            <if test="relsta != null">#{relsta,jdbcType=VARCHAR},</if>
            <if test="pupsta != null">#{pupsta,jdbcType=VARCHAR},</if>
        </trim>
    </insert>

    <update id="updateByPrimaryKeySelective">
        update spr
        <set>
            <if test="sptinr != null">sptinr = #{sptinr,jdbcType=VARCHAR},</if>
            <if test="objtyp != null">objtyp = #{objtyp,jdbcType=VARCHAR},</if>
            <if test="objinr != null">objinr = #{objinr,jdbcType=VARCHAR},</if>
            <if test="credat != null">credat = #{credat,jdbcType=DATE},</if>
            <if test="cretim != null">cretim = #{cretim,jdbcType=DECIMAL},</if>
            <if test="creusr != null">creusr = #{creusr,jdbcType=VARCHAR},</if>
            <if test="cressninr != null">cressninr = #{cressninr,jdbcType=VARCHAR},</if>
            <if test="rellev != null">rellev = #{rellev,jdbcType=VARCHAR},</if>
            <if test="reldat != null">reldat = #{reldat,jdbcType=DATE},</if>
            <if test="reltim != null">reltim = #{reltim,jdbcType=DECIMAL},</if>
            <if test="relusr != null">relusr = #{relusr,jdbcType=VARCHAR},</if>
            <if test="relssninr != null">relssninr = #{relssninr,jdbcType=VARCHAR},</if>
            <if test="relsta != null">relsta = #{relsta,jdbcType=VARCHAR},</if>
            <if test="pupsta != null">pupsta = #{pupsta,jdbcType=VARCHAR},</if>
        </set>
        where inr = #{inr,jdbcType=VARCHAR}
    </update>

    <update id="updateByPrimaryKey">
        update spr
        <set>
            sptinr = #{sptinr,jdbcType=VARCHAR},
            objtyp = #{objtyp,jdbcType=VARCHAR},
            objinr = #{objinr,jdbcType=VARCHAR},
            credat = #{credat,jdbcType=DATE},
            cretim = #{cretim,jdbcType=DECIMAL},
            creusr = #{creusr,jdbcType=VARCHAR},
            cressninr = #{cressninr,jdbcType=VARCHAR},
            rellev = #{rellev,jdbcType=VARCHAR},
            reldat = #{reldat,jdbcType=DATE},
            reltim = #{reltim,jdbcType=DECIMAL},
            relusr = #{relusr,jdbcType=VARCHAR},
            relssninr = #{relssninr,jdbcType=VARCHAR},
            relsta = #{relsta,jdbcType=VARCHAR},
            pupsta = #{pupsta,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 spr
        <set>
            <if test="module.sptinr != null">sptinr = #{module.sptinr,jdbcType=VARCHAR},</if>
            <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.credat != null">credat = #{module.credat,jdbcType=DATE},</if>
            <if test="module.cretim != null">cretim = #{module.cretim,jdbcType=DECIMAL},</if>
            <if test="module.creusr != null">creusr = #{module.creusr,jdbcType=VARCHAR},</if>
            <if test="module.cressninr != null">cressninr = #{module.cressninr,jdbcType=VARCHAR},</if>
            <if test="module.rellev != null">rellev = #{module.rellev,jdbcType=VARCHAR},</if>
            <if test="module.reldat != null">reldat = #{module.reldat,jdbcType=DATE},</if>
            <if test="module.reltim != null">reltim = #{module.reltim,jdbcType=DECIMAL},</if>
            <if test="module.relusr != null">relusr = #{module.relusr,jdbcType=VARCHAR},</if>
            <if test="module.relssninr != null">relssninr = #{module.relssninr,jdbcType=VARCHAR},</if>
            <if test="module.relsta != null">relsta = #{module.relsta,jdbcType=VARCHAR},</if>
            <if test="module.pupsta != null">pupsta = #{module.pupsta,jdbcType=VARCHAR},</if>
        </set>
        ${conditions}
    </update>

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

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

</mapper>