<?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.jianshui.income.mapper.IncomeInvoiceAuthConfirmationResultsMapper">
    
    <resultMap type="IncomeInvoiceAuthConfirmationResults" id="IncomeInvoiceAuthConfirmationResultsResult">
        <result property="id"    column="id"    />
        <result property="pch"    column="pch"    />
        <result property="clzt"    column="clzt"    />
        <result property="gmfsbh"    column="gmfsbh"    />
        <result property="tjyf"    column="tjyf"    />
        <result property="qrbz"    column="qrbz"    />
        <result property="sbyy"    column="sbyy"    />
        <result property="tjbz"    column="tjbz"    />
        <result property="qrsj"    column="qrsj"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="remark"    column="remark"    />
        <result property="sqskssq"    column="sqskssq"    />
    </resultMap>

    <sql id="selectIncomeInvoiceAuthConfirmationResultsVo">
        select id, pch, clzt, gmfsbh, tjyf, qrbz, sbyy, tjbz, qrsj, create_by, create_time, update_by, update_time, remark, sqskssq from income_invoice_auth_confirmation_results
    </sql>

    <select id="selectIncomeInvoiceAuthConfirmationResultsList" parameterType="IncomeInvoiceAuthConfirmationResults" resultMap="IncomeInvoiceAuthConfirmationResultsResult">
        <include refid="selectIncomeInvoiceAuthConfirmationResultsVo"/>
        <where>  
            <if test="pch != null  and pch != ''"> and pch = #{pch}</if>
            <if test="clzt != null  and clzt != ''"> and clzt = #{clzt}</if>
            <if test="gmfsbh != null  and gmfsbh != ''"> and gmfsbh = #{gmfsbh}</if>
            <if test="tjyf != null  and tjyf != ''"> and tjyf = #{tjyf}</if>
            <if test="qrbz != null  and qrbz != ''"> and qrbz = #{qrbz}</if>
            <if test="sbyy != null  and sbyy != ''"> and sbyy = #{sbyy}</if>
            <if test="tjbz != null  and tjbz != ''"> and tjbz = #{tjbz}</if>
            <if test="qrsj != null  and qrsj != ''"> and qrsj = #{qrsj}</if>
            <if test="sqskssq != null  and sqskssq != ''"> and sqskssq = #{sqskssq}</if>
        </where>
    </select>
    
    <select id="selectIncomeInvoiceAuthConfirmationResultsById" parameterType="String" resultMap="IncomeInvoiceAuthConfirmationResultsResult">
        <include refid="selectIncomeInvoiceAuthConfirmationResultsVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertIncomeInvoiceAuthConfirmationResults" parameterType="IncomeInvoiceAuthConfirmationResults">
        insert into income_invoice_auth_confirmation_results
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="pch != null and pch != ''">pch,</if>
            <if test="clzt != null">clzt,</if>
            <if test="gmfsbh != null and gmfsbh != ''">gmfsbh,</if>
            <if test="tjyf != null">tjyf,</if>
            <if test="qrbz != null">qrbz,</if>
            <if test="sbyy != null">sbyy,</if>
            <if test="tjbz != null and tjbz != ''">tjbz,</if>
            <if test="qrsj != null">qrsj,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="remark != null">remark,</if>
            <if test="sqskssq != null">sqskssq,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="pch != null and pch != ''">#{pch},</if>
            <if test="clzt != null">#{clzt},</if>
            <if test="gmfsbh != null and gmfsbh != ''">#{gmfsbh},</if>
            <if test="tjyf != null">#{tjyf},</if>
            <if test="qrbz != null">#{qrbz},</if>
            <if test="sbyy != null">#{sbyy},</if>
            <if test="tjbz != null and tjbz != ''">#{tjbz},</if>
            <if test="qrsj != null">#{qrsj},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="remark != null">#{remark},</if>
            <if test="sqskssq != null">#{sqskssq},</if>
         </trim>
    </insert>

    <update id="updateIncomeInvoiceAuthConfirmationResults" parameterType="IncomeInvoiceAuthConfirmationResults">
        update income_invoice_auth_confirmation_results
        <trim prefix="SET" suffixOverrides=",">
            <if test="pch != null and pch != ''">pch = #{pch},</if>
            <if test="clzt != null">clzt = #{clzt},</if>
            <if test="gmfsbh != null and gmfsbh != ''">gmfsbh = #{gmfsbh},</if>
            <if test="tjyf != null">tjyf = #{tjyf},</if>
            <if test="qrbz != null">qrbz = #{qrbz},</if>
            <if test="sbyy != null">sbyy = #{sbyy},</if>
            <if test="tjbz != null and tjbz != ''">tjbz = #{tjbz},</if>
            <if test="qrsj != null">qrsj = #{qrsj},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="remark != null">remark = #{remark},</if>
            <if test="sqskssq != null">sqskssq = #{sqskssq},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteIncomeInvoiceAuthConfirmationResultsById" parameterType="String">
        delete from income_invoice_auth_confirmation_results where id = #{id}
    </delete>

    <delete id="deleteIncomeInvoiceAuthConfirmationResultsByIds" parameterType="String">
        delete from income_invoice_auth_confirmation_results where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>