ProcurementDomesticCustomerCreditMapper.xml
9.64 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<?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.lframework.xingyun.sc.procurement.mappers.credit.ProcurementDomesticCustomerCreditMapper">
<resultMap id="ProcurementDomesticCustomerCredit"
type="com.lframework.xingyun.sc.procurement.entity.ProcurementDomesticCustomerCredit">
<id column="id" property="id"/>
<result column="unit_name" property="unitName"/>
<result column="customer_short_name" property="customerShortName"/>
<result column="company_nature" property="companyNature"/>
<result column="bank_name" property="bankName"/>
<result column="bank_account" property="bankAccount"/>
<result column="registered_capital" property="registeredCapital"/>
<result column="legal_representative" property="legalRepresentative"/>
<result column="company_established_time" property="companyEstablishedTime"/>
<result column="address" property="address"/>
<result column="business_principal" property="businessPrincipal"/>
<result column="business_principal_position" property="businessPrincipalPosition"/>
<result column="business_principal_phone" property="businessPrincipalPhone"/>
<result column="legal_business_relation" property="legalBusinessRelation"/>
<result column="factory_office_property" property="factoryOfficeProperty"/>
<result column="factory_office_area" property="factoryOfficeArea"/>
<result column="warehouse_yard_property" property="warehouseYardProperty"/>
<result column="warehouse_yard_area" property="warehouseYardArea"/>
<result column="main_equipment" property="mainEquipment"/>
<result column="normal_inventory" property="normalInventory"/>
<result column="main_varieties" property="mainVarieties"/>
<result column="monthly_purchase_volume" property="monthlyPurchaseVolume"/>
<result column="purchase_source" property="purchaseSource"/>
<result column="stock_in_product_name" property="stockInProductName"/>
<result column="product_name" property="productName"/>
<result column="capacity" property="capacity"/>
<result column="sales_channel" property="salesChannel"/>
<result column="has_preferential_policy" property="hasPreferentialPolicy"/>
<result column="invest_in_futures" property="investInFutures"/>
<result column="has_penalty_record" property="hasPenaltyRecord"/>
<result column="business_scope_match" property="businessScopeMatch"/>
<result column="first_cooperation_year" property="firstCooperationYear"/>
<result column="is_new_development" property="isNewDevelopment"/>
<result column="operation_mode" property="operationMode"/>
<result column="has_failed_plan_record" property="hasFailedPlanRecord"/>
<result column="has_plan_performance_issue" property="hasPlanPerformanceIssue"/>
<result column="accounting_process" property="accountingProcess"/>
<result column="invoice_name_match" property="invoiceNameMatch"/>
<result column="outbound_process_standard" property="outboundProcessStandard"/>
<result column="transport_mode" property="transportMode"/>
<result column="common_material_issue" property="commonMaterialIssue"/>
<result column="other_issue" property="otherIssue"/>
<result column="attachment_file_ids" property="attachmentFileIds"/>
<result column="attachment_file_names" property="attachmentFileNames"/>
<result column="investigator_id" property="investigatorId"/>
<result column="investigator_name" property="investigatorName"/>
<result column="purchase_department" property="purchaseDepartment"/>
<result column="purchase_department_name" property="purchaseDepartmentName"/>
<result column="purchase_department_code" property="purchaseDepartmentCode"/>
<result column="review_valid_until" property="reviewValidUntil"/>
<result column="status" property="status"/>
<result column="freeze" property="freeze"/>
<result column="create_by_id" property="createById"/>
<result column="create_by" property="createBy"/>
<result column="update_by_id" property="updateById"/>
<result column="update_by" property="updateBy"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<sql id="ProcurementDomesticCustomerCreditSql">
SELECT
tb.id,
tb.unit_name,
tb.customer_short_name,
tb.company_nature,
tb.bank_name,
tb.bank_account,
tb.registered_capital,
tb.legal_representative,
tb.company_established_time,
tb.address,
tb.business_principal,
tb.business_principal_position,
tb.business_principal_phone,
tb.legal_business_relation,
tb.factory_office_property,
tb.factory_office_area,
tb.warehouse_yard_property,
tb.warehouse_yard_area,
tb.main_equipment,
tb.normal_inventory,
tb.main_varieties,
tb.monthly_purchase_volume,
tb.purchase_source,
tb.stock_in_product_name,
tb.product_name,
tb.capacity,
tb.sales_channel,
tb.has_preferential_policy,
tb.invest_in_futures,
tb.has_penalty_record,
tb.business_scope_match,
tb.first_cooperation_year,
tb.is_new_development,
tb.operation_mode,
tb.has_failed_plan_record,
tb.has_plan_performance_issue,
tb.accounting_process,
tb.invoice_name_match,
tb.outbound_process_standard,
tb.transport_mode,
tb.common_material_issue,
tb.other_issue,
tb.attachment_file_ids,
tb.attachment_file_names,
tb.investigator_id,
tb.investigator_name,
tb.purchase_department,
sd.name AS purchase_department_name,
sd.code AS purchase_department_code,
tb.review_valid_until,
tb.status,
tb.freeze,
tb.create_by_id,
tb.create_by,
tb.update_by_id,
tb.update_by,
tb.create_time,
tb.update_time
FROM procurement_domestic_customer_credit tb
left join sys_dept as sd on sd.id = tb.purchase_department
</sql>
<select id="query" resultMap="ProcurementDomesticCustomerCredit">
<include refid="ProcurementDomesticCustomerCreditSql"/>
<where>
<if test="vo.unitName != null and vo.unitName != ''">
AND tb.unit_name LIKE CONCAT('%', #{vo.unitName}, '%')
</if>
<if test="vo.customerShortName != null and vo.customerShortName != ''">
AND tb.customer_short_name LIKE CONCAT('%', #{vo.customerShortName}, '%')
</if>
<if test="vo.companyNature != null and vo.companyNature != ''">
AND tb.company_nature LIKE CONCAT('%', #{vo.companyNature}, '%')
</if>
<if test="vo.businessPrincipal != null and vo.businessPrincipal != ''">
AND tb.business_principal LIKE CONCAT('%', #{vo.businessPrincipal}, '%')
</if>
<if test="vo.investigatorId != null and vo.investigatorId != ''">
AND tb.investigator_id = #{vo.investigatorId}
</if>
<if test="vo.investigatorName != null and vo.investigatorName != ''">
AND tb.investigator_name LIKE CONCAT('%', #{vo.investigatorName}, '%')
</if>
<if test="vo.purchaseDepartment != null and vo.purchaseDepartment != ''">
AND tb.purchase_department = #{vo.purchaseDepartment}
</if>
<if test="vo.status != null and vo.status != ''">
AND tb.status = #{vo.status}
</if>
<if test="vo.freeze != null">
AND tb.freeze = #{vo.freeze}
</if>
<if test="vo.reviewValidUntilStart != null">
AND tb.review_valid_until <![CDATA[ >= ]]> #{vo.reviewValidUntilStart}
</if>
<if test="vo.reviewValidUntilEnd != null">
AND tb.review_valid_until <![CDATA[ <= ]]> #{vo.reviewValidUntilEnd}
</if>
<if test="vo.createDateStart != null">
AND DATE(tb.create_time) <![CDATA[ >= ]]> #{vo.createDateStart}
</if>
<if test="vo.createDateEnd != null">
AND DATE(tb.create_time) <![CDATA[ <= ]]> #{vo.createDateEnd}
</if>
</where>
ORDER BY tb.create_time DESC
</select>
<select id="findById" resultMap="ProcurementDomesticCustomerCredit">
<include refid="ProcurementDomesticCustomerCreditSql"/>
WHERE tb.id = #{id}
</select>
<select id="getReviewerById" resultType="com.lframework.xingyun.sc.procurement.dto.DomesticReviewerDto">
SELECT business_id,
JSON_UNQUOTE(JSON_EXTRACT(def_json, '$.nodeList[2].extMap.handleInfos[0].createBy')) AS procurementOffice,
JSON_UNQUOTE(JSON_EXTRACT(def_json, '$.nodeList[3].extMap.handleInfos[0].createBy')) AS supplyManagementSection,
JSON_UNQUOTE(JSON_EXTRACT(def_json, '$.nodeList[4].extMap.handleInfos[0].createBy')) AS supplyDepartment
FROM flow_instance
WHERE business_id = #{id}
ORDER BY create_time DESC LIMIT 1
</select>
</mapper>