wujianwei
2026-01-05 2b270e153c394ba9683e90785c6850a601378614
service/src/main/resources/mapper/cwgl/InvoiceManageMapper.xml
@@ -22,6 +22,7 @@
        <result property="invoiceNo"    column="invoice_no"    />
        <result property="invoiceDate"    column="invoice_date"    />
        <result property="invoiceAmount"    column="invoice_amount"    />
        <result property="relatedBillBilledAmount"    column="related_bill_billed_amount"    />
        <result property="createBy"    column="create_by"    />
        <result property="updateBy"    column="update_by"    />
        <result property="createTime"    column="create_time"    />
@@ -50,7 +51,7 @@
    </resultMap>
    <sql id="selectInvoiceManageVo">
        select thisTab.id, thisTab.invoice_info_id, thisTab.invoice_seller_id, thisTab.customer_name, thisTab.invoice_seller_name, thisTab.invoice_company_name, thisTab.invoice_credit_code, thisTab.invoice_seller_credit_code, thisTab.invoice_bank_name, thisTab.invoice_bank_no, thisTab.invoice_operating_license_address, thisTab.invoice_operating_license_phone, thisTab.invoice_operating_license_email, thisTab.status, thisTab.invoice_no, thisTab.invoice_date, thisTab.invoice_amount, thisTab.create_by, thisTab.update_by, thisTab.create_time, thisTab.update_time, thisTab.deleted, thisTab.invoice_type, thisTab.enterprise_type from invoice_manage AS thisTab
        select thisTab.id, thisTab.invoice_info_id, thisTab.invoice_seller_id, thisTab.customer_name, thisTab.invoice_seller_name, thisTab.invoice_company_name, thisTab.invoice_credit_code, thisTab.invoice_seller_credit_code, thisTab.invoice_bank_name, thisTab.invoice_bank_no, thisTab.invoice_operating_license_address, thisTab.invoice_operating_license_phone, thisTab.invoice_operating_license_email, thisTab.status, thisTab.invoice_no, thisTab.invoice_date, thisTab.invoice_amount, thisTab.related_bill_billed_amount, thisTab.create_by, thisTab.update_by, thisTab.create_time, thisTab.update_time, thisTab.deleted, thisTab.invoice_type, thisTab.enterprise_type from invoice_manage AS thisTab
    </sql>
    <sql id="selectInvoiceManageVoCount">
        select count(0) from invoice_manage as thisTab
@@ -80,7 +81,7 @@
    <!--查询-->
    <select id="selectInvoiceManageById" parameterType="Integer" resultMap="InvoiceManageInvoiceDetailResult">
        select a.id, a.invoice_info_id, a.invoice_seller_id, a.customer_name, a.invoice_seller_name, a.invoice_company_name, a.invoice_credit_code, a.invoice_seller_credit_code, a.invoice_bank_name, a.invoice_bank_no, a.invoice_operating_license_address, a.invoice_operating_license_phone, a.invoice_operating_license_email, a.status, a.invoice_no, a.invoice_date, a.invoice_amount, a.create_by, a.update_by, a.create_time, a.update_time, a.deleted, a.invoice_type, a.enterprise_type,
        select a.id, a.invoice_info_id, a.invoice_seller_id, a.customer_name, a.invoice_seller_name, a.invoice_company_name, a.invoice_credit_code, a.invoice_seller_credit_code, a.invoice_bank_name, a.invoice_bank_no, a.invoice_operating_license_address, a.invoice_operating_license_phone, a.invoice_operating_license_email, a.status, a.invoice_no, a.invoice_date, a.invoice_amount, a.related_bill_billed_amount, a.create_by, a.update_by, a.create_time, a.update_time, a.deleted, a.invoice_type, a.enterprise_type,
             b.id as sub_id, b.invoice_manage_id as sub_invoice_manage_id, b.receivable_bill_no as sub_receivable_bill_no, b.receivable_bill_amount as sub_receivable_bill_amount, b.receivable_bill_currency as sub_receivable_bill_currency, b.billed_amount as sub_billed_amount, b.unbilled_amount as sub_unbilled_amount, b.current_billed_amount as sub_current_billed_amount, b.create_time as sub_create_time, b.update_time as sub_update_time, b.deleted as sub_deleted        from invoice_manage a
        left join invoice_detail b on b.invoice_manage_id = a.id
        where a.id = #{id}
@@ -121,6 +122,7 @@
            <if test="invoiceNo != null">invoice_no,</if>
            <if test="invoiceDate != null">invoice_date,</if>
            <if test="invoiceAmount != null">invoice_amount,</if>
            <if test="relatedBillBilledAmount != null">related_bill_billed_amount,</if>
            <if test="createBy != null">create_by,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="createTime != null">create_time,</if>
@@ -146,6 +148,7 @@
            <if test="invoiceNo != null">#{invoiceNo},</if>
            <if test="invoiceDate != null">#{invoiceDate},</if>
            <if test="invoiceAmount != null">#{invoiceAmount},</if>
            <if test="relatedBillBilledAmount != null">#{relatedBillBilledAmount},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="createTime != null">#{createTime},</if>
@@ -159,11 +162,11 @@
    <insert id="insertInvoiceManageBatch" parameterType="java.util.List"  useGeneratedKeys="true" keyProperty="id">
        insert into invoice_manage
        <trim prefix="(" suffix=") values" suffixOverrides=",">
            id,invoice_info_id,invoice_seller_id,customer_name,invoice_seller_name,invoice_company_name,invoice_credit_code,invoice_seller_credit_code,invoice_bank_name,invoice_bank_no,invoice_operating_license_address,invoice_operating_license_phone,invoice_operating_license_email,status,create_by,update_by,create_time,update_time,deleted,invoice_type,enterprise_type,
            id,invoice_info_id,invoice_seller_id,customer_name,invoice_seller_name,invoice_company_name,invoice_credit_code,invoice_seller_credit_code,invoice_bank_name,invoice_bank_no,invoice_operating_license_address,invoice_operating_license_phone,invoice_operating_license_email,status,invoice_no,invoice_date,invoice_amount,related_bill_billed_amount,create_by,update_by,create_time,update_time,deleted,invoice_type,enterprise_type,
        </trim>
        <foreach item="item" index="index" collection="list" separator=",">
            <trim prefix="(" suffix=") " suffixOverrides=",">
                #{item.id},#{item.invoiceInfoId},#{item.invoiceSellerId},#{item.customerName},#{item.invoiceSellerName},#{item.invoiceCompanyName},#{item.invoiceCreditCode},#{item.invoiceSellerCreditCode},#{item.invoiceBankName},#{item.invoiceBankNo},#{item.invoiceOperatingLicenseAddress},#{item.invoiceOperatingLicensePhone},#{item.invoiceOperatingLicenseEmail},#{item.status},#{item.invoiceNo},#{item.invoiceDate},#{item.invoiceAmount},#{item.createBy},#{item.updateBy},#{item.createTime},#{item.updateTime},#{item.deleted},#{item.invoiceType},#{item.enterpriseType},
                #{item.id},#{item.invoiceInfoId},#{item.invoiceSellerId},#{item.customerName},#{item.invoiceSellerName},#{item.invoiceCompanyName},#{item.invoiceCreditCode},#{item.invoiceSellerCreditCode},#{item.invoiceBankName},#{item.invoiceBankNo},#{item.invoiceOperatingLicenseAddress},#{item.invoiceOperatingLicensePhone},#{item.invoiceOperatingLicenseEmail},#{item.status},#{item.invoiceNo},#{item.invoiceDate},#{item.invoiceAmount},#{item.relatedBillBilledAmount},#{item.createBy},#{item.updateBy},#{item.createTime},#{item.updateTime},#{item.deleted},#{item.invoiceType},#{item.enterpriseType},
            </trim>
        </foreach>
    </insert>
@@ -188,6 +191,7 @@
            <if test="invoiceNo != null">invoice_no = #{invoiceNo},</if>
            <if test="invoiceDate != null">invoice_date = #{invoiceDate},</if>
            <if test="invoiceAmount != null">invoice_amount = #{invoiceAmount},</if>
            <if test="relatedBillBilledAmount != null">related_bill_billed_amount = #{relatedBillBilledAmount},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
@@ -219,6 +223,7 @@
                <if test="item.invoiceNo != null">invoice_no = #{item.invoiceNo},</if>
                <if test="item.invoiceDate != null">invoice_date = #{item.invoiceDate},</if>
                <if test="item.invoiceAmount != null">invoice_amount = #{item.invoiceAmount},</if>
                <if test="item.relatedBillBilledAmount != null">related_bill_billed_amount = #{item.relatedBillBilledAmount},</if>
                <if test="item.createBy != null">create_by = #{item.createBy},</if>
                <if test="item.updateBy != null">update_by = #{item.updateBy},</if>
                <if test="item.createTime != null">create_time = #{item.createTime},</if>
@@ -255,9 +260,9 @@
    </delete>
    <insert id="batchInvoiceDetail">
        insert into invoice_detail( id, invoice_manage_id, receivable_bill_no, receivable_bill_amount, receivable_bill_currency, billed_amount, unbilled_amount, current_billed_amount, create_time, update_time, deleted) values
        insert into invoice_detail(  invoice_manage_id, receivable_bill_no, receivable_bill_amount, receivable_bill_currency, billed_amount, unbilled_amount, current_billed_amount, create_time, update_time, deleted) values
      <foreach item="item" index="index" collection="list" separator=",">
            ( #{item.id}, #{item.invoiceManageId}, #{item.receivableBillNo}, #{item.receivableBillAmount}, #{item.receivableBillCurrency}, #{item.billedAmount}, #{item.unbilledAmount}, #{item.currentBilledAmount}, #{item.createTime}, #{item.updateTime}, #{item.deleted})
            (  #{item.invoiceManageId}, #{item.receivableBillNo}, #{item.receivableBillAmount}, #{item.receivableBillCurrency}, #{item.billedAmount}, #{item.unbilledAmount}, #{item.currentBilledAmount}, #{item.createTime}, #{item.updateTime}, #{item.deleted})
        </foreach>
    </insert>