<?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.stock.StockJournalMapper">

    <select id="getPage" resultType="com.fjhx.entity.stock.StockJournal">
        SELECT
            t1.id,
            t1.type,
            t1.details_type,
            t1.goods_id,
            t1.warehouse_id,
            t1.change_quantity,
            t1.actual_quantity,
            t1.is_in_stock,
            t1.remarks,
            t1.create_user,
            t1.create_time,
            t2.`type` goodsType,
            t2.`name` goodsName,
            t2.`unit` goodsUnit,
            t3.logistics_info_code,
            t4.`name` warehouseName
        FROM
            stock_journal t1
            LEFT JOIN product_info t2 ON t1.goods_id = t2.id
            LEFT JOIN logistics_details t3 ON t1.business_id = t3.id
            LEFT JOIN warehouse t4 on t1.warehouse_id = t4.id
        ${ew.customSqlSegment}
    </select>
</mapper>
