wujianwei
2026-01-14 d9b20efa8bdb66f5e2cb1793314f57ed66e846b3
service/src/main/resources/mapper/cwgl/InvoiceManageMapper.xml
@@ -39,6 +39,15 @@
        <collection property="invoiceDetailList" notNullColumn="sub_id" javaType="java.util.List" resultMap="InvoiceDetailResult" />
    </resultMap>
    <resultMap id="InvoiceManageInvoiceBillDetailResult" type="com.ruoyi.cwgl.domain.InvoiceManage" extends="InvoiceManageResult">
        <collection property="invoiceBillDetails" notNullColumn="bill_detail_id" javaType="java.util.List" resultMap="InvoiceBillDetailResult" />
    </resultMap>
    <resultMap id="InvoiceManageFullResult" type="com.ruoyi.cwgl.domain.InvoiceManage" extends="InvoiceManageResult">
        <collection property="invoiceDetailList" notNullColumn="sub_id" javaType="java.util.List" resultMap="InvoiceDetailResult" />
        <collection property="invoiceBillDetails" notNullColumn="bill_detail_id" javaType="java.util.List" resultMap="InvoiceBillDetailResult" />
    </resultMap>
    <resultMap type="com.ruoyi.cwgl.domain.InvoiceDetail" id="InvoiceDetailResult">
        <result property="id"    column="sub_id"    />
        <result property="invoiceManageId"    column="sub_invoice_manage_id"    />
@@ -51,6 +60,18 @@
        <result property="createTime"    column="sub_create_time"    />
        <result property="updateTime"    column="sub_update_time"    />
        <result property="deleted"    column="sub_deleted"    />
    </resultMap>
    <resultMap type="com.ruoyi.cwgl.domain.InvoiceBillDetail" id="InvoiceBillDetailResult">
        <result property="id"    column="bill_detail_id"    />
        <result property="invoiceManageId"    column="bill_detail_invoice_manage_id"    />
        <result property="goodsName"    column="bill_detail_goods_name"    />
        <result property="goodsCode"    column="bill_detail_goods_code"    />
        <result property="price"    column="bill_detail_price"    />
        <result property="status"    column="bill_detail_status"    />
        <result property="createTime"    column="bill_detail_create_time"    />
        <result property="updateTime"    column="bill_detail_update_time"    />
        <result property="withTaxFlag"    column="bill_detail_with_tax_flag"    />
    </resultMap>
    <sql id="selectInvoiceManageVo">
@@ -86,10 +107,13 @@
    </sql>
    <!--查询-->
    <select id="selectInvoiceManageById" parameterType="Integer" resultMap="InvoiceManageInvoiceDetailResult">
    <select id="selectInvoiceManageById" parameterType="Integer" resultMap="InvoiceManageFullResult">
        select a.id, a.order_no, 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_seller_address, a.invoice_seller_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
             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,
             c.id as bill_detail_id, c.invoice_manage_id as bill_detail_invoice_manage_id, c.goods_name as bill_detail_goods_name, c.goods_code  as bill_detail_goods_code, c.price as bill_detail_price, c.status as bill_detail_status, c.create_time as bill_detail_create_time, c.update_time as bill_detail_update_time, c.with_tax_flag as bill_detail_with_tax_flag
        from invoice_manage a
        left join invoice_detail b on b.invoice_manage_id = a.id
        left join invoice_bill_detail c on c.invoice_manage_id = a.id
        where a.id = #{id}
    </select>