From aa4a9c1aa4d6d0f986b108c20aee53e1dbae6183 Mon Sep 17 00:00:00 2001
From: wujianwei <wjw@11.com>
Date: 星期一, 26 一月 2026 14:17:06 +0800
Subject: [PATCH] 修改新增科目代码

---
 service/src/main/resources/mapper/cwgl/InvoiceManageMapper.xml |   47 +++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 41 insertions(+), 6 deletions(-)

diff --git a/service/src/main/resources/mapper/cwgl/InvoiceManageMapper.xml b/service/src/main/resources/mapper/cwgl/InvoiceManageMapper.xml
index 641de9c..5ca8cf4 100644
--- a/service/src/main/resources/mapper/cwgl/InvoiceManageMapper.xml
+++ b/service/src/main/resources/mapper/cwgl/InvoiceManageMapper.xml
@@ -6,6 +6,7 @@
 
     <resultMap type="com.ruoyi.cwgl.domain.InvoiceManage" id="InvoiceManageResult">
         <result property="id"    column="id"    />
+        <result property="orderNo"    column="order_no"    />
         <result property="invoiceInfoId"    column="invoice_info_id"    />
         <result property="invoiceSellerId"    column="invoice_seller_id"    />
         <result property="customerName"    column="customer_name"    />
@@ -38,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"    />
@@ -52,14 +62,27 @@
         <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">
-        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_seller_address, thisTab.invoice_seller_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
+        select thisTab.id, thisTab.order_no, 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_seller_address, thisTab.invoice_seller_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
     </sql>
 
     <sql id="whereCondition">
+        <if test="orderNo != null  and orderNo != ''"> and thisTab.order_no = #{orderNo}</if>
         <if test="invoiceInfoId != null "> and thisTab.invoice_info_id = #{invoiceInfoId}</if>
         <if test="invoiceSellerId != null "> and thisTab.invoice_seller_id = #{invoiceSellerId}</if>
         <if test="customerName != null  and customerName != ''"> and  thisTab.customer_name like concat('%', #{customerName}, '%')</if>
@@ -84,10 +107,13 @@
     </sql>
 
     <!--鏌ヨ-->
-    <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_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
+    <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,
+             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>
 
@@ -105,11 +131,17 @@
         </where>
         order by thisTab.id desc
     </select>
+    <select id="selectInvoiceManageLogByOrderNo" resultMap="InvoiceManageResult">
+        <include refid="selectInvoiceManageVo"/>
+        where order_no = #{orderno}
+
+    </select>
 
     <!-- 鏂板 -->
     <insert id="insertInvoiceManage" parameterType="com.ruoyi.cwgl.domain.InvoiceManage"  useGeneratedKeys="true" keyProperty="id">
         insert into invoice_manage
         <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="orderNo != null">order_no,</if>
             <if test="invoiceInfoId != null">invoice_info_id,</if>
             <if test="invoiceSellerId != null">invoice_seller_id,</if>
             <if test="customerName != null">customer_name,</if>
@@ -138,6 +170,7 @@
             <if test="enterpriseType != null">enterprise_type,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="orderNo != null">#{orderNo},</if>
             <if test="invoiceInfoId != null">#{invoiceInfoId},</if>
             <if test="invoiceSellerId != null">#{invoiceSellerId},</if>
             <if test="customerName != null">#{customerName},</if>
@@ -170,11 +203,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_seller_address,invoice_seller_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,
+            id,order_no,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_seller_address,invoice_seller_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.invoiceSellerAddress},#{item.invoiceSellerPhone},#{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},
+                #{item.id},#{item.orderNo},#{item.invoiceInfoId},#{item.invoiceSellerId},#{item.customerName},#{item.invoiceSellerName},#{item.invoiceCompanyName},#{item.invoiceCreditCode},#{item.invoiceSellerCreditCode},#{item.invoiceBankName},#{item.invoiceBankNo},#{item.invoiceOperatingLicenseAddress},#{item.invoiceOperatingLicensePhone},#{item.invoiceSellerAddress},#{item.invoiceSellerPhone},#{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>
@@ -183,6 +216,7 @@
     <update id="updateInvoiceManage" parameterType="com.ruoyi.cwgl.domain.InvoiceManage">
         update invoice_manage
         <trim prefix="SET" suffixOverrides=",">
+            <if test="orderNo != null">order_no = #{orderNo},</if>
             <if test="invoiceInfoId != null">invoice_info_id = #{invoiceInfoId},</if>
             <if test="invoiceSellerId != null">invoice_seller_id = #{invoiceSellerId},</if>
             <if test="customerName != null">customer_name = #{customerName},</if>
@@ -217,6 +251,7 @@
         <foreach collection="list" item="item" index="index" separator=";">
             update invoice_manage
             <trim prefix="SET" suffixOverrides=",">
+                <if test="item.orderNo != null">order_no = #{item.orderNo},</if>
                 <if test="item.invoiceInfoId != null">invoice_info_id = #{item.invoiceInfoId},</if>
                 <if test="item.invoiceSellerId != null">invoice_seller_id = #{item.invoiceSellerId},</if>
                 <if test="item.customerName != null">customer_name = #{item.customerName},</if>

--
Gitblit v1.8.0