<?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.ManualStockMapper">
    <sql id="list">
        select ms.id,
               ms.code,
               ms.status,
               ms.company_id,
               ms.warehouse_id,
               ms.op_type,
               ms.type,
               ms.flow_id,
               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,
               po.`code` AS prodOrderCode
        from manual_stock ms
                 LEFT JOIN production_order po ON ms.prod_order_id = po.id
    </sql>

    <select id="getPage" resultType="com.fjhx.wms.entity.manual.vo.ManualStockVo">
        <include refid="list"/>
        ${ew.customSqlSegment}
    </select>
    <select id="detail" resultType="com.fjhx.wms.entity.manual.vo.ManualStockVo">
        <include refid="list"/>
        where ms.id = #{id}
    </select>

</mapper>
