<?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.wms.mapper.stock.StockJournalDetailsMapper">
    <select id="getPage" resultType="com.fjhx.wms.entity.stock.vo.StockJournalDetailsVo">
        SELECT
            sjd.id,
            sj.id stockJournalId,
            sj.op_type,
            sj.type,
            sj.`code`,
            sj.warehouse_id,
            w.`name` warehouseName,
            sjd.product_id,
            sjd.quantity,
            sjd.create_time,
            sjd.create_user,
            sj.business_id
        FROM
            stock_journal sj
                JOIN stock_journal_details sjd ON sjd.stock_journal_id = sj.id
                JOIN warehouse w ON sj.warehouse_id = w.id
            ${ew.customSqlSegment}
    </select>
    <select id="getStockWaitInfo" resultType="com.fjhx.wms.entity.stock.vo.StockWaitVo">
        SELECT
            qi.id,
            sw.business_code
        FROM
            bytesailing_victoriatourist.quality_info qi
                JOIN arrival_stock_records asr ON asr.id = qi.bussiness_id
                JOIN stock_wait sw ON asr.stock_wait_id = sw.id
            ${ew.customSqlSegment}
    </select>

</mapper>
