@ -94,9 +94,9 @@
END id,
CONCAT_WS( ',', k.orderCode, m.orderCode ) AS orderCode,
CONCAT_WS( ',', k.serviceNumber, m.serviceNumber ) AS serviceNumber,
CONCAT_WS( ',', k.consigneeUnit, m.consigneeUnit ) AS consigneeUnit ,
CONCAT_WS( ',', k.customerName, m.customerName ) AS customerName ,
CONCAT_WS( ',', k.customerTelephone, m.customerTelephone ) AS customerTelephone,
IF(k.customerName is not null, k.customerName, m.customerName) AS customerName ,
IF(k.consigneeUnit is not null, k.consigneeUnit, m.consigneeUnit) AS consigneeUnit ,
IF(k.customerTelephone is not null, k.customerTelephone, m.customerTelephone ) AS customerTelephone,
CONCAT_WS( ',', k.waybillNumber ) AS waybillNumber,
k.warehouse_entry_time AS warehouseEntryTime,
k.storage_fee AS storageFee
@ -286,9 +286,9 @@
END id,
CONCAT_WS( ',', k.orderCode, m.orderCode ) AS orderCode,
CONCAT_WS( ',', k.serviceNumber, m.serviceNumber ) AS serviceNumber,
CONCAT_WS( ',', k.consigneeUnit, m.consigneeUnit ) AS consigneeUnit ,
CONCAT_WS( ',', k.customerName, m.customerName ) AS customerName ,
CONCAT_WS( ',', k.customerTelephone, m.customerTelephone ) AS customerTelephone,
IF(k.customerName is not null, k.customerName, m.customerName) AS customerName ,
IF(k.consigneeUnit is not null, k.consigneeUnit, m.consigneeUnit) AS consigneeUnit ,
IF(k.customerTelephone is not null, k.customerTelephone, m.customerTelephone ) AS customerTelephone,
CONCAT_WS( ',', k.waybillNumber ) AS waybillNumber,
k.warehouse_entry_time AS warehouseEntryTime,
k.storage_fee AS storageFee
@ -614,16 +614,28 @@
</select>
<select id= "getViewDetailOwn" resultType= "com.logpm.distribution.vo.DistrilbutionBillLadingViewVO" >
SELECT ldbl.pickup_batch AS pickupBatch,
GROUP_CONCAT(DISTINCT ANY_VALUE(ldsa.waybill_number)) AS waybillNumber,
GROUP_CONCAT(DISTINCT ANY_VALUE(ldsa.service_number)) AS serviceNumber,
GROUP_CONCAT(DISTINCT ANY_VALUE(ldsa.consignee_unit)) AS consigneeUnit,
GROUP_CONCAT(DISTINCT ANY_VALUE(ldsa.consignee_person)) AS customerName,
GROUP_CONCAT(DISTINCT ANY_VALUE(ldsa.consignee_mobile)) AS customerTelephone
FROM logpm_distrilbution_bill_lading ldbl
LEFT JOIN logpm_distrilbution_bill_stock ldbs ON ldbl.id = ldbs.bill_lading_id AND order_status != '2'
LEFT JOIN logpm_distribution_stock_article ldsa ON ldbs.stock_article_id = ldsa.id
WHERE ldbl.id = #{id}
SELECT
ldbl.pickup_batch AS pickupBatch,
GROUP_CONCAT(
DISTINCT ANY_VALUE ( ldsa.waybill_number )) AS waybillNumber,
GROUP_CONCAT(
DISTINCT ANY_VALUE ( ldsa.service_number )) AS serviceNumber,
IFNULL(GROUP_CONCAT(
DISTINCT ANY_VALUE ( ldsl.market_name )),GROUP_CONCAT(
DISTINCT ANY_VALUE ( ldsa.consignee_unit ))) AS consigneeUnit,
IFNULL(ldbl.consignee,GROUP_CONCAT(
DISTINCT ANY_VALUE ( ldsa.consignee_person ))) AS customerName,
GROUP_CONCAT(
DISTINCT ANY_VALUE ( ldsa.consignee_mobile )) AS customerTelephone
FROM
logpm_distrilbution_bill_lading ldbl
LEFT JOIN logpm_distrilbution_bill_stock ldbs ON ldbl.id = ldbs.bill_lading_id
AND order_status != '2'
LEFT JOIN logpm_distribution_stock_article ldsa ON ldbs.stock_article_id = ldsa.id
LEFT JOIN logpm_distribution_delivery_details AS lddd ON ldbl.id = lddd.bill_lading_id AND lddd.inventory_status IN ('1','3')
LEFT JOIN logpm_distribution_stock_list AS ldsl ON lddd.stock_list_id = ldsl.id
WHERE
ldbl.id = #{id}
GROUP BY ldbl.id;
</select>