|
@@ -7,12 +7,15 @@
|
|
|
sy_shipping_details.id AS syDeclarationElementsId, /*发运明细主表id*/
|
|
|
sy_order_data.id AS syDeclarationElementsId, /*订单数据主表id*/
|
|
|
sy_shipping_details.chinese_Name AS productName,/*中文品名-->品名*/
|
|
|
- sy_shipping_details.pre_delivery_date AS preDeliveryDate, /*预发货日期 m*/
|
|
|
sy_shipping_details.customer AS customer, /*客户 customer */
|
|
|
sy_order_data.customer_Abbreviation AS customerAbbreviation, /*客户简称 customer */
|
|
|
- sy_order_data.supplier_Code AS customerCode, /*客户编码 customer */
|
|
|
- sy_shipping_details.garment_Factory AS garmentFactory, /*成衣工厂 garmentFactory m*/
|
|
|
- sy_shipping_details.order_Type AS orderType /*订单类型 m*/
|
|
|
+ sy_order_data.customer_Code AS customerCode, /*客户编码 customer */
|
|
|
+ sy_order_data.business_Type_Value,/*业务类型*/
|
|
|
+ sy_order_data.salesman,/*业务员*/
|
|
|
+ /*sy_shipping_details.garment_Factory AS garmentFactory, 成衣工厂 garmentFactory m*/
|
|
|
+ sy_shipping_details.order_Type AS orderType, /*订单类型 m*/
|
|
|
+ (SELECT sy_shipping_details_item.`pur_or_sub_order` FROM sy_shipping_details_item
|
|
|
+ WHERE shipping_details_id=sy_shipping_details.id LIMIT 1) spur_Or_Sub_Order
|
|
|
FROM sy_shipping_details LEFT JOIN
|
|
|
sy_order_data ON sy_shipping_details.`sy_order_data_id`=sy_order_data.`id`
|
|
|
WHERE sy_shipping_details.del_flag = 0 AND sy_shipping_details.id=#{value}
|
|
@@ -34,7 +37,7 @@
|
|
|
a.garment_factory,/*成衣工厂*/
|
|
|
a.depositary_receipt_no,/*预托书号*/
|
|
|
a.memo,/*备注*/
|
|
|
- a.pre_delivery_date,/*预发货日期*/
|
|
|
+ b.hod,/*预发货日期*/
|
|
|
a.order_type,/*订单类型*/
|
|
|
a.customer_abbreviation,/*客户简称*/
|
|
|
a.`update_time`,/*修改日期*/
|
|
@@ -49,7 +52,7 @@
|
|
|
sum(b.total_price) totalprice,/*总价*/
|
|
|
/*sum(b.total) totalquantity,*/
|
|
|
b.unit_price factoryUnitPrice,/*工厂单价*/
|
|
|
- b.spur_or_sub_order,/*采购委外订单号*/
|
|
|
+ a.spur_or_sub_order,/*采购委外订单号*/
|
|
|
b.inventory_name,/*存货名称*/
|
|
|
b.small_po,/*小po*/
|
|
|
b.distribution_point/*分销点*/
|
|
@@ -68,36 +71,87 @@
|
|
|
|
|
|
<select id="pushData" resultType="org.jeecg.modules.spapl.vo.PackingHeaderVo" parameterType="java.lang.String">
|
|
|
SELECT
|
|
|
- document_No as packingHeaderNum/*单据号*/,
|
|
|
- 'CLOTHING' as packingType /*计划装箱单类型*/,
|
|
|
- 'NEW' as packingStatus /*计划装箱单头状态*/,
|
|
|
- order_Number as poNo/*订单号*/,
|
|
|
- customerCode as customerCode/*客户编码*/,
|
|
|
- create_By as preparer/*创建人*/,
|
|
|
- create_Time as preparationTime/*创建时间*/
|
|
|
+ document_No AS packingHeaderNum/*单据号*/,
|
|
|
+ spur_Or_Sub_Order AS poNo,/*委外/采购订单号*/
|
|
|
+ /*采购/委外订单号对应的ID(唯一标识)*/ id as attributeBigint1,
|
|
|
+ 'CLOTHING' AS packingType /*计划装箱单类型*/,
|
|
|
+ 'NEW' AS packingStatus /*计划装箱单头状态*/,
|
|
|
+ size_Range AS size_Range,/*尺寸范围*/
|
|
|
+ item_number AS styleNo,/*款号*/
|
|
|
+ product_Name AS productName,/*品名*/
|
|
|
+ supplier_code supplierNumber, /*供应商编码*/
|
|
|
+ /* customer_Code AS customerCode/*客户编码*/,*/
|
|
|
+ create_By AS preparer/*创建人*/,
|
|
|
+ create_Time AS preparationTime/*创建时间*/
|
|
|
FROM `sy_pre_assembled_packing_list`
|
|
|
where id=#{value}
|
|
|
</select>
|
|
|
|
|
|
|
|
|
<select id="queryShippingDetails" resultType="org.jeecg.modules.documents.shippingDetails.entity.VO.SyShippingDetailsVo">
|
|
|
- select t.* from(select a.id as id,a.document_no as documentNo,a.document_date as documentDate,b.order_number as orderNumber,a.push_state,a.state,
|
|
|
- b.customer_abbreviation as customerAbbreviation,b.sales_department as salesDepartment,b.salesman as salesman,a.customer as customer,
|
|
|
- b.small_po as smallPo,b.pack_id as packId,a.pre_delivery_date as preDeliveryDate,a.declaration_name as declarationName,b.order_date as orderDate,
|
|
|
- sum(b.shipment_quantity) as shipmentQuantity,b.customs_declaration_unit_price as customsDeclarationUnitPrice,b.order_quantity as orderQuantity,
|
|
|
- b.is_tc as isTc,a.hs_code as hsCode,b.distribution_point as distributionPoint,b.item_number as itemNumber,b.business_type_text as businessTypeText,
|
|
|
- b.arrival_date as arrivalDate,b.inventory_name as inventoryName,b.sales_unit_price as salesUnitPrice,b.order_remaining_quantity as orderRemainingQuantity,
|
|
|
- b.pur_or_sub_order as purOrSubOrder,a.order_type as orderType,b.factory_unit_price as factoryUnitPrice,b.third_party as thirdParty,b.customer_order as customerOrder,
|
|
|
- b.material_composition as materialComposition,b.currency_text as currencyText,b.brand_side as brandSide,b.deposit_ratio as depositRatio,
|
|
|
- b.deposit as deposit,b.collaborative_route as collaborativeRoute,b.term_of_payment as termOfPayment,b.end_customer as endCustomer,
|
|
|
- b.order_remarks as orderRemarks,b.price_remarks as priceRemarks,b.order_change_description as orderChangeDescription,a.pre_completion_date as preCompletionDate,
|
|
|
- b.sales_type_text as salesTypeText,b.customer_name as customerName,b.exchange_rate as exchangeRate,a.whole_order_total as wholeOrderTotal,
|
|
|
- b.declaration_elements as declarationElements,b.number_of_sets as numberOfSets,a.chinese_name as chineseName,b.account as account,
|
|
|
- a.english_product_name as englishProductName,a.garment_factory as garmentFactory from sy_shipping_details a
|
|
|
-left join sy_shipping_details_item b
|
|
|
-on a.id = b.shipping_details_id and b.del_flag = 0
|
|
|
-where a.del_flag = 0 /* and inventory_code like '19%'*/ group by a.id order by a.document_no desc) as t
|
|
|
-${ew.customSqlSegment}
|
|
|
-
|
|
|
+ SELECT t.* FROM(SELECT
|
|
|
+ a.id AS id,
|
|
|
+ a.document_no AS documentNo,
|
|
|
+ a.document_date AS documentDate,
|
|
|
+ b.order_number AS orderNumber,
|
|
|
+ a.push_state,a.state,
|
|
|
+ b.customer_abbreviation AS customerAbbreviation,
|
|
|
+ b.sales_department AS salesDepartment,
|
|
|
+ b.salesman AS salesman,
|
|
|
+ a.customer AS customer,
|
|
|
+ b.small_po AS smallPo,
|
|
|
+ b.pack_id AS packId,
|
|
|
+ b.pre_delivery_date AS preDeliveryDate,
|
|
|
+ a.declaration_name AS declarationName,
|
|
|
+ b.order_date AS orderDate,
|
|
|
+ SUM(b.shipment_quantity) AS shipmentQuantity,
|
|
|
+ b.customs_declaration_unit_price AS customsDeclarationUnitPrice,
|
|
|
+ b.order_quantity AS orderQuantity,
|
|
|
+ b.is_tc AS isTc,
|
|
|
+ a.hs_code AS hsCode,
|
|
|
+ b.distribution_point AS distributionPoint,
|
|
|
+ b.item_number AS itemNumber,
|
|
|
+ b.business_type_text AS businessTypeText,
|
|
|
+ b.arrival_date AS arrivalDate,
|
|
|
+ b.inventory_name AS inventoryName,
|
|
|
+ b.sales_unit_price AS salesUnitPrice,
|
|
|
+ b.order_remaining_quantity AS orderRemainingQuantity,
|
|
|
+ b.pur_or_sub_order AS purOrSubOrder,
|
|
|
+ a.order_type AS orderType,
|
|
|
+ b.factory_unit_price AS factoryUnitPrice,
|
|
|
+ b.third_party AS thirdParty,
|
|
|
+ b.customer_order AS customerOrder,
|
|
|
+ b.material_composition AS materialComposition,
|
|
|
+ b.currency_text AS currencyText,
|
|
|
+ b.brand_side AS brandSide,
|
|
|
+ b.deposit_ratio AS depositRatio,
|
|
|
+ b.deposit AS deposit,
|
|
|
+ b.collaborative_route AS collaborativeRoute,
|
|
|
+ b.term_of_payment AS termOfPayment,
|
|
|
+ b.end_customer AS endCustomer,
|
|
|
+ b.order_remarks AS orderRemarks,
|
|
|
+ b.price_remarks AS priceRemarks,
|
|
|
+ b.order_change_description AS orderChangeDescription,
|
|
|
+ b.pre_completion_date AS preCompletionDate,
|
|
|
+ b.sales_type_text AS salesTypeText,
|
|
|
+ b.customer_name AS customerName,
|
|
|
+ b.exchange_rate AS exchangeRate,
|
|
|
+ a.whole_order_total AS wholeOrderTotal,
|
|
|
+ b.declaration_elements AS declarationElements,
|
|
|
+ b.number_of_sets AS numberOfSets,
|
|
|
+ a.chinese_name AS chineseName,
|
|
|
+ b.account AS account,
|
|
|
+ a.english_product_name AS englishProductName,
|
|
|
+ b.garment_factory AS garmentFactory,
|
|
|
+ excess_quantity
|
|
|
+ FROM sy_shipping_details a
|
|
|
+ LEFT JOIN sy_shipping_details_item b
|
|
|
+ ON a.id = b.shipping_details_id AND b.del_flag = 0
|
|
|
+ WHERE
|
|
|
+ a.del_flag = 0
|
|
|
+ and a.state=1
|
|
|
+ /* and inventory_code like '19%'*/
|
|
|
+ GROUP BY a.id ORDER BY a.document_no DESC) AS t
|
|
|
+ ${ew.customSqlSegment}
|
|
|
</select>
|
|
|
</mapper>
|