<?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.StockSnapshotDetailsMapper">
    <select id="getPage" resultType="com.fjhx.wms.entity.stock.vo.StockSnapshotDetailsVo">
        SELECT ssd.id,
               ssd.snapshot_id,
               ssd.warehouse_id,
               ssd.product_id,
               ssd.quantity,
               ssd.out_quantity,
               ssd.company_id,
               ssd.create_user,
               ssd.create_time,
               ssd.update_user,
               ssd.update_time,
               ssd.stock_id,
               pi.`code`              AS productCode,
               pi.unit                AS productUnit,
               pi.type                AS productType,
               pi.`name`              AS productName,
               pi.spec                AS productSpec,
               pi.product_classify_id AS productClassifyId,
               pi.definition          AS productDefinition,
               pi.custom_code         AS productCustomCode,
               pi.length              AS productLength,
               pi.width               AS productWidth,
               pi.height              AS productHeight,
               wa.`name`              AS warehouseName
        FROM stock_snapshot_details ssd
                 LEFT JOIN product_info pi ON ssd.product_id = pi.id
                 LEFT JOIN warehouse wa ON ssd.warehouse_id = wa.id
            ${ew.customSqlSegment}
    </select>

</mapper>
