<?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.prolog.cs.biz.outbound.dao.MoveTaskMapper">

    <update id="instore">
        update WMS_MOVE_TASK set status = #{status},
        GMT_MODIFIED = SYSDATE,
        MODIFIER = #{opUserId},
        MODIFIER_NAME = #{opUserName},
        <choose>
            <when test='status =="1"'>
                INSTORE_WORKER_NAME = #{opUserName}
            </when>
            <otherwise>
                OUTSTORE_WORKER_NAME = #{opUserName}
            </otherwise>
        </choose>
        <where>
            detail_id IN
            <foreach item="item" index="index" collection="detailIds" open="(" close=")" separator=",">
                #{item}
            </foreach>
        </where>
    </update>

    <select id="getList" resultType="com.prolog.cs.biz.outbound.model.entity.MoveTaskDO">
        select * from WMS_MOVE_TASK
        where detail_id IN
        <foreach item="item" index="index" collection="detailIds" open="(" close=")" separator=",">
            #{item}
        </foreach>
    </select>

    <select id="getPickModel" resultType="java.lang.String">
        SELECT PICK_MODEL from WMS_WAVE_STORAGE where warehouse_area_code=#{whAreaCode} and warehouse_id =#{warehouseId} and ROWNUM=1
    </select>
</mapper>