<?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.inbound.dao.EisToWmsMiddleMapper">

	<select id="findNofinshList" resultType ="com.prolog.cs.biz.inbound.model.EisToWmsMiddle">
		SELECT warehouse_id AS warehouseId,
			owner_id as ownerId,
			task_id as taskId,
			seq_no as seqNo,
			work_type as workType,
			business_type as businessType,
			item_id as itemId,
			qty,
			lot_id as lotId,
			container_no as containerNo,
			wmslocation_code as wmslocationCode,
			msg_id as msgId,
			processing_status as processingStatus,
			pack_id as packId,
			container_type as containerType
		from eis_to_wms_middle
		where
		convert(processing_status,
		SIGNED) &lt; 100
	</select>

	<select id="checkMsgIdExits" resultType="java.lang.String">
		SELECT
		seq_no
		FROM
		eis_to_wms_middle
		WHERE
		1=1
		and seq_no in
		<foreach collection="msgIds" item="msgId" open="("
			separator="," close=")">
			#{msgId}
		</foreach>
	</select>
	<update id="updateProcessingStatus">
		update eis_to_wms_middle set `processing_status` =CONVERT
		(processing_status, SIGNED) + 1
		where seq_no in
		<foreach collection="msgIds" item="msgId" open="("
			separator="," close=")">
			#{msgId}
		</foreach>
	</update>
	<update id="updateProcessingFinshStatus">
		update eis_to_wms_middle set `processing_status` ='100'
		<if test="msgIds!=null and msgIds.size()>0">
			<where>
                seq_no in
				<foreach collection="msgIds" item="msgId" open="("
						 separator="," close=")">
					#{msgId}
				</foreach>
			</where>
		</if>

	</update>
</mapper>
