LEFT JOIN logpm_distribution_stock_article dsa on dbl.stock_article_id = dsa.id
where dbl.is_deleted = 0
LEFT JOIN logpm_distribution_stock_article dsa on dbl.stock_article_id = dsa.id
<where>
dbl.is_deleted = 0
<iftest="param.serviceNumber != null and param.serviceNumber != ''"> and dsa.service_number like concat('%',#{param.serviceNumber},'%')</if>
<iftest="param.pickupBatch != null and param.pickupBatch != ''"> and dbl.pickup_batch like concat('%',#{param.pickupBatch},'%')</if>
<iftest="param.waybillNumber != null and param.waybillNumber != ''">and dsa.waybill_number like concat('%',#{param.waybillNumber},'%')</if>
<iftest="param.consigneeUnit != null and param.consigneeUnit != ''">and dsa.consignee_unit like concat('%',#{param.consigneeUnit},'%')</if>
<iftest="param.customerName != null and param.customerName != ''">and dsa.customer_name like concat('%',#{param.customerName},'%')</if>
<iftest="param.customerTelephone != null and param.customerTelephone != ''">and dsa.customer_telephone like concat('%',#{param.customerTelephone},'%')</if>
<iftest="param.warehouse != null and param.warehouse != ''">and dsa.warehouse like concat('%',#{param.warehouse},'%')</if>
<iftest="param.brand != null and param.brand != ''">and dsa.brand like concat('%',#{param.brand},'%')</if>
<iftest="param.typeService != null and param.typeService != ''">and dsa.type_service = #{param.typeService},=</if>
<iftest="param.productInformation != null and param.productInformation != ''">and dsa.product_information like concat('%',#{param.productInformation},'%')</if>
<iftest="param.pickupPhone != null and param.pickupPhone != ''">and dbl.pickup_phone concat('%',#{param.pickupPhone},'%')</if>
<iftest="param.consignee != null and param.consignee != ''">and dbl.consignee like concat('%',#{param.consignee},'%')</if>
<iftest="param.pickUpPlate != null and param.pickUpPlate != ''">and dbl.pick_up_late like concat('%',#{param.pickUpPlate},'%')</if>
<iftest="param.deliveryDocument != null and param.deliveryDocument != ''">and dbl.delivery_document like concat('%',#{param.deliveryDocument},'%')</if>
<iftest="param.certificateType != null and param.certificateType != ''">and dbl.certificate_type = #{param.certificateType},</if>