<?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.hzya.frame.seeyon.invoice.dao.impl.InvoiceDaoImpl">
    <resultMap id="get-InvoiceEntity-result" type="com.hzya.frame.seeyon.invoice.entity.InvoiceEntity">
        <result property="sfhc" column="sfhc" />
        <result property="xf" column="xf" />
        <result property="access_key" column="access_key" />
        <result property="sign" column="sign" />
        <result property="timestamp" column="timestamp" />
        <result property="serial_number" column="serial_number" />
        <result property="company_code" column="company_code" />
        <result property="seller_tax_no" column="seller_tax_no" />
        <result property="template_id" column="template_id" />
        <result property="business_no" column="business_no" />
        <result property="superior_business_no" column="superior_business_no" />
        <result property="buyer_name" column="buyer_name" />
        <result property="buyer_tax_no" column="buyer_tax_no" />
        <result property="buyer_addr_phone" column="buyer_addr_phone" />
        <result property="buyer_bank_account" column="buyer_bank_account" />
        <result property="apply_person" column="apply_person" />
        <result property="apply_email_notice" column="apply_email_notice" />
        <result property="buyer_email_notice" column="buyer_email_notice" />
        <result property="workcode" column="workcode" />
        <result property="other_email" column="other_email" />
        <result property="buyer_contact" column="buyer_contact" />
        <result property="buyer_mobile" column="buyer_mobile" />
        <result property="buyer_recv_address" column="buyer_recv_address" />
        <result property="application_remark" column="application_remark" />
        <result property="attachments" column="attachments" />
        <result property="notify_url" column="notify_url" />
        <result property="special_invoice_mark" column="special_invoice_mark" />
        <result property="seller_name" column="seller_name" />
        <result property="seller_addr_phone" column="seller_addr_phone" />
        <result property="seller_bank_account" column="seller_bank_account" />
        <result property="extend_fields" column="extend_fields" />
        <result property="invoice_type" column="invoice_type" />
        <result property="is_person" column="is_person" />
        <result property="levy_tax_type" column="levy_tax_type" />
        <result property="deduction" column="deduction" />
        <result property="remark" column="remark" />
        <result property="place" column="place" />
        <result property="place_of_detail" column="place_of_detail" />
        <result property="construction_project_name" column="construction_project_name" />
        <result property="kqysssxbgglbm" column="kqysssxbgglbm" />
        <result property="product_no" column="product_no" />
        <result property="cross_distinct_city_flag" column="cross_distinct_city_flag" />
        <result property="certificate_of_title" column="certificate_of_title" />
        <result property="area_unit" column="area_unit" />
        <result property="start_date" column="start_date" />
        <result property="end_date" column="end_date" />
        <result property="original_seller_name" column="original_seller_name" />
        <result property="original_seller_tax_no" column="original_seller_tax_no" />
        <result property="applicant" column="applicant" />
        <result property="deduction_status" column="deduction_status" />
        <result property="original_invoice_code" column="original_invoice_code" />
        <result property="original_invoice_number" column="original_invoice_number" />
        <result property="original_invoice_date" column="original_invoice_date" />
        <result property="original_invoice_price" column="original_invoice_price" />
        <result property="red_flush_reason" column="red_flush_reason" />
        <result property="original_superior_business_no" column="original_superior_business_no" />
        <result property="red_letter_info_sheet_no" column="red_letter_info_sheet_no" />
        <result property="original_invoice_check_ode" column="original_invoice_check_ode" />
        <result property="push_status_filed" column="push_status_filed" />
        <result property="invoice_code_field" column="invoice_code_field" />
        <result property="invoice_number_field" column="invoice_number_field" />
        <result property="url_field" column="url_field" />
        <result property="result_status_field" column="result_status_field" />
        <result property="push_status" column="push_status" />
        <result property="invoice_code" column="invoice_code" />
        <result property="invoice_number" column="invoice_number" />
        <result property="url" column="url" />
        <result property="result_status" column="result_status" />

    </resultMap>

    <sql id="InvoiceEntity_Base_Column_List">
        *

    </sql>




    <select id="queryInvoiceResult" resultMap="get-InvoiceEntity-result" parameterType="com.hzya.frame.seeyon.invoice.entity.InvoiceEntity">
        select
            *
        from v_hzya_invoice where push_status is not null and url is null and (result_status is null or result_status='申请单处理中')
    </select>

    <select id="queryInputInvoiceResult" resultMap="get-InvoiceEntity-result" parameterType="com.hzya.frame.seeyon.invoice.entity.InvoiceEntity">
        select
            *
        from  where
    </select>

    <!--通过主键修改方法-->
    <update id="updateInvoiceUrl" parameterType = "com.hzya.frame.seeyon.invoice.entity.InvoiceEntity" >
        update ${tabName} set ${url_field} =#{url} where id=#{id}
    </update>

    <!--通过主键修改方法-->
    <update id="updateInvoicePush" parameterType = "com.hzya.frame.seeyon.invoice.entity.InvoiceEntity" >
        update formmain_0331 set field0206 =#{push_status} where id=#{id}
    </update>

    <!--通过主键修改方法-->
    <update id="updateInvoiceResult" parameterType = "com.hzya.frame.seeyon.invoice.entity.InvoiceEntity" >
        update ${tabName} set
        <trim suffix="" suffixOverrides=",">
            <if test="input_result_status != null and input_result_status != ''"> ${input_result_status_filed} = #{input_result_status},</if>
            <if test="invoice_code != null and invoice_code != ''"> ${invoice_code_field} = #{invoice_code},</if>
            <if test="invoice_number != null and invoice_number != ''"> ${invoice_number_field} = #{invoice_number},</if>
            <if test="result_status != null and result_status != ''"> ${result_status_field} = #{result_status},</if>
        </trim>
        where id=#{id}
    </update>


</mapper>

