|
@@ -3,17 +3,26 @@
|
|
|
<mapper namespace="org.jeecg.modules.documents.syShippingOrder.mapper.SyShippingOrderMapper">
|
|
|
|
|
|
<select id="syShippingOrderPageList" resultType="org.jeecg.modules.documents.syShippingOrder.entity.SyShippingOrder">
|
|
|
- select a.id,a.shipping_order_number as shippingOrderNumber,b.order_number as orderNumber,a.export_invoice_no as exportInvoiceNo,
|
|
|
- b.distribution_point as distributionPoint,a.unit_in_operation as unitInOperation,a.box_number as boxNumber,b.garment_factory as garmentFactory,
|
|
|
- a.total_gross_weight as totalGrossWeight,case when b.ready_fabric != '成衣' then b.volume else a.total_volume end as totalVolume,b.box_number as planQuantity,b.client_abbreviation as clientAbbreviation,
|
|
|
- a.money,a.the_actual_shipping_date as theActualShippingDate,a.exchange_earnings_text as exchangeEarningsText,a.ready_fabric as readyFabric,
|
|
|
- a.consignee,a.bill_of_lading_or_carriage_receipt as billOfLadingOrCarriageReceipt,a.the_final_shipping_date as theFinalShippingDate,a.sy_stuta as syStuta,
|
|
|
- a.addressee,a.trade_country as tradeCountry,a.arrive_in_country as arriveInCountry,a.export_port as exportPort,a.is_ahaa as isAhaa,
|
|
|
- a.notifier,a.nottfy,a.destination_port as destinationPort,a.latest_date_of_shipment as latestDateOfShipment,a.the_documents_state as theDocumentsState
|
|
|
- from sy_shipping_order a
|
|
|
- left join sy_shipping_order_item b
|
|
|
- on a.id = b.sy_shipping_order_item_id
|
|
|
+
|
|
|
+select t.id, t.shippingOrderNumber, t.garmentFactory,t.clientAbbreviation,t.theFinalShippingDate,t.theDocumentsState,
|
|
|
+round(sum(t.totalPrice),2) as money,round(sum(t.grossWeight),2) as totalGrossWeight,sum(t.boxNumber) as boxNumber,t.syStuta,
|
|
|
+t.exportInvoiceNo,t.orderNumber,t.shippingOrderDate,t.smailPo,t.readyFabric,t.pkOrg,t.delFlag,t.distributionPoint,
|
|
|
+round(sum(t.volume),3) as totalVolume,t.unitInOperation from (
|
|
|
+select a.id as id,a.shipping_order_number as shippingOrderNumber,b.garment_factory as garmentFactory,
|
|
|
+b.client_abbreviation as clientAbbreviation,a.unit_in_operation as unitInOperation,b.box_number as boxNumber,
|
|
|
+b.gross_weight as grossWeight,b.volume as volume,sum(b.number*b.unit_price) as totalPrice,
|
|
|
+a.the_final_shipping_date as theFinalShippingDate,a.export_invoice_no as exportInvoiceNo,
|
|
|
+b.order_number as orderNumber,a.shipping_order_date as shippingOrderDate,b.smail_po as smailPo,b.ready_fabric as readyFabric,
|
|
|
+b.pk_org as pkOrg,a.del_flag as delFlag,b.distribution_point as distributionPoint, a.the_documents_state as theDocumentsState,
|
|
|
+a.sy_stuta as syStuta
|
|
|
+ from sy_shipping_order a
|
|
|
+left join sy_shipping_order_item b
|
|
|
+ON a.id = b.sy_shipping_order_item_id
|
|
|
+left join sy_packing_list_tailoring_item c
|
|
|
+on b.tailoring_fabric_item_id = c.id
|
|
|
${ew.customSqlSegment}
|
|
|
+group by c.group_id order by a.create_time desc) t group by t.shippingOrderNumber
|
|
|
+
|
|
|
</select>
|
|
|
|
|
|
|
|
@@ -97,7 +106,7 @@ a.salesman, a.operating_department as operatingDepartment, a.purchase_outsourcin
|
|
|
left join sy_packing_list_tailoring_item c
|
|
|
on a.tailoring_fabric_item_id = c.id
|
|
|
where a.del_flag = 0 and sy_shipping_order_item_id = #{id}
|
|
|
-group by a.group_id order by style_number,smail_po desc
|
|
|
+group by c.group_id order by style_number,smail_po desc
|
|
|
</select>
|
|
|
|
|
|
|