<?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.njzscloud.dispose.wh.mapper.OutOrderMapper">
    <sql id="searchOutOrder">
        SELECT woo.id,
               woo.sn,
               woo.responsible_id,
               su.nickname,
               woo.warehouse_id,
               ww.warehouse_name,
               woo.location,
               woo.out_time,
               woo.order_id,
               woo.order_sn,
               woo.goods_category_id,
               woo.goods_category_name,
               woo.goods_id,
               woo.goods_name,
               woo.good_sn,
               woo.quantity,
               woo.unit,
               woo.memo,
               woo.creator_id,
               woo.modifier_id,
               woo.create_time,
               woo.modify_time
        FROM wh_out_order woo
        LEFT JOIN sys_user su ON su.id = woo.responsible_id
        LEFT JOIN wh_warehouse ww ON ww.id = woo.warehouse_id
    </sql>

    <resultMap id="searchOutOrderResultMap" autoMapping="true" type="com.njzscloud.dispose.wh.pojo.result.SearchOutOrderResult">
    </resultMap>

    <select id="paging" resultMap="searchOutOrderResultMap">
        <include refid="searchOutOrder"/>
        <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
            ${ew.customSqlSegment}
        </if>
    </select>

    <select id="detail" resultMap="searchOutOrderResultMap">
        <include refid="searchOutOrder"/>
        WHERE woo.id = #{id}
    </select>
</mapper>
