From 6bbac4845106ca8648900b1d9af758c84275ffee Mon Sep 17 00:00:00 2001 From: lishenao <3065849776@qq.com> Date: 星期五, 04 七月 2025 18:09:49 +0800 Subject: [PATCH] 批量添加入库的方法 --- src/main/resources/mapper/purchase/ProductRecordMapper.xml | 42 +++++++++++++++++++++++++++++++++++++----- 1 files changed, 37 insertions(+), 5 deletions(-) diff --git a/src/main/resources/mapper/purchase/ProductRecordMapper.xml b/src/main/resources/mapper/purchase/ProductRecordMapper.xml index c42e777..e749894 100644 --- a/src/main/resources/mapper/purchase/ProductRecordMapper.xml +++ b/src/main/resources/mapper/purchase/ProductRecordMapper.xml @@ -7,7 +7,6 @@ <select id="productRecordPage" resultType="com.ruoyi.purchase.dto.ProductRecordDto"> SELECT - distinct sl.sales_contract_no, sl.customer_contract_no, sl.customer_name, @@ -18,11 +17,10 @@ tr.invoice_number, ROUND(pr.tickets_amount/(1+pr.tax_rate/100),2 ) as un_tickets_price, ROUND(pr.tickets_amount-pr.tickets_amount/(1+pr.tax_rate/100),2 )as invoice_amount - FROM product_record pr left join purchase_ledger pl on pl.id = pr.purchase_ledger_id left join sales_ledger sl on sl.id = pl.sales_ledger_id - left join ticket_registration tr on tr.purchase_ledger_id = pl.id + left join ticket_registration tr on tr.id = pr.ticket_registration_id left join product_model pm on pm.id = pr.product_model_id WHERE type = 2 <if test="c.salesContractNo != null and c.salesContractNo != ''"> @@ -32,10 +30,44 @@ and sl.supplier_name = #{c.supplierName} </if> <if test="c.createdAtStart != null and c.createdAtStart != ''"> - and pr.created_at >= date_format(#{c.createdAtStart},'%Y-%m-%d') + and pr.created_at >= date_format(#{c.createdAtStart},'%Y-%m-%d hh:mm:ss') </if> <if test="c.createdAtEnd != null and c.createdAtEnd != ''"> - and pr.created_at < date_format(#{c.createdAtEnd},'%Y-%m-%d') + and pr.created_at <= date_format(#{c.createdAtEnd},'%Y-%m-%d hh:mm:ss') </if> </select> + <select id="selectProductRecordListByPuechaserId" resultType="com.ruoyi.purchase.dto.ProductRecordDto"> + SELECT + P1.id, + P1.product_category, + P1.specification_model, + P1.unit, + P1.quantity, + P1.tax_rate, + P1.tax_inclusive_unit_price, + P1.tax_inclusive_total_price, + P1.tax_exclusive_total_price, + P2.supplier_name, + p2.supplier_id + from product_record P1 + left join purchase_ledger P2 on P1.purchase_ledger_id = P2.id + where p2.purchase_contract_number = #{purchaseContractNumber} and P1.type = 2 + </select> + <select id="selectProductRecordById" resultType="com.ruoyi.purchase.dto.ProductRecordDto"> + SELECT + P1.id, + P1.product_category, + P1.specification_model, + P1.unit, + P1.quantity, + P1.tax_rate, + P1.tax_inclusive_unit_price, + P1.tax_inclusive_total_price, + P1.tax_exclusive_total_price, + P2.supplier_name, + p2.supplier_id + from product_record P1 + left join purchase_ledger P2 on P1.purchase_ledger_id = P2.id + where P1.id = #{id} and P1.type = 2 + </select> </mapper> \ No newline at end of file -- Gitblit v1.9.3