<?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.IncomeInvoiceAuthAuthenticationMapper">
    
    <resultMap type="IncomeInvoiceAuthAuthentication" id="IncomeInvoiceAuthAuthenticationResult">
        <result property="id"    column="id"    />
        <result property="invoiceId"    column="invoice_id"    />
        <result property="pch"    column="pch"    />
        <result property="fpdm"    column="fpdm"    />
        <result property="fphm"    column="fphm"    />
        <result property="sqskssq"    column="sqskssq"    />
        <result property="gmfsbh"    column="gmfsbh"    />
        <result property="sqrzlx"    column="sqrzlx"    />
        <result property="fplxdm"    column="fplxdm"    />
        <result property="bdkyy"    column="bdkyy"    />
        <result property="ztdm"    column="ztdm"    />
        <result property="ztxx"    column="ztxx"    />
        <result property="rzzt"    column="rzzt"    />
        <result property="rzrq"    column="rzrq"    />
        <result property="sbyy"    column="sbyy"    />
        <result property="rzclzt"    column="rzclzt"    />
        <result property="rzsq"    column="rzsq"    />
        <result property="pczt"    column="pczt"    />
        <result property="rzlx"    column="rzlx"    />
        <result property="xxly"    column="xxly"    />
        <result property="yxse"    column="yxse"    />
        <result property="yqkgxbz"    column="yqkgxbz"    />
        <result property="glzt"    column="glzt"    />
        <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"    />
    </resultMap>

    <sql id="selectIncomeInvoiceAuthAuthenticationVo">
        select id, invoice_id, pch, fpdm, fphm, sqskssq, gmfsbh, sqrzlx, fplxdm, bdkyy, ztdm, ztxx, rzzt, rzrq, sbyy, rzclzt, rzsq, pczt, rzlx, xxly, yxse, yqkgxbz, glzt, create_by, create_time, update_by, update_time, remark from income_invoice_auth_authentication
    </sql>

    <select id="selectIncomeInvoiceAuthAuthenticationList" parameterType="IncomeInvoiceAuthAuthentication" resultMap="IncomeInvoiceAuthAuthenticationResult">
        <include refid="selectIncomeInvoiceAuthAuthenticationVo"/>
        <where>  
            <if test="invoiceId != null  and invoiceId != ''"> and invoice_id = #{invoiceId}</if>
            <if test="pch != null  and pch != ''"> and pch = #{pch}</if>
            <if test="fpdm != null  and fpdm != ''"> and fpdm = #{fpdm}</if>
            <if test="fphm != null  and fphm != ''"> and fphm = #{fphm}</if>
            <if test="sqskssq != null  and sqskssq != ''"> and sqskssq = #{sqskssq}</if>
            <if test="gmfsbh != null  and gmfsbh != ''"> and gmfsbh = #{gmfsbh}</if>
            <if test="sqrzlx != null  and sqrzlx != ''"> and sqrzlx = #{sqrzlx}</if>
            <if test="fplxdm != null  and fplxdm != ''"> and fplxdm = #{fplxdm}</if>
            <if test="bdkyy != null  and bdkyy != ''"> and bdkyy = #{bdkyy}</if>
            <if test="ztdm != null  and ztdm != ''"> and ztdm = #{ztdm}</if>
            <if test="ztxx != null  and ztxx != ''"> and ztxx = #{ztxx}</if>
            <if test="rzzt != null  and rzzt != ''"> and rzzt = #{rzzt}</if>
            <if test="rzrq != null  and rzrq != ''"> and rzrq = #{rzrq}</if>
            <if test="sbyy != null  and sbyy != ''"> and sbyy = #{sbyy}</if>
            <if test="rzclzt != null  and rzclzt != ''"> and rzclzt = #{rzclzt}</if>
            <if test="rzsq != null  and rzsq != ''"> and rzsq = #{rzsq}</if>
            <if test="pczt != null  and pczt != ''"> and pczt = #{pczt}</if>
            <if test="rzlx != null  and rzlx != ''"> and rzlx = #{rzlx}</if>
            <if test="xxly != null  and xxly != ''"> and xxly = #{xxly}</if>
            <if test="yxse != null  and yxse != ''"> and yxse = #{yxse}</if>
            <if test="yqkgxbz != null  and yqkgxbz != ''"> and yqkgxbz = #{yqkgxbz}</if>
            <if test="glzt != null  and glzt != ''"> and glzt = #{glzt}</if>
        </where>
    </select>
    
    <select id="selectIncomeInvoiceAuthAuthenticationById" parameterType="String" resultMap="IncomeInvoiceAuthAuthenticationResult">
        <include refid="selectIncomeInvoiceAuthAuthenticationVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertIncomeInvoiceAuthAuthentication" parameterType="IncomeInvoiceAuthAuthentication">
        insert into income_invoice_auth_authentication
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="invoiceId != null and invoiceId != ''">invoice_id,</if>
            <if test="pch != null and pch != ''">pch,</if>
            <if test="fpdm != null and fpdm != ''">fpdm,</if>
            <if test="fphm != null and fphm != ''">fphm,</if>
            <if test="sqskssq != null and sqskssq != ''">sqskssq,</if>
            <if test="gmfsbh != null and gmfsbh != ''">gmfsbh,</if>
            <if test="sqrzlx != null and sqrzlx != ''">sqrzlx,</if>
            <if test="fplxdm != null and fplxdm != ''">fplxdm,</if>
            <if test="bdkyy != null">bdkyy,</if>
            <if test="ztdm != null">ztdm,</if>
            <if test="ztxx != null">ztxx,</if>
            <if test="rzzt != null">rzzt,</if>
            <if test="rzrq != null">rzrq,</if>
            <if test="sbyy != null">sbyy,</if>
            <if test="rzclzt != null">rzclzt,</if>
            <if test="rzsq != null">rzsq,</if>
            <if test="pczt != null">pczt,</if>
            <if test="rzlx != null">rzlx,</if>
            <if test="xxly != null">xxly,</if>
            <if test="yxse != null">yxse,</if>
            <if test="yqkgxbz != null">yqkgxbz,</if>
            <if test="glzt != null">glzt,</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>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="invoiceId != null and invoiceId != ''">#{invoiceId},</if>
            <if test="pch != null and pch != ''">#{pch},</if>
            <if test="fpdm != null and fpdm != ''">#{fpdm},</if>
            <if test="fphm != null and fphm != ''">#{fphm},</if>
            <if test="sqskssq != null and sqskssq != ''">#{sqskssq},</if>
            <if test="gmfsbh != null and gmfsbh != ''">#{gmfsbh},</if>
            <if test="sqrzlx != null and sqrzlx != ''">#{sqrzlx},</if>
            <if test="fplxdm != null and fplxdm != ''">#{fplxdm},</if>
            <if test="bdkyy != null">#{bdkyy},</if>
            <if test="ztdm != null">#{ztdm},</if>
            <if test="ztxx != null">#{ztxx},</if>
            <if test="rzzt != null">#{rzzt},</if>
            <if test="rzrq != null">#{rzrq},</if>
            <if test="sbyy != null">#{sbyy},</if>
            <if test="rzclzt != null">#{rzclzt},</if>
            <if test="rzsq != null">#{rzsq},</if>
            <if test="pczt != null">#{pczt},</if>
            <if test="rzlx != null">#{rzlx},</if>
            <if test="xxly != null">#{xxly},</if>
            <if test="yxse != null">#{yxse},</if>
            <if test="yqkgxbz != null">#{yqkgxbz},</if>
            <if test="glzt != null">#{glzt},</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>
         </trim>
    </insert>

    <update id="updateIncomeInvoiceAuthAuthentication" parameterType="IncomeInvoiceAuthAuthentication">
        update income_invoice_auth_authentication
        <trim prefix="SET" suffixOverrides=",">
            <if test="invoiceId != null and invoiceId != ''">invoice_id = #{invoiceId},</if>
            <if test="pch != null and pch != ''">pch = #{pch},</if>
            <if test="fpdm != null and fpdm != ''">fpdm = #{fpdm},</if>
            <if test="fphm != null and fphm != ''">fphm = #{fphm},</if>
            <if test="sqskssq != null and sqskssq != ''">sqskssq = #{sqskssq},</if>
            <if test="gmfsbh != null and gmfsbh != ''">gmfsbh = #{gmfsbh},</if>
            <if test="sqrzlx != null and sqrzlx != ''">sqrzlx = #{sqrzlx},</if>
            <if test="fplxdm != null and fplxdm != ''">fplxdm = #{fplxdm},</if>
            <if test="bdkyy != null">bdkyy = #{bdkyy},</if>
            <if test="ztdm != null">ztdm = #{ztdm},</if>
            <if test="ztxx != null">ztxx = #{ztxx},</if>
            <if test="rzzt != null">rzzt = #{rzzt},</if>
            <if test="rzrq != null">rzrq = #{rzrq},</if>
            <if test="sbyy != null">sbyy = #{sbyy},</if>
            <if test="rzclzt != null">rzclzt = #{rzclzt},</if>
            <if test="rzsq != null">rzsq = #{rzsq},</if>
            <if test="pczt != null">pczt = #{pczt},</if>
            <if test="rzlx != null">rzlx = #{rzlx},</if>
            <if test="xxly != null">xxly = #{xxly},</if>
            <if test="yxse != null">yxse = #{yxse},</if>
            <if test="yqkgxbz != null">yqkgxbz = #{yqkgxbz},</if>
            <if test="glzt != null">glzt = #{glzt},</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>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteIncomeInvoiceAuthAuthenticationById" parameterType="String">
        delete from income_invoice_auth_authentication where id = #{id}
    </delete>

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