<?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.manual.ManualStockDetailsMapper">
    <select id="getPage" resultType="com.fjhx.wms.entity.manual.vo.ManualStockDetailsVo">
        SELECT msd.id,
               msd.manual_stock_id,
               msd.product_id,
               msd.quantity,
               ms.`code`,
               ms.`status`,
               ms.company_id,
               ms.warehouse_id,
               ms.op_type,
               ms.type,
               ms.ex_warehouse_person,
               ms.remarks,
               ms.borrow_id,
               ms.restitution_time,
               ms.expect_restitution_time,
               ms.lose_id,
               ms.prod_order_id,
               ms.create_user,
               ms.create_time,
               ms.update_user,
               ms.update_time,
               pi.`name`      AS productName,
               pi.custom_code AS productCode
        FROM manual_stock_details msd
                 JOIN manual_stock ms ON msd.manual_stock_id = ms.id
                 LEFT JOIN product_info pi ON msd.product_id = pi.id
            ${ew.customSqlSegment}
    </select>
</mapper>
