<?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.IncomeInvoiceAuthStatisticsMapper">
    
    <resultMap type="IncomeInvoiceAuthStatistics" id="IncomeInvoiceAuthStatisticsResult">
        <result property="id"    column="id"    />
        <result property="pch"    column="pch"    />
        <result property="gmfsbh"    column="gmfsbh"    />
        <result property="clzt"    column="clzt"    />
        <result property="pczt"    column="pczt"    />
        <result property="tjyf"    column="tjyf"    />
        <result property="tjrq"    column="tjrq"    />
        <result property="tjbz"    column="tjbz"    />
        <result property="tjjg"    column="tjjg"    />
        <result property="fplxdm"    column="fplxdm"    />
        <result property="dkfpfs"    column="dkfpfs"    />
        <result property="dkzje"    column="dkzje"    />
        <result property="dkzyxse"    column="dkzyxse"    />
        <result property="bdkfpfs"    column="bdkfpfs"    />
        <result property="bdkzje"    column="bdkzje"    />
        <result property="bdkzyxse"    column="bdkzyxse"    />
        <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="selectIncomeInvoiceAuthStatisticsVo">
        select id, pch, gmfsbh, clzt, pczt, tjyf, tjrq, tjbz, tjjg, fplxdm, dkfpfs, dkzje, dkzyxse, bdkfpfs, bdkzje, bdkzyxse, create_by, create_time, update_by, update_time, remark, sqskssq from income_invoice_auth_statistics
    </sql>

    <select id="selectIncomeInvoiceAuthStatisticsList" parameterType="IncomeInvoiceAuthStatistics" resultMap="IncomeInvoiceAuthStatisticsResult">
        <include refid="selectIncomeInvoiceAuthStatisticsVo"/>
        <where>  
            <if test="pch != null  and pch != ''"> and pch = #{pch}</if>
            <if test="gmfsbh != null  and gmfsbh != ''"> and gmfsbh = #{gmfsbh}</if>
            <if test="clzt != null  and clzt != ''"> and clzt = #{clzt}</if>
            <if test="pczt != null  and pczt != ''"> and pczt = #{pczt}</if>
            <if test="tjyf != null  and tjyf != ''"> and tjyf = #{tjyf}</if>
            <if test="tjrq != null  and tjrq != ''"> and tjrq = #{tjrq}</if>
            <if test="tjbz != null  and tjbz != ''"> and tjbz = #{tjbz}</if>
            <if test="tjjg != null  and tjjg != ''"> and tjjg = #{tjjg}</if>
            <if test="fplxdm != null  and fplxdm != ''"> and fplxdm = #{fplxdm}</if>
            <if test="dkfpfs != null  and dkfpfs != ''"> and dkfpfs = #{dkfpfs}</if>
            <if test="dkzje != null  and dkzje != ''"> and dkzje = #{dkzje}</if>
            <if test="dkzyxse != null  and dkzyxse != ''"> and dkzyxse = #{dkzyxse}</if>
            <if test="bdkfpfs != null  and bdkfpfs != ''"> and bdkfpfs = #{bdkfpfs}</if>
            <if test="bdkzje != null  and bdkzje != ''"> and bdkzje = #{bdkzje}</if>
            <if test="bdkzyxse != null  and bdkzyxse != ''"> and bdkzyxse = #{bdkzyxse}</if>
            <if test="sqskssq != null  and sqskssq != ''"> and sqskssq = #{sqskssq}</if>
        </where>
    </select>
    
    <select id="selectIncomeInvoiceAuthStatisticsById" parameterType="String" resultMap="IncomeInvoiceAuthStatisticsResult">
        <include refid="selectIncomeInvoiceAuthStatisticsVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertIncomeInvoiceAuthStatistics" parameterType="IncomeInvoiceAuthStatistics">
        insert into income_invoice_auth_statistics
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="pch != null and pch != ''">pch,</if>
            <if test="gmfsbh != null and gmfsbh != ''">gmfsbh,</if>
            <if test="clzt != null">clzt,</if>
            <if test="pczt != null">pczt,</if>
            <if test="tjyf != null">tjyf,</if>
            <if test="tjrq != null">tjrq,</if>
            <if test="tjbz != null">tjbz,</if>
            <if test="tjjg != null">tjjg,</if>
            <if test="fplxdm != null">fplxdm,</if>
            <if test="dkfpfs != null">dkfpfs,</if>
            <if test="dkzje != null">dkzje,</if>
            <if test="dkzyxse != null">dkzyxse,</if>
            <if test="bdkfpfs != null">bdkfpfs,</if>
            <if test="bdkzje != null">bdkzje,</if>
            <if test="bdkzyxse != null">bdkzyxse,</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="gmfsbh != null and gmfsbh != ''">#{gmfsbh},</if>
            <if test="clzt != null">#{clzt},</if>
            <if test="pczt != null">#{pczt},</if>
            <if test="tjyf != null">#{tjyf},</if>
            <if test="tjrq != null">#{tjrq},</if>
            <if test="tjbz != null">#{tjbz},</if>
            <if test="tjjg != null">#{tjjg},</if>
            <if test="fplxdm != null">#{fplxdm},</if>
            <if test="dkfpfs != null">#{dkfpfs},</if>
            <if test="dkzje != null">#{dkzje},</if>
            <if test="dkzyxse != null">#{dkzyxse},</if>
            <if test="bdkfpfs != null">#{bdkfpfs},</if>
            <if test="bdkzje != null">#{bdkzje},</if>
            <if test="bdkzyxse != null">#{bdkzyxse},</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="updateIncomeInvoiceAuthStatistics" parameterType="IncomeInvoiceAuthStatistics">
        update income_invoice_auth_statistics
        <trim prefix="SET" suffixOverrides=",">
            <if test="pch != null and pch != ''">pch = #{pch},</if>
            <if test="gmfsbh != null and gmfsbh != ''">gmfsbh = #{gmfsbh},</if>
            <if test="clzt != null">clzt = #{clzt},</if>
            <if test="pczt != null">pczt = #{pczt},</if>
            <if test="tjyf != null">tjyf = #{tjyf},</if>
            <if test="tjrq != null">tjrq = #{tjrq},</if>
            <if test="tjbz != null">tjbz = #{tjbz},</if>
            <if test="tjjg != null">tjjg = #{tjjg},</if>
            <if test="fplxdm != null">fplxdm = #{fplxdm},</if>
            <if test="dkfpfs != null">dkfpfs = #{dkfpfs},</if>
            <if test="dkzje != null">dkzje = #{dkzje},</if>
            <if test="dkzyxse != null">dkzyxse = #{dkzyxse},</if>
            <if test="bdkfpfs != null">bdkfpfs = #{bdkfpfs},</if>
            <if test="bdkzje != null">bdkzje = #{bdkzje},</if>
            <if test="bdkzyxse != null">bdkzyxse = #{bdkzyxse},</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="deleteIncomeInvoiceAuthStatisticsById" parameterType="String">
        delete from income_invoice_auth_statistics where id = #{id}
    </delete>

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