<iftest="param.reservationId != null and param.reservationId != ''"> and ldrs.reservation_id = #{param.reservationId } </if>
<iftest="param. != null and param. != ''"> and = #{param. } </if>
<iftest="param. != null and param. != ''"> and = #{param. } </if>
<iftest="param. != null and param. != ''"> and = #{param. } </if>
<iftest="param. != null and param. != ''"> and = #{param. } </if>
<iftest="param. != null and param. != ''"> and = #{param. } </if>
<iftest="param. != null and param. != ''"> and = #{param. } </if>
<iftest="param. != null and param. != ''"> and = #{param. } </if>
<iftest="param.waybillNumber != null and param.waybillNumber != ''"> and ldpl.waybill_number like concat('%',#{param.waybillNumber },'%') </if>
<iftest="param.serviceNumber != null and param.serviceNumber != ''"> and ldpl.service_number like concat('%', #{param.serviceNumber },'%') </if>
<iftest="param.orderCode != null and param.orderCode != ''"> and ldpl.order_code like concat('%', #{param.orderCode },'%') </if>
<iftest="param.warehouseName != null and param.warehouseName != ''"> and ldr.warehouse_name like concat('%', #{param.warehouseName },'%') </if>
<iftest="param.orderPackageCode != null and param.orderPackageCode != ''"> and ldpl.order_package_code like concat('%', #{param.orderPackageCode },'%') </if>
<iftest="param.sendWarehouseName != null and param.sendWarehouseName != ''"> and ldpl.send_warehouse_name like concat('%', #{param.sendWarehouseName },'%') </if>
<iftest="param.acceptWarehouseName != null and param.acceptWarehouseName != ''"> and ldpl.accept_warehouse_name like concat('%', #{param.acceptWarehouseName },'%') </if>
<iftest="param.reservationDate != null "> and date_format(ldr.reservation_date,'%Y-%m-%d') = #{param.reservationDate} </if>
<iftest="param.trainNumber != null and param.trainNumber != ''"> and ldpl.train_number like concat('%', #{param.trainNumber },'%') </if>
<iftest="param.firsts != null and param.firsts != ''"> and ldpl.firsts like concat('%', #{param.firsts },'%') </if>
<iftest="param.second != null and param.second != ''"> and ldpl.second like concat('%', #{param.second } ,'%')</if>
<iftest="param.thirdProduct != null and param.thirdProduct != ''"> and ldpl.third_product like concat('%', #{param.thirdProduct } ,'%')</if>
<iftest="param.materialName != null and param.materialName != ''"> and ldpl.material_name like concat('%', #{param.materialName },'%') </if>
<iftest="param.trayCode != null and param.trayCode != ''"> and lwtg.tray_code like concat('%',#{param.trayCode },'%') </if>
<iftest="param.positionCode != null and param.positionCode != ''"> and lwug.position_code like concat('%', #{param.positionCode } ,'%')</if>
<iftest="param.reservationId != null and param.reservationId != ''"> and ldrs.reservation_id = #{param.reservationId } </if>
<iftest="param. != null and param. != ''"> and = #{param. } </if>
<iftest="param. != null and param. != ''"> and = #{param. } </if>
<iftest="param. != null and param. != ''"> and = #{param. } </if>
<iftest="param. != null and param. != ''"> and = #{param. } </if>
<iftest="param. != null and param. != ''"> and = #{param. } </if>
<iftest="param. != null and param. != ''"> and = #{param. } </if>
<iftest="param. != null and param. != ''"> and = #{param. } </if>
<iftest="param. != null and param. != ''"> and = #{param. } </if>
<iftest="param.waybillNumber != null and param.waybillNumber != ''"> and ldsa.waybill_number like concat('%',#{param.waybillNumber },'%') </if>
<iftest="param.orderCode != null and param.orderCode != ''"> and ldsa.order_code like concat('%', #{param.orderCode },'%') </if>
<iftest="param.mallName != null and param.mallName != ''"> and ldsa.mall_name like concat('%', #{param.mallName },'%') </if>
<iftest="param.storeName != null and param.storeName != ''"> and ldsa.store_name like concat('%', #{param.storeName },'%') </if>
<iftest="param.descriptionGoods != null and param.descriptionGoods != ''"> and ldsa.description_goods like concat('%', #{param.descriptionGoods },'%') </if>
<iftest="param.brand != null and param.brand != ''"> and ldsa.brand like concat('%', #{param.brand },'%') </if>
<iftest="param.consigneeUnit != null and param.consigneeUnit != ''"> and ldsa.consignee_unit like concat('%', #{param.consigneeUnit },'%') </if>
<iftest="param.resource != null and param.resource != ''"> and ldsa.resource like concat('%',#{param.resource },'%') </if>
<iftest="param.deliveryType != null and param.deliveryType != ''"> and ldr.delivery_type = #{param.deliveryType} </if>
from logpm_distribution_reservation_stocklist ldrs
LEFT JOIN logpm_distribution_reservation ldr on ldr.id = ldrs.reservation_id
LEFT JOIN logpm_distribution_stock_list ldsl on ldsl.id = ldrs.stocklist_id
LEFT JOIN logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldsl.material_id and lwtg.incoming_batch = ldsl.incoming_batch and lwtg.market_id = ldsl.market_id
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldsl.material_id and lwug.incoming_batch = ldsl.incoming_batch and lwug.market_id = ldsl.market_id
LEFT JOIN logpm_distribution_stockup_info ldsi on ldsi.reservation_id = ldrs.reservation_id
LEFT JOIN logpm_distribution_stockup lds on lds.id = ldsi.stockup_id
<where>
<iftest="param.incomingBatch != null and param.incomingBatch !=''"> and ldsl.incoming_batch like concat('%', #{param.incomingBatch },'%')</if>
<iftest="param.sku != null and param.sku !=''"> and ldsl.sku like concat('%', #{param.sku },'%')</if>
<iftest="param.marketName != null and param.marketName !=''"> and ldsl.market_name like concat('%', #{param.marketName },'%')</if>
<iftest="param.cargoNumber != null and param.cargoNumber !=''"> and ldsl.cargo_number like concat('%', #{param.cargoNumber },'%')</if>
<iftest="param.cargoUnit != null and param.cargoUnit !=''"> and ldsl.cargo_unit like concat('%', #{param.cargoUnit },'%')</if>
<iftest="param.descriptionGoods != null and param.descriptionGoods !=''"> and ldsl.description_goods like concat('%', #{param.descriptionGoods },'%')</if>
<iftest="param.brandName != null and param.brandName !=''"> and ldsl.brand_name like concat('%', #{param.brandName },'%')</if>
<iftest="param.trayCode != null and param.trayCode !=''"> and lwtg.tray_code like concat('%', #{param.trayCode },'%')</if>
<iftest="param.positionCode != null and param.positionCode !=''"> and lwug.position_code like concat('%', #{param.positionCode },'%')</if>
<iftest="param.stockupArea != null and param.stockupArea !=''"> and lds.stockup_area like concat('%', #{param.stockupArea },'%')</if>
<iftest="param.orderCode != null and param.orderCode !=''"> and ldsl.incoming_batch like concat('%', #{param.orderCode },'%')</if>