<?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.PickUpRecordMapper">
	<resultMap id="map" type="com.prolog.cs.biz.outbound.model.PickUpRecord">
		<result column="id" property="id"/>
		<result column="shipper_name" property="shipperName"/>
		<result column="shipper_card" property="shipperCard"/>
		<result column="pick_up_date" property="pickUpDate"/>
		<result column="photo_id" property="photoId"/>
		<result column="src_code" property="srcCode"/>
		<result column="remarks" property="remarks"/>
		<result column="status" property="status"/>
		<result column="creator" property="creator"/>
		<result column="creator_name" property="creatorName"/>
		<result column="gmt_create" property="gmtCreate"/>
		<result column="modifier" property="modifier"/>
		<result column="modifier_name" property="modifierName"/>
		<result column="gmt_modified" property="gmtModified"/>
		<result column="bldg_id" property="bldgId"/>
		<result column="bldg_name" property="bldgName"/>
		<result column="warehouse_id" property="warehouseId"/>
		<result column="enterprise_id" property="enterpriseId"/>
	</resultMap>

	<select id="getPickUpRecordList" resultMap="map">
		select * from wms_pick_up_record where enterprise_id = #{enterpriseId} and warehouse_id= #{warehouseId} and bldg_id =#{bldgId}
		<if test="shipperName != null and shipperName != ''">
			and shipper_name like concat(concat('%',#{shipperName}),'%')
		</if>
		<if test="srcCode != null and srcCode != ''">
			and src_code like concat(concat('%',#{srcCode}),'%')
		</if>
		<if test="startDate != null and startDate != ''">
			and gmt_create >= to_date(#{startDate},'yyyy-mm-dd hh24:mi:ss')
		</if>
		<if test="endDate != null and endDate != ''">
			and gmt_create &lt;= to_date(#{endDate},'yyyy-mm-dd hh24:mi:ss')
		</if>
		<if test="srcCode != null and srcCode != ''">
			and src_code like concat(concat('%',#{srcCode}),'%')
		</if>
	</select>
</mapper>
