left join logpm_trunkline_cars_load ltcl on ltcl.id = ltlso.load_id
LEFT JOIN logpm_trunkline_cars_order ltco on ltco.sign_order_id = ltlso.id
<where>
and (ltlso.warehouse_id = #{param.warehouseId} or ltlso.final_node_id = #{param.warehouseId} or ltlso.driver_user_id = #{param.userId} or ltlso.assistant_user_id = #{param.userId})
and (ltlso.warehouse_id = #{param.warehouseId} or ltlso.final_node_id = #{param.warehouseId} or
ltlso.driver_user_id = #{param.userId} or ltlso.assistant_user_id = #{param.userId})
<iftest="param.loadId != null">
and ltlso.load_id = #{param.loadId}
@ -100,11 +101,42 @@
ltcls.unload_time unloadTime,
ltco.sign_order_id signOrderId
from logpm_trunkline_cars_order ltco
left join logpm_trunkline_cars_load_scan ltcls on ltco.load_id = ltcls.load_id and ltco.node_id = ltcls.warehouse_id and ltcls.order_code = ltco.order_code and ltcls.waybill_no = ltco.waybill_no
left join logpm_distribution_stock_article ldsa on ldsa.order_code = ltco.order_code and ldsa.warehouse_id = ltco.node_id
left join logpm_trunkline_cars_load_scan ltcls on ltco.load_id = ltcls.load_id and ltco.node_id =
ltcls.warehouse_id and ltcls.order_code = ltco.order_code and ltcls.waybill_no = ltco.waybill_no
left join logpm_distribution_stock_article ldsa on ldsa.order_code = ltco.order_code and ldsa.warehouse_id =
ltco.node_id
where ltco.sign_order_id = #{param.signOrderId}
and ltco.is_customer = '1'
and ltcls.id is not null
<iftest="param.mallName != null and param.mallName !='' ">
and ldsa.mall_name like concat('%',#{param.mallName},'%')
</if>
<iftest="param.scanCode != null and param.scanCode != '' ">
and ltcls.scan_code = #{param.scanCode}
</if>
<iftest="param.waybillNo != null and param.waybillNo != '' ">
and ltcls.waybill_no = #{param.waybillNo}
</if>
<iftest="param.orderCode != null and param.orderCode != '' ">
and ltco.order_code = #{param.orderCode}
</if>
<iftest="param.carsNo != null and param.carsNo != '' ">
and ltcls.load_code = #{param.carsNo}
</if>
<iftest="param.mallPerson != null and param.mallPerson != '' ">
and ldsa.consignee_person = #{param.mallPerson}
</if>
<iftest="param.mallMobile != null and param.mallMobile != '' ">