<?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.fjhx.mapper.logistics.LogisticsInfoMapper">

    <!-- 采购入库列表 -->
    <select id="getPurchaseInStockPage" resultType="com.fjhx.entity.logistics.LogisticsInfo">
        SELECT
            t1.id,
            t1.business_id,
            t1.`code`,
            t1.in_stock_status,
            t1.logistics_company_code,
            t1.logistics_status,
            t2.`code` purchaseCode,
            t2.create_user,
            t2.create_time,
	        t3.id supplierId,
	        t3.`name` supplierName,
	        t4.`name` logisticsCompanyName
        FROM
            logistics_info t1
            LEFT JOIN purchase t2 ON t1.business_id = t2.id
            LEFT JOIN supplier t3 ON t2.supplier_id = t3.id
	        LEFT JOIN logistics_company t4 ON t1.logistics_company_code = t4.`code`
        ${ew.customSqlSegment}
    </select>

</mapper>
