|
...
|
...
|
@@ -38,7 +38,7 @@ |
|
38
|
38
|
<result column="performance" property="performance"/>
|
|
39
|
39
|
<result column="packaging" property="packaging"/>
|
|
40
|
40
|
<result column="remarks" property="remarks"/>
|
|
41
|
|
- <result column="shipping_fee" property="shippingFee"/>
|
|
|
41
|
+ <result column="shipping_cost" property="shippingCost"/>
|
|
42
|
42
|
<result column="return_shipping_cost" property="returnShippingCost"/>
|
|
43
|
43
|
<result column="customer_type" property="customerType"/>
|
|
44
|
44
|
<result column="quality" property="quality"/>
|
|
...
|
...
|
@@ -91,7 +91,7 @@ |
|
91
|
91
|
tb.performance,
|
|
92
|
92
|
tb.packaging,
|
|
93
|
93
|
tb.remarks,
|
|
94
|
|
- tb.shipping_fee,
|
|
|
94
|
+ tb.shipping_cost,
|
|
95
|
95
|
tb.return_shipping_cost,
|
|
96
|
96
|
tb.customer_type,
|
|
97
|
97
|
tb.quality,
|
|
...
|
...
|
@@ -109,9 +109,93 @@ |
|
109
|
109
|
left join base_data_workshop as ws on ws.id = tb.workshop_id
|
|
110
|
110
|
</sql>
|
|
111
|
111
|
|
|
112
|
|
- <select id="query" resultMap="OrderDetailReport">
|
|
|
112
|
+<!-- <select id="query" resultMap="OrderDetailReport">-->
|
|
|
113
|
+<!-- <include refid="OrderDetailReport_sql"/>-->
|
|
|
114
|
+<!-- <where>-->
|
|
|
115
|
+<!-- <if test="vo.purchaseOrderLineId != null and vo.purchaseOrderLineId != ''">-->
|
|
|
116
|
+<!-- AND tb.purchase_order_line_id = #{vo.purchaseOrderLineId}-->
|
|
|
117
|
+<!-- </if>-->
|
|
|
118
|
+<!-- <if test="vo.orderNo != null and vo.orderNo != ''">-->
|
|
|
119
|
+<!-- AND tb.order_no LIKE CONCAT('%', #{vo.orderNo}, '%')-->
|
|
|
120
|
+<!-- </if>-->
|
|
|
121
|
+<!-- <if test="vo.workshopId != null and vo.workshopId != ''">-->
|
|
|
122
|
+<!-- AND tb.workshop_id = #{vo.workshopId}-->
|
|
|
123
|
+<!-- </if>-->
|
|
|
124
|
+<!-- <if test="vo.deptName != null and vo.deptName != ''">-->
|
|
|
125
|
+<!-- AND tb.dept_name LIKE CONCAT('%', #{vo.deptName}, '%')-->
|
|
|
126
|
+<!-- </if>-->
|
|
|
127
|
+<!-- <if test="vo.orderingUnitName != null and vo.orderingUnitName != ''">-->
|
|
|
128
|
+<!-- AND tb.ordering_unit_name LIKE CONCAT('%', #{vo.orderingUnitName}, '%')-->
|
|
|
129
|
+<!-- </if>-->
|
|
|
130
|
+<!-- </where>-->
|
|
|
131
|
+<!-- </select>-->
|
|
|
132
|
+
|
|
|
133
|
+ <select id="findById" resultType="com.lframework.xingyun.sc.entity.OrderDetailReport">
|
|
113
|
134
|
<include refid="OrderDetailReport_sql"/>
|
|
114
|
135
|
<where>
|
|
|
136
|
+ <if test="id != null and id != ''">
|
|
|
137
|
+ AND tb.id = #{id}
|
|
|
138
|
+ </if>
|
|
|
139
|
+ </where>
|
|
|
140
|
+ </select>
|
|
|
141
|
+
|
|
|
142
|
+ <select id="query" resultMap="OrderDetailReport">
|
|
|
143
|
+ SELECT *
|
|
|
144
|
+ FROM (
|
|
|
145
|
+ SELECT
|
|
|
146
|
+ tb.id,
|
|
|
147
|
+ tb.purchase_order_line_id,
|
|
|
148
|
+ tb.order_no,
|
|
|
149
|
+ tb.order_date,
|
|
|
150
|
+ tb.workshop_id,
|
|
|
151
|
+ ws.name AS workshop_name,
|
|
|
152
|
+ tb.dept_name,
|
|
|
153
|
+ tb.region_name,
|
|
|
154
|
+ tb.ordering_unit_name,
|
|
|
155
|
+ tb.industry,
|
|
|
156
|
+ tb.brand,
|
|
|
157
|
+ tb.thickness,
|
|
|
158
|
+ tb.thickness_tol_pos,
|
|
|
159
|
+ tb.thickness_tol_neg,
|
|
|
160
|
+ tb.width,
|
|
|
161
|
+ tb.width_tol_pos,
|
|
|
162
|
+ tb.width_tol_neg,
|
|
|
163
|
+ tb.length,
|
|
|
164
|
+ tb.length_tol_pos,
|
|
|
165
|
+ tb.length_tol_neg,
|
|
|
166
|
+ tb.status,
|
|
|
167
|
+ tb.quantity,
|
|
|
168
|
+ tb.suggested_price,
|
|
|
169
|
+ tb.delivery_date,
|
|
|
170
|
+ tb.assessment_exceeds_agreement,
|
|
|
171
|
+ tb.sales_price,
|
|
|
172
|
+ tb.price_list_no,
|
|
|
173
|
+ tb.packaging_fee,
|
|
|
174
|
+ tb.invoicing_status,
|
|
|
175
|
+ tb.piece_weight_header,
|
|
|
176
|
+ tb.surface,
|
|
|
177
|
+ tb.tolerance,
|
|
|
178
|
+ tb.performance,
|
|
|
179
|
+ tb.packaging,
|
|
|
180
|
+ tb.remarks,
|
|
|
181
|
+ tb.shipping_cost,
|
|
|
182
|
+ tb.return_shipping_cost,
|
|
|
183
|
+ tb.customer_type,
|
|
|
184
|
+ tb.quality,
|
|
|
185
|
+ tb.contract_type,
|
|
|
186
|
+ tb.stock_up_company_name,
|
|
|
187
|
+ tb.order_type,
|
|
|
188
|
+ tb.show_order,
|
|
|
189
|
+ tb.create_by_id,
|
|
|
190
|
+ tb.create_by,
|
|
|
191
|
+ tb.update_by_id,
|
|
|
192
|
+ tb.update_by,
|
|
|
193
|
+ tb.create_time,
|
|
|
194
|
+ tb.update_time,
|
|
|
195
|
+ MAX(tb.create_time) OVER (PARTITION BY tb.order_no, tb.purchase_order_line_id) AS group_latest_time
|
|
|
196
|
+ FROM order_detail_report tb
|
|
|
197
|
+ LEFT JOIN base_data_workshop ws ON ws.id = tb.workshop_id
|
|
|
198
|
+ <where>
|
|
115
|
199
|
<if test="vo.purchaseOrderLineId != null and vo.purchaseOrderLineId != ''">
|
|
116
|
200
|
AND tb.purchase_order_line_id = #{vo.purchaseOrderLineId}
|
|
117
|
201
|
</if>
|
|
...
|
...
|
@@ -121,12 +205,18 @@ |
|
121
|
205
|
<if test="vo.workshopId != null and vo.workshopId != ''">
|
|
122
|
206
|
AND tb.workshop_id = #{vo.workshopId}
|
|
123
|
207
|
</if>
|
|
124
|
|
- <if test="vo.deptName != null and vo.deptName != ''">
|
|
|
208
|
+ <if test="vo.deptName != null and vo.dedeptName != ''">
|
|
125
|
209
|
AND tb.dept_name LIKE CONCAT('%', #{vo.deptName}, '%')
|
|
126
|
210
|
</if>
|
|
127
|
211
|
<if test="vo.orderingUnitName != null and vo.orderingUnitName != ''">
|
|
128
|
212
|
AND tb.ordering_unit_name LIKE CONCAT('%', #{vo.orderingUnitName}, '%')
|
|
129
|
213
|
</if>
|
|
130
|
214
|
</where>
|
|
|
215
|
+ ) t
|
|
|
216
|
+ ORDER BY
|
|
|
217
|
+ t.group_latest_time DESC,
|
|
|
218
|
+ t.order_no ASC,
|
|
|
219
|
+ t.purchase_order_line_id ASC,
|
|
|
220
|
+ t.show_order ASC
|
|
131
|
221
|
</select>
|
|
132
|
222
|
</mapper> |
...
|
...
|
|