<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="com.prolog.cs.biz.outbound.dao.FaceOrderMapper">

    <select id="queryFaceItem" resultType="com.prolog.cs.biz.outbound.model.dto.FaceOrderItemDTO">
        select
        t1.bill_no as billNo,
        t1.waybill_code as waybillCode,
        t1.parent_waybill_code as parentWaybillCode,
        t1.pro_code as proCode,
        t1.dest_dept_code_mapping as destDeptCodeMapping,
        t1.sender_name as senderName,
        t1.sender_mobile as senderMobile,
        t1.sender_address as senderAddress,
        t1.receiver_name as receiverName,
        t1.receiver_mobile as receiverMobile,
        t1.receiver_address as receiverAddress,
        t1.qr_code as qrCode,
        t1.position as position,
        t1.position_no as positionNo,
        t1.tp_status as tpStatus,
        t1.inner_province_name as innerProvinceName,
        t1.package_wdjc as packageWdjc,
        t1.package_code as packageCode,
        t1.jd_info as jdInfo,
        t1.source_sort_center_name as sourceSortCenterName,
        t1.target_sort_center_name as targetSortCenterName,
        t1.`source_cross_code-source_tabletrolley_code` as sourceCrossCodeSourceTabletrolleyCode,
        t1.`target_cross_code-source_tabletrolley_code` as targetCrossCodeSourceTabletrolleyCode,
        t1.pre_sort_site_name as preSortSiteName,
        t1.road_code as roadCode,
        t1.transport_mode as transportMode,
        t1.transport_type as transportType,
        t1.fresh_type as freshType,
        t1.remark,
        t1.group,
        t5.item_qty as itemQty,
        t5.itemcode as itemCode,
        t5.itemname as itemName,
        t5.item_pcs as itemPcs,
        t5.item_weight as itemWeight,
        t5.item_volume as itemVolume,
        t5.batch_no as batchNo
        from wms_face_order t1
        left join wms_barcode_h t2 on t1.waybill_code = t2.barcode
        left join wms_barcode_d t3 on t2.id = t3.barcode_id
        left join wms_pick_task_d t4 on t3.wms_pick_task_d_id = t4.pick_task_d_id
        left join oms_do_bill_d t5 on t5.lineid = t4.src_line_id
        <where>
            t1.waybill_code IN
            <foreach item="item" index="index" collection="waybillCodes" open="(" close=")" separator=",">
                #{item}
            </foreach>
        </where>
    </select>


</mapper>