@ -27,59 +27,184 @@
</resultMap>
<select id= "pageList" resultType= "com.logpm.distribution.vo.DistrilbutionBillLadingVO" >
select dbl.id,dsa.service_number serviceNumber,dsa.waybill_number waybillNumber,dsa.consignee_unit consigneeUnit,dsa.customer_name customerName,dsa.customer_telephone
customerTelephone,dsa.warehouse,dsa.warehouse_entry_time warehouseEntryTime,dsa.storage_fee storageFee,dsa.total_number totalNumber,dbl.certificate_type certificateType,
dsa.brand,dsa.type_service typeService,dbl.pick_up_time pickUpTime,dbl.consignee,dbl.delivery_document deliveryDocument,dbl.conditions,dbl.total_cost totalCost,
dbl.pick_up_plate pickUpPlate,dbl.pickup_batch pickupBatch,
select dbl.id,dsa.service_number serviceNumber,dsa.waybill_number waybillNumber,dsa.consignee_unit
consigneeUnit,dsa.customer_name customerName,dsa.customer_telephone
customerTelephone,dsa.warehouse,dsa.warehouse_entry_time warehouseEntryTime,dsa.storage_fee
storageFee,dsa.total_number totalNumber,dbl.certificate_type certificateType,
dsa.brand,dsa.type_service typeService,dbl.pick_up_time pickUpTime,dbl.consignee,dbl.delivery_document
deliveryDocument,dbl.conditions,dbl.total_cost totalCost,
dbl.pick_up_plate pickUpPlate,dbl.pickup_batch pickupBatch,
(
select COUNT(lds.id)
from logpm_distribution_delivery_details lddd
from logpm_distribution_delivery_details lddd
LEFT JOIN logpm_distribution_stock lds on lds.stock_list_id = lddd.stock_list_id
where lddd.bill_lading_id = dbl.id
) + (
select COUNT(lds.id)
from logpm_distrilbution_bill_stock ldbs
from logpm_distrilbution_bill_stock ldbs
LEFT JOIN logpm_distribution_stock lds on lds.stock_article = ldbs.stock_article_id
where ldbs.bill_lading_id = dbl.id
) stopNum
) stopNum
from logpm_distrilbution_bill_lading dbl
LEFT JOIN logpm_distribution_stock_article dsa on dbl.stock_article_id = dsa.id
<where >
dbl.is_deleted = 0
<if test= "param.serviceNumber != null and param.serviceNumber != ''" > and dsa.service_number like concat('%',#{param.serviceNumber},'%')</if>
<if test= "param.pickupBatch != null and param.pickupBatch != ''" > and dbl.pickup_batch like concat('%',#{param.pickupBatch},'%')</if>
<if test= "param.waybillNumber != null and param.waybillNumber != ''" > and dsa.waybill_number like concat('%',#{param.waybillNumber},'%')</if>
<if test= "param.consigneeUnit != null and param.consigneeUnit != ''" > and dsa.consignee_unit like concat('%',#{param.consigneeUnit},'%')</if>
<if test= "param.customerName != null and param.customerName != ''" > and dsa.customer_name like concat('%',#{param.customerName},'%')</if>
<if test= "param.customerTelephone != null and param.customerTelephone != ''" > and dsa.customer_telephone like concat('%',#{param.customerTelephone},'%')</if>
<if test= "param.warehouse != null and param.warehouse != ''" > and dsa.warehouse like concat('%',#{param.warehouse},'%')</if>
<if test= "param.serviceNumber != null and param.serviceNumber != ''" > and dsa.service_number like
concat('%',#{param.serviceNumber},'%')
</if>
<if test= "param.pickupBatch != null and param.pickupBatch != ''" > and dbl.pickup_batch like
concat('%',#{param.pickupBatch},'%')
</if>
<if test= "param.waybillNumber != null and param.waybillNumber != ''" > and dsa.waybill_number like
concat('%',#{param.waybillNumber},'%')
</if>
<if test= "param.consigneeUnit != null and param.consigneeUnit != ''" > and dsa.consignee_unit like
concat('%',#{param.consigneeUnit},'%')
</if>
<if test= "param.customerName != null and param.customerName != ''" > and dsa.customer_name like
concat('%',#{param.customerName},'%')
</if>
<if test= "param.customerTelephone != null and param.customerTelephone != ''" > and dsa.customer_telephone like
concat('%',#{param.customerTelephone},'%')
</if>
<if test= "param.warehouse != null and param.warehouse != ''" > and dsa.warehouse like
concat('%',#{param.warehouse},'%')
</if>
<if test= "param.warehouseIdList != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(param.warehouseIdList)" >
and dbl.warehouse_id in
<foreach collection= "param.warehouseIdList" item= "item" open= "(" close= ")" separator= "," >
#{item}
</foreach>
</if>
<if test= "param.warehouseEntryTime != null " > and date(dsa.warehouse_entry_time) = #{param.warehouseEntryTime}</if>
<if test= "param.startDate != null " > and dsa.warehouse_entry_time between #{param.startDate} and #{param.entDate} </if>
<if test= "param.warehouseEntryTime != null " > and date(dsa.warehouse_entry_time) =
#{param.warehouseEntryTime}
</if>
<if test= "param.startDate != null " > and dsa.warehouse_entry_time between #{param.startDate} and
#{param.entDate}
</if>
<if test= "param.brand != null and param.brand != ''" > and dsa.brand like concat('%',#{param.brand},'%')</if>
<if test= "param.typeService != null and param.typeService != ''" > and dsa.type_service = #{param.typeService},=</if>
<if test= "param.productInformation != null and param.productInformation != ''" > and dsa.allocation like concat('%',#{param.productInformation},'%')</if>
<if test= "param.pickupPhone != null and param.pickupPhone != ''" > and dbl.pickup_phone concat('%',#{param.pickupPhone},'%')</if>
<if test= "param.consignee != null and param.consignee != ''" > and dbl.consignee like concat('%',#{param.consignee},'%')</if>
<if test= "param.pickUpPlate != null and param.pickUpPlate != ''" > and dbl.pick_up_plate like concat('%',#{param.pickUpPlate},'%')</if>
<if test= "param.deliveryDocument != null and param.deliveryDocument != ''" > and dbl.delivery_document like concat('%',#{param.deliveryDocument},'%')</if>
<if test= "param.certificateType != null and param.certificateType != ''" > and dbl.certificate_type = #{param.certificateType},</if>
<if test= "param.typeService != null and param.typeService != ''" > and dsa.type_service =
#{param.typeService}
</if>
<if test= "param.productInformation != null and param.productInformation != ''" > and dsa.allocation like
concat('%',#{param.productInformation},'%')
</if>
<if test= "param.pickupPhone != null and param.pickupPhone != ''" > and dbl.pickup_phone
concat('%',#{param.pickupPhone},'%')
</if>
<if test= "param.consignee != null and param.consignee != ''" > and dbl.consignee like
concat('%',#{param.consignee},'%')
</if>
<if test= "param.pickUpPlate != null and param.pickUpPlate != ''" > and dbl.pick_up_plate like
concat('%',#{param.pickUpPlate},'%')
</if>
<if test= "param.deliveryDocument != null and param.deliveryDocument != ''" > and dbl.delivery_document like
concat('%',#{param.deliveryDocument},'%')
</if>
<if test= "param.certificateType != null and param.certificateType != ''" > and dbl.certificate_type =
#{param.certificateType},
</if>
</where>
</select>
<select id= "exportDistributionBillLading" resultType= "com.logpm.distribution.vo.DistrilbutionBillLadingVO" >
select dbl.id,dsa.service_number serviceNumber,dsa.waybill_number waybillNumber,dsa.consignee_unit
consigneeUnit,dsa.customer_name customerName,dsa.customer_telephone
customerTelephone,dsa.warehouse,dsa.warehouse_entry_time warehouseEntryTime,dsa.storage_fee
storageFee,dsa.total_number totalNumber,dbl.certificate_type certificateType,
dsa.brand,dsa.type_service typeService,dbl.pick_up_time pickUpTime,dbl.consignee,dbl.delivery_document
deliveryDocument,dbl.conditions,dbl.total_cost totalCost,
dbl.pick_up_plate pickUpPlate,dbl.pickup_batch pickupBatch,
(
select COUNT(lds.id)
from logpm_distribution_delivery_details lddd
LEFT JOIN logpm_distribution_stock lds on lds.stock_list_id = lddd.stock_list_id
where lddd.bill_lading_id = dbl.id
) + (
select COUNT(lds.id)
from logpm_distrilbution_bill_stock ldbs
LEFT JOIN logpm_distribution_stock lds on lds.stock_article = ldbs.stock_article_id
where ldbs.bill_lading_id = dbl.id
) stopNum
from logpm_distrilbution_bill_lading dbl
LEFT JOIN logpm_distribution_stock_article dsa on dbl.stock_article_id = dsa.id
<where >
dbl.is_deleted = 0
<if test= "param.serviceNumber != null and param.serviceNumber != ''" >
and dsa.service_number like concat('%',#{param.serviceNumber},'%')
</if>
<if test= "param.pickupBatch != null and param.pickupBatch != ''" >
and dbl.pickup_batch like concat('%',#{param.pickupBatch},'%')
</if>
<if test= "param.waybillNumber != null and param.waybillNumber != ''" >
and dsa.waybill_number like concat('%',#{param.waybillNumber},'%')
</if>
<if test= "param.consigneeUnit != null and param.consigneeUnit != ''" >
and dsa.consignee_unit like concat('%',#{param.consigneeUnit},'%')
</if>
<if test= "param.customerName != null and param.customerName != ''" >
and dsa.customer_name like concat('%',#{param.customerName},'%')
</if>
<if test= "param.customerTelephone != null and param.customerTelephone != ''" >
and dsa.customer_telephone like concat('%',#{param.customerTelephone},'%')
</if>
<if test= "param.warehouse != null and param.warehouse != ''" >
and dsa.warehouse like concat('%',#{param.warehouse},'%')
</if>
<if test= "param.warehouseId != null and param.warehouseId != ''" >
and dsa.warehouse_id like concat('%',#{param.warehouseId},'%')
</if>
<if test= "param.warehouseEntryTime != null " >
and date(dsa.warehouse_entry_time) = #{param.warehouseEntryTime}
</if>
<if test= "param.startDate != null " >
and dsa.warehouse_entry_time between #{param.startDate} and #{param.entDate}
</if>
<if test= "param.brand != null and param.brand != ''" >
and dsa.brand like concat('%',#{param.brand},'%')
</if>
<if test= "param.typeService != null and param.typeService != ''" >
and dsa.type_service = #{param.typeService}
</if>
<if test= "param.productInformation != null and param.productInformation != ''" >
and dsa.allocation like concat('%',#{param.productInformation},'%')
</if>
<if test= "param.pickupPhone != null and param.pickupPhone != ''" >
and dbl.pickup_phone concat('%',#{param.pickupPhone},'%')
</if>
<if test= "param.consignee != null and param.consignee != ''" >
and dbl.consignee like concat('%',#{param.consignee},'%')
</if>
<if test= "param.pickUpPlate != null and param.pickUpPlate != ''" >
and dbl.pick_up_plate like concat('%',#{param.pickUpPlate},'%')
</if>
<if test= "param.deliveryDocument != null and param.deliveryDocument != ''" >
and dbl.delivery_document like concat('%',#{param.deliveryDocument},'%')
</if>
<if test= "param.certificateType != null and param.certificateType != ''" >
and dbl.certificate_type = #{param.certificateType},
</if>
<if test= "idArr != null" >
and dbl.stock_article_id in
<foreach collection= "idArr" item= "item" open= "(" close= ")" separator= "," >
#{item}
</foreach>
</if>
</where>
</select>
<select id= "selectDistrilbutionBillLadingPage" resultMap= "distrilbutionBillLadingResultMap" >
select * from logpm_distrilbution_bill_lading where is_deleted = 0
select *
from logpm_distrilbution_bill_lading
where is_deleted = 0
</select>
<select id= "exportDistrilbutionBillLading" resultType= "com.logpm.distribution.excel.DistrilbutionBillLadingExcel" >
SELECT * FROM logpm_distrilbution_bill_lading ${ew.customSqlSegment}
SELECT *
FROM logpm_distrilbution_bill_lading ${ew.customSqlSegment}
</select>
<select id= "pageListApp" resultType= "com.logpm.distribution.vo.DistrilbutionBillLadingAppVO" >
@ -95,18 +220,20 @@
<where >
lad.is_deleted = 0 and lad.conditions = 10
<!-- and lad.warehouse_id = #{param.warehouseId} -->
<if test= "param.pickUpTimeStart != null and param.pickUpTimeStart!='' " > and lad.pick_up_time between #{param.pickUpTimeStart} and #{param.pickUpTimeEnd}</if>
<if test= "param.pickUpTimeStart != null and param.pickUpTimeStart!='' " > and lad.pick_up_time between
#{param.pickUpTimeStart} and #{param.pickUpTimeEnd}
</if>
</where>
</select>
<select id= "selectDataByBillLadingId" resultType= "com.logpm.distribution.vo.DistrilbutionBillLadingAppVO" >
select lad.id billLadingId,
3 carType,
lad.conditions conditions,
lad.Pick_up_plate pickUpPlate,
lad.consignee consignee,
select lad.id billLadingId,
3 carType,
lad.conditions conditions,
lad.Pick_up_plate pickUpPlate,
lad.consignee consignee,
lad.create_time,
lad.pick_up_time,
lad.stock_article_id stockArticleId
@ -119,15 +246,15 @@
select ldpl.stock_article_id stockArticleId,
ldpl.order_code orderCode,
ldpl.order_package_code orderPackageCode,
case
when ldbls.id is null then 1
else 2
end scanStatus,
0 errorStatus
case
when ldbls.id is null then 1
else 2
end scanStatus,
0 errorStatus
from logpm_distribution_parcel_list ldpl
left join logpm_distribution_bill_lading_scan ldbls on ldbls.parcel_list_id = ldpl.id and ldbls.is_deleted = 0
left join logpm_distribution_bill_lading_scan ldbls on ldbls.parcel_list_id = ldpl.id and ldbls.is_deleted = 0
<where >
ldpl.is_deleted = 0 and ldpl.order_package_code is not null
ldpl.is_deleted = 0 and ldpl.order_package_code is not null
and ldpl.stock_article_id = #{stockArticleId}
<if test= "orderCode != null and orderCode !=''" >
and ldpl.order_code = ${orderCode}
@ -141,16 +268,23 @@
</where>
</select>
<select id= "getOneOwn" resultType= "com.logpm.distribution.vo.DistrilbutionBillLadingVO" >
select lad.id,lad.stockup_code stockupCode,lad.pick_up_time pickUpTime,lad.stockup_area stockupArea,lad.consignee,
select lad.id,lad.stockup_code stockupCode,lad.pick_up_time pickUpTime,lad.stockup_area
stockupArea,lad.consignee,
lad.pick_up_plate pickUpPlate,lad.total_cost totalCost
from logpm_distrilbution_bill_lading lad
from logpm_distrilbution_bill_lading lad
<where >
lad.id = #{id}
</where>
</select>
<select id= "detailReservationOwn" resultType= "com.logpm.distribution.vo.DistrilbutionBillLadingOwnVO" >
select ldpi.id,ldpi.order_package_code orderPackageCode,ldpi.firsts ,ldpi.second ,ldpi.third_product thirdProduct,ldpi.material_name materialName,
ldpi.goods_allocation goodsAllocation,ldpi.pallet
select ldpi.id,
ldpi.order_package_code orderPackageCode,
ldpi.firsts,
ldpi.second,
ldpi.third_product thirdProduct,
ldpi.material_name materialName,
ldpi.goods_allocation goodsAllocation,
ldpi.pallet
from logpm_distribution_parcel_list ldpi
where ldpi.stock_article_id in (
select dbs.stock_article_id
@ -160,36 +294,39 @@
</select>
<select id= "detailOrderOwn" resultType= "com.logpm.distribution.vo.DistrilbutionBillLadingOwnVO" >
select ldsa.id,ldsa.order_code orderCode,ldsa.description_goods descriptionGoods,ldsa.total_number totalNumber,
ldbl.stockup_status stockupStatus,ldbl.stockip_allocation stockipAllocation,
( select count(*)
from logpm_distribution_stock lds
where lds.parcel_list_id in (
select ldpi.id
from logpm_distribution_parcel_list ldpi
where ldpi.stock_article_id in (
select dbs.stock_article_id
from logpm_distrilbution_bill_stock dbs
where dbs.bill_lading_id = #{id}
)
)
) esau
ldbl.stockup_status stockupStatus,ldbl.stockip_allocation stockipAllocation,
( select count(*)
from logpm_distribution_stock lds
where lds.parcel_list_id in (
select ldpi.id
from logpm_distribution_parcel_list ldpi
where ldpi.stock_article_id in (
select dbs.stock_article_id
from logpm_distrilbution_bill_stock dbs
where dbs.bill_lading_id = #{id}
)
)
) esau
from logpm_distrilbution_bill_lading ldbl
LEFT JOIN logpm_distrilbution_bill_stock ldbs on ldbl.id = ldbs.bill_lading_id
LEFT JOIN logpm_distribution_stock_article ldsa on ldbs.stock_article_id = ldsa.id
LEFT JOIN logpm_distrilbution_bill_stock ldbs on ldbl.id = ldbs.bill_lading_id
LEFT JOIN logpm_distribution_stock_article ldsa on ldbs.stock_article_id = ldsa.id
<where >
ldbl.id = #{id}
</where>
</select>
<select id= "getInventoryOwn" resultType= "com.logpm.distribution.vo.DistrilbutionBillLadingOwnVO" >
select ldsi.id,ldsi.sku,ldsi.order_code,ldsi.description_goods ,ldsi.cargo_unit ,lddd.quantity ,ldsi.tray_name ,ldsi.storage_location
from logpm_distribution_delivery_details lddd LEFT JOIN logpm_distribution_stock_list ldsi on lddd.stock_list_id = ldsi.id
select ldsi.id,ldsi.sku,ldsi.order_code,ldsi.description_goods ,ldsi.cargo_unit ,lddd.quantity ,ldsi.tray_name
,ldsi.storage_location
from logpm_distribution_delivery_details lddd LEFT JOIN logpm_distribution_stock_list ldsi on lddd.stock_list_id
= ldsi.id
<where >
lddd.bill_lading_id = #{id}
</where>
</select>
<select id= "getDetailOne" resultType= "com.logpm.distribution.vo.DistrilbutionBillLadingDetailsVO" >
select lad.id,lad.pick_up_time ,lad.consignee ,lad.pick_up_plate ,lad.delivery_document ,lad.certificate_type ,lad.total_cost
select lad.id,lad.pick_up_time ,lad.consignee ,lad.pick_up_plate ,lad.delivery_document ,lad.certificate_type
,lad.total_cost
from logpm_distrilbution_bill_lading lad
<where >
lad.id = #{id}
@ -197,87 +334,88 @@
</select>
<select id= "getInventory" resultType= "com.logpm.distribution.vo.DistrilbutionBillLadingAppVO" >
select ldbl.id ,lddd.stock_list_id stockListId,lddd.quantity,ldsl.description_goods descriptionGoods,ldsl.cargo_unit cargoUnit,ldsl.sku,(
select count(1)
from logpm_distribution_stock lds
where lds.bill_lading_id = #{param.id} and lds.is_deleted = 0
select ldbl.id ,lddd.stock_list_id stockListId,lddd.quantity,ldsl.description_goods
descriptionGoods,ldsl.cargo_unit cargoUnit,ldsl.sku,(
select count(1)
from logpm_distribution_stock lds
where lds.bill_lading_id = #{param.id} and lds.is_deleted = 0
) deliveryNum ,lbm.packing_specification packingSpecification
from logpm_distrilbution_bill_lading ldbl
LEFT JOIN logpm_distribution_delivery_details lddd on ldbl.id = lddd.bill_lading_id
LEFT JOIN logpm_distribution_stock_list ldsl on ldsl.id = lddd.stock_list_id
LEFT JOIN logpm_basicdata_material lbm on lbm.id = ldsl.material_id
LEFT JOIN logpm_distribution_delivery_details lddd on ldbl.id = lddd.bill_lading_id
LEFT JOIN logpm_distribution_stock_list ldsl on ldsl.id = lddd.stock_list_id
LEFT JOIN logpm_basicdata_material lbm on lbm.id = ldsl.material_id
<where >
ldbl.id = #{param.id} and lddd.is_deleted = '0'
ldbl.id = #{param.id} and lddd.is_deleted = '0'
</where>
</select>
<select id= "getBillLadingNum" resultType= "com.logpm.distribution.vo.DistrilbutionBillLadingVO" >
select DISTINCT (select count(conditions)
from logpm_distrilbution_bill_lading
<where >
conditions IN (10) and is_deleted = '0'
<if test= "param.startDate != null" > and pick_up_time between #{param.startDate} and #{param.entDate}</if>
<if test= "param.startDate == null" > and DATE(pick_up_time) = CURDATE() </if>
</where> ) treatNum,
(select count(conditions)
from logpm_distrilbution_bill_lading
<where >
conditions IN (20) and is_deleted = '0'
conditions IN (10) and is_deleted = '0'
<if test= "param.startDate != null" > and pick_up_time between #{param.startDate} and #{param.entDate}</if>
<if test= "param.startDate == null" > and DATE(pick_up_time) = CURDATE()</if>
</where>
) treatNum,
(select count(conditions)
from logpm_distrilbution_bill_lading
<where >
conditions IN (20) and is_deleted = '0'
<if test= "param.startDate != null" > and pick_up_time between #{param.startDate} and #{param.entDate}</if>
<if test= "param.startDate == null" > and DATE(pick_up_time) = CURDATE() </if>
</where> ) stopNum
<if test= "param.startDate == null" > and DATE(pick_up_time) = CURDATE()</if>
</where>
) stopNum
from logpm_distrilbution_bill_lading
<where >
is_deleted = '0'
<if test= "param.startDate != null" > and pick_up_time between #{param.startDate} and #{param.entDate}</if>
<if test= "param.startDate == null" > and DATE(pick_up_time) = CURDATE() </if>
<if test= "param.startDate == null" > and DATE(pick_up_time) = CURDATE()</if>
</where>
</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 waybill Number,
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.customer_name)) AS customerName,
GROUP_CONCAT(DISTINCT ANY_VALUE(ldsa.customer_telephone)) AS customerTelephone
FROM logpm_distrilbution_bill_lading ldbl
LEFT JOIN logpm_distrilbution_bill_stock ldbs ON ldbl.id = ldbs.bill_lading_ id
LEFT JOIN logpm_distribution_stock_article ldsa ON ldbs.stock_article_id = ldsa.id
WHERE ldbl.id = #{id} GROUP BY ldbl.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 service Number,
GROUP_CONCAT(DISTINCT ANY_VALUE(ldsa.consignee_unit)) AS consigneeUnit ,
GROUP_CONCAT(DISTINCT ANY_VALUE(ldsa.customer_name)) AS customerName ,
GROUP_CONCAT(DISTINCT ANY_VALUE(ldsa.customer_telephone)) AS customerTelephone
FROM logpm_distrilbution_bill_lading ldbl
LEFT JOIN logpm_distrilbution_bill_stock ldbs ON ldbl.id = ldbs.bill_lading_id
LEFT JOIN logpm_distribution_stock_article ldsa ON ldbs.stock_article_id = ldsa. id
WHERE ldbl.id = #{id}
GROUP BY ldbl.id;
</select>
<select id= "selectBillStockList" resultType= "com.logpm.distribution.vo.DistrilbutionBillLadingVO" >
SELECT
dbl.id,
dsa.service_number serviceNumber,
dsa.waybill_number waybillNumber,
dsa.consignee_unit consigneeUnit,
dsa.customer_name customerName,
dsa.customer_telephone customerTelephone,
dsa.warehouse,
dsa.warehouse_entry_time warehouseEntryTime,
dsa.storage_fee storageFee,
dsa.total_number totalNumber,
dbl.certificate_type certificateType,
dsa.brand,
dsa.type_service typeService,
dbl.pick_up_time pickUpTime,
dbl.consignee,
dbl.delivery_document deliveryDocument,
dbl.conditions,
dbl.notification_status,
dbl.total_cost totalCost,
dbl.pick_up_plate pickUpPlate,
dbl.pickup_batch pickupBatch
FROM
logpm_distrilbution_bill_lading dbl
LEFT JOIN logpm_distribution_stock_article dsa ON dbl.stock_article_id = dsa.id
LEFT JOIN logpm_distribution_stockup_info ldsi on dbl.id = ldsi.reservation_id and ldsi.stock_up_type=#{distrilbutionBillLading.stockupType}
where ldsi.stockup_id=#{distrilbutionBillLading.id};
SELECT dbl.id,
dsa.service_number serviceNumber,
dsa.waybill_number waybillNumber,
dsa.consignee_unit consigneeUnit,
dsa.customer_name customerName,
dsa.customer_telephone customerTelephone,
dsa.warehouse,
dsa.warehouse_entry_time warehouseEntryTime,
dsa.storage_fee storageFee,
dsa.total_number totalNumber,
dbl.certificate_type certificateType,
dsa.brand,
dsa.type_service typeService,
dbl.pick_up_time pickUpTime,
dbl.consignee,
dbl.delivery_document deliveryDocument,
dbl.conditions,
dbl.notification_status,
dbl.total_cost totalCost,
dbl.pick_up_plate pickUpPlate,
dbl.pickup_batch pickupBatch
FROM logpm_distrilbution_bill_lading dbl
LEFT JOIN logpm_distribution_stock_article dsa ON dbl.stock_article_id = dsa.id
LEFT JOIN logpm_distribution_stockup_info ldsi on dbl.id = ldsi.reservation_id and
ldsi.stock_up_type = #{distrilbutionBillLading.stockupType}
where ldsi.stockup_id = #{distrilbutionBillLading.id};
</select>
</mapper>