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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
| <?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.basic.mapper.SupplierManageMapper">
|
| <select id="supplierListPage" resultType="com.ruoyi.basic.dto.SupplierManageDto">
| SELECT
| T1.id,
| T1.supplier_name,
| T1.taxpayer_identification_num,
| T1.company_address,
| T1.company_phone,
| T1.bank_account_name,
| T1.bank_account_num,
| T1.contact_user_name,
| T1.contact_user_phone,
| T1.maintain_user_id,
| T1.maintain_time,
| T1.create_time,
| T1.create_user,
| T1.update_time,
| T1.update_user,
| T1.tenant_id,
| T1.is_white,
| T2.nick_name AS maintainUserName,
| T1.supplier_type
| FROM supplier_manage T1
| LEFT JOIN sys_user T2 ON T1.maintain_user_id = T2.user_id
| <where>
| <if test="supplierManageDto.supplierName != null and supplierManageDto.supplierName != '' ">
| AND T1.supplier_name LIKE CONCAT('%',#{supplierManageDto.supplierName},'%')
| </if>
| <if test="supplierManageDto.isWhite != null">
| AND T1.is_white = #{supplierManageDto.isWhite}
| </if>
| </where>
| order by T1.maintain_time desc
| </select>
|
| <select id="supplierExportList" resultType="com.ruoyi.basic.excel.SupplierManageExcelDto">
| SELECT
| T1.id,
| T1.supplier_name,
| T1.taxpayer_identification_num,
| T1.company_address,
| T1.company_phone,
| T1.bank_account_name,
| T1.bank_account_num,
| T1.contact_user_name,
| T1.contact_user_phone,
| T1.maintain_user_id,
| T1.maintain_time,
| T1.create_time,
| T1.create_user,
| T1.update_time,
| T1.update_user,
| T1.tenant_id,
| T1.is_white,
| T2.nick_name AS maintainUserName
| FROM supplier_manage T1
| LEFT JOIN sys_user T2 ON T1.maintain_user_id = T2.user_id
| <where>
| <if test="supplierManageDto.supplierName != null and supplierManageDto.supplierName != '' ">
| AND T1.supplier_name LIKE CONCAT('%',#{supplierManageDto.supplierName},'%')
| </if>
| <if test="supplierManageDto.isWhite != null">
| AND T1.is_white = #{supplierManageDto.isWhite}
| </if>
| </where>
| </select>
|
| <select id="supplierTransactions" resultType="com.ruoyi.purchase.vo.SupplierTransactionsVo">
| SELECT T1.supplier_id,
| sm.supplier_name,
| T1.contractAmounts
| FROM (SELECT supplier_id, SUM(contract_amount) AS contractAmounts FROM purchase_ledger GROUP BY supplier_id) T1
| LEFT JOIN supplier_manage sm ON T1.supplier_id = sm.id
| <where>
| <if test="supplierName!=null and supplierName!=''">
| AND sm.supplier_name LIKE CONCAT('%',#{supplierName},'%')
| </if>
| </where>
| </select>
|
| <select id="supplierTransactionsDetails"
| resultType="com.ruoyi.purchase.vo.SupplierTransactionsDetailsVo">
| SELECT pl.id purchaseLedgerId,
| pl.purchase_contract_number,
| pl.execution_date,
| pl.contract_amount
| FROM purchase_ledger pl
| WHERE pl.supplier_id = #{supplierId}
| </select>
|
|
| </mapper>
|
|