chenrui
2025-05-12 f81c345f7bf058fdfe5fee6f0dfd5de0f4cb767c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?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.ruoyi.sales.mapper.InvoiceRegistrationMapper">
    <select id="invoiceRegistrationListPage" resultType="com.ruoyi.sales.dto.InvoiceRegistrationDto">
        SELECT
            T1.id              ,
            T1.sales_ledger_id   ,
            T1.sales_contract_no ,
            T1.customer_id       ,
            T1.salesman          ,
            T1.project_name      ,
            T1.create_time       ,
            T1.create_user       ,
            T1.update_time       ,
            T1.update_user       ,
            T1.tenant_id,
            T2.customer_contract_no,
            T3.customer_name,
            T2.contract_amount
        FROM invoice_registration T1
        LEFT JOIN sales_ledger T2 ON T1.sales_ledger_id = T2.id
        LEFT JOIN customer T3 ON T1.customer_id = T3.id
    </select>
 
    <select id="invoiceRegisAndProductExcelDtoList" resultType="com.ruoyi.sales.excel.InvoiceRegisAndProductExcelDto">
        SELECT
            T1.id              ,
            T1.sales_ledger_id   ,
            T1.sales_contract_no ,
            T1.customer_id       ,
            T1.salesman          ,
            T1.project_name      ,
            T1.create_time       ,
            T1.create_user       ,
            T1.update_time       ,
            T1.update_user       ,
            T1.tenant_id,
            T2.customer_contract_no,
            T3.customer_name,
            T2.contract_amount,
            T4.product_category,
            T4.specification_model,
            T4.unit,
            T4.quantity,
            T4.tax_rate,
            T4.tax_inclusive_unit_price,
            T4.tax_inclusive_total_price,
            T4.tax_exclusive_total_price,
            T4.invoice_type,
            T4.invoice_num,
            T4.invoice_amount,
            T4.no_invoice_num,
            T4.no_invoice_amount
        FROM invoice_registration T1
                 JOIN sales_ledger T2 ON T1.sales_ledger_id = T2.id
                 JOIN customer T3 ON T1.customer_id = T3.id
                JOIN invoice_registration_product T4 ON T1.id = T4.invoice_registration_id
        ORDER BY T1.id ASC
    </select>
</mapper>