ProcurementPlanReplenishMapper.xml
9.9 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
192
193
194
195
196
197
198
199
200
<?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.replenish.ProcurementPlanReplenishMapper">
<resultMap id="ProcurementPlanReplenish" type="com.lframework.xingyun.sc.procurement.entity.replenish.ProcurementPlanReplenish">
<id column="id" property="id"/>
<result column="procurement_plan_id" property="procurementPlanId"/>
<result column="code" property="code"/>
<result column="company_short_id" property="companyShortId"/>
<result column="company_short_name" property="companyShortName"/>
<result column="company_full_name" property="companyFullName"/>
<result column="supplier_id" property="supplierId"/>
<result column="supplier_name" property="supplierName"/>
<result column="purchase_department" property="purchaseDepartment"/>
<result column="purchase_department_name" property="purchaseDepartmentName"/>
<result column="purchase_department_code" property="purchaseDepartmentCode"/>
<result column="region" property="region"/>
<result column="region_name" property="regionName"/>
<result column="date" property="date"/>
<result column="validity_period" property="validityPeriod"/>
<result column="quoter_id" property="quoterId"/>
<result column="quoter_name" property="quoterName"/>
<result column="long_term_operation" property="longTermOperation"/>
<result column="terminal_customer" property="terminalCustomer"/>
<result column="priced" property="priced"/>
<result column="pricing_deadline" property="pricingDeadline"/>
<result column="temporary_price" property="temporaryPrice"/>
<result column="other_expense_settlement" property="otherExpenseSettlement"/>
<result column="delivery_mode" property="deliveryMode"/>
<result column="commodity_buyout" property="commodityBuyout"/>
<result column="quality_buyout" property="qualityBuyout"/>
<result column="quantity_buyout" property="quantityBuyout"/>
<result column="door_delivery" property="doorDelivery"/>
<result column="shipping_cost" property="shippingCost"/>
<result column="loading_fee" property="loadingFee"/>
<result column="invoice_product_name" property="invoiceProductName"/>
<result column="delivery_date" property="deliveryDate"/>
<result column="settlement_method" property="settlementMethod"/>
<result column="settlement_ratio" property="settlementRatio"/>
<result column="price_id" property="priceId"/>
<result column="price_code" property="priceCode"/>
<result column="coordination_reason" property="coordinationReason"/>
<result column="invoice_type_status" property="invoiceTypeStatus"/>
<result column="total_quantity" property="totalQuantity"/>
<result column="remark" property="remark"/>
<result column="material_condition_enabled" property="materialConditionEnabled"/>
<result column="material_condition_copper_rice" property="materialConditionCopperRice"/>
<result column="material_condition_bright_copper" property="materialConditionBrightCopper"/>
<result column="material_condition_first_class" property="materialConditionFirstClass"/>
<result column="material_condition_second_class" property="materialConditionSecondClass"/>
<result column="material_condition_tin_coated" property="materialConditionTinCoated"/>
<result column="material_condition_scrap" property="materialConditionScrap"/>
<result column="material_condition_white_yellow" property="materialConditionWhiteYellow"/>
<result column="material_condition_phosphor_copper" property="materialConditionPhosphorCopper"/>
<result column="approval_status" property="approvalStatus"/>
<result column="process_node" property="processNode"/>
<result column="workshop_id" property="workshopId"/>
<result column="workshop_name" property="workshopName"/>
<result column="general_manager_name" property="generalManagerName"/>
<result column="marketing_manager_name" property="marketingManagerName"/>
<result column="supply_manager_name" property="supplyManagerName"/>
<result column="management_dept_name" property="managementDeptName"/>
<result column="purchase_dept_name" property="purchaseDeptName"/>
<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="ProcurementPlanReplenish_sql">
SELECT
ppr.id,
ppr.procurement_plan_id,
ppr.code,
ppr.company_short_id,
bdcs.short_name AS company_short_name,
bdcs.company_name AS company_full_name,
ppr.supplier_id,
pdc.unit_name AS supplier_name,
ppr.purchase_department,
sd.name AS purchase_department_name,
sd.code AS purchase_department_code,
ppr.region,
sd1.name AS region_name,
ppr.date,
ppr.validity_period,
ppr.quoter_id,
ppr.quoter_name,
ppr.long_term_operation,
ppr.terminal_customer,
ppr.priced,
ppr.pricing_deadline,
ppr.temporary_price,
ppr.other_expense_settlement,
ppr.delivery_mode,
ppr.commodity_buyout,
ppr.quality_buyout,
ppr.quantity_buyout,
ppr.door_delivery,
ppr.shipping_cost,
ppr.loading_fee,
ppr.invoice_product_name,
ppr.delivery_date,
ppr.settlement_method,
ppr.settlement_ratio,
ppr.price_id,
bdp.code AS price_code,
ppr.coordination_reason,
ppr.invoice_type_status,
ppr.total_quantity,
ppr.remark,
ppr.material_condition_enabled,
ppr.material_condition_copper_rice,
ppr.material_condition_bright_copper,
ppr.material_condition_first_class,
ppr.material_condition_second_class,
ppr.material_condition_tin_coated,
ppr.material_condition_scrap,
ppr.material_condition_white_yellow,
ppr.material_condition_phosphor_copper,
ppr.approval_status,
ppr.process_node,
ppr.workshop_id,
ws.name AS workshop_name,
ppr.general_manager_name,
ppr.marketing_manager_name,
ppr.supply_manager_name,
ppr.management_dept_name,
ppr.purchase_dept_name,
ppr.create_by_id,
ppr.create_by,
ppr.update_by_id,
ppr.update_by,
ppr.create_time,
ppr.update_time
FROM procurement_plan_replenish AS ppr
LEFT JOIN base_data_company_short AS bdcs ON bdcs.id = ppr.company_short_id
LEFT JOIN procurement_domestic_customer_credit pdc ON pdc.id = ppr.supplier_id
LEFT JOIN sys_dept sd ON sd.id = ppr.purchase_department
LEFT JOIN sys_dept sd1 ON sd1.id = ppr.region
LEFT JOIN base_data_workshop AS ws ON ws.id = ppr.workshop_id
LEFT JOIN base_data_price AS bdp ON bdp.id = ppr.price_id
</sql>
<select id="findById" resultMap="ProcurementPlanReplenish">
<include refid="ProcurementPlanReplenish_sql"/>
WHERE ppr.id = #{id}
</select>
<select id="getByProcurementPlanId" resultMap="ProcurementPlanReplenish">
<include refid="ProcurementPlanReplenish_sql"/>
WHERE ppr.procurement_plan_id = #{procurementPlanId}
ORDER BY ppr.create_time DESC
</select>
<select id="query" resultMap="ProcurementPlanReplenish">
<include refid="ProcurementPlanReplenish_sql"/>
<where>
<if test="vo.code != null and vo.code != ''">
AND ppr.code LIKE CONCAT('%', #{vo.code}, '%')
</if>
<if test="vo.companyShortId != null and vo.companyShortId != ''">
AND ppr.company_short_id = #{vo.companyShortId}
</if>
<if test="vo.companyName != null and vo.companyName != ''">
AND (
bdcs.company_name LIKE CONCAT('%', #{vo.companyName}, '%')
OR bdcs.short_name LIKE CONCAT('%', #{vo.companyName}, '%')
)
</if>
<if test="vo.purchaseDepartment != null and vo.purchaseDepartment != ''">
AND ppr.purchase_department = #{vo.purchaseDepartment}
</if>
<if test="vo.startDate != null">
AND ppr.date >= #{vo.startDate}
</if>
<if test="vo.endDate != null">
AND ppr.date <= #{vo.endDate}
</if>
<if test="vo.supplierId != null and vo.supplierId != ''">
AND ppr.supplier_id = #{vo.supplierId}
</if>
<if test="vo.supplierName != null and vo.supplierName != ''">
AND pdc.unit_name LIKE CONCAT('%', #{vo.supplierName}, '%')
</if>
<if test="vo.workshopId != null and vo.workshopId != ''">
AND ppr.workshop_id = #{vo.workshopId}
</if>
<if test="vo.approvalStatus != null and vo.approvalStatus != ''">
AND ppr.approval_status = #{vo.approvalStatus}
</if>
<if test="vo.processNode != null and vo.processNode != ''">
AND ppr.process_node = #{vo.processNode}
</if>
</where>
ORDER BY ppr.create_time DESC
</select>
</mapper>