<?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.StockJournalMapper">
    <select id="getPage" resultType="com.fjhx.wms.entity.stock.vo.StockJournalVo">
        SELECT sj.id,
               sj.type,
               sj.op_type,
               sj.`code`,
               sj.warehouse_id,
               w.`name`     warehouseName,
               sj.create_user,
               sj.create_time,
               sj.update_user,
               sj.update_time,
               sj.prod_order_id,
               sj.borrow_id,
               sj.expect_restitution_time,
               sj.restitution_id,
               sj.restitution_time,
               sj.lose_id,
               sj.seek_id,
               po.`code` AS prodOrderCode,
               sj.ex_warehouse_person,
               sj.remarks
        FROM stock_journal sj
                 JOIN warehouse w ON sj.warehouse_id = w.id
                 LEFT JOIN production_order po ON sj.prod_order_id = po.id
            ${ew.customSqlSegment}
    </select>

</mapper>
