You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

320 lines
21 KiB
XML

<?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.hw.wms.mapper.WmsBaseLocationMapper">
<resultMap type="WmsBaseLocation" id="WmsBaseLocationResult">
<result property="locationId" column="location_id" />
<result property="warehouseId" column="warehouse_id" />
<result property="locationCode" column="location_code" />
<result property="locRow" column="loc_row" />
<result property="layerNum" column="layer_num" />
<result property="locColumn" column="loc_column" />
<result property="activeFlag" column="active_flag" />
<result property="materialTypeId" column="material_type_id" />
<result property="qtyLimit" column="qty_limit" />
<result property="instockFlag" column="instock_flag" />
<result property="outstockFlag" column="outstock_flag" />
<result property="locationStatus" column="location_status" />
<result property="batchMix" column="batch_mix" />
<result property="xCoordinate" column="x_coordinate" />
<result property="yCoordinate" column="y_coordinate" />
<result property="zCoordinate" column="z_coordinate" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="delFlag" column="del_flag" />
<result property="shelfOrder" column="shelf_order" />
<result property="checkOrder" column="check_order" />
<result property="pickOrder" column="pick_order" />
<result property="pickFlag" column="pick_flag" />
<result property="isOpenKnFlag" column="is_open_kn_flag" />
<result property="locationScrapType" column="location_scrap_type" />
<result property="locationAttr" column="location_attr" />
<result property="turnDemand" column="turn_demand" />
<result property="checkCode" column="check_code" />
<result property="workArea" column="work_area" />
<result property="volumeLimit" column="volume_limit" />
<result property="weightLimit" column="weight_limit" />
<result property="boxLimit" column="box_limit" />
<result property="palletLimit" column="pallet_limit" />
<result property="length" column="length" />
<result property="width" column="width" />
<result property="height" column="height" />
<result property="xPixels" column="x_pixels" />
<result property="yPixels" column="y_pixels" />
<result property="zPixels" column="z_pixels" />
<result property="bord" column="bord" />
<result property="productMix" column="product_mix" />
</resultMap>
<sql id="selectWmsBaseLocationVo">
select location_id, warehouse_id, location_code, loc_row, layer_num, loc_column, active_flag, material_type_id, qty_limit, instock_flag, outstock_flag, location_status, batch_mix, x_coordinate, y_coordinate, z_coordinate, create_by, create_time, update_by, update_time, remark, del_flag, shelf_order, check_order, pick_order, pick_flag, is_open_kn_flag, location_scrap_type, location_attr, turn_demand, check_code, work_area, volume_limit, weight_limit, box_limit, pallet_limit, length, width, height, x_pixels, y_pixels, z_pixels, bord, product_mix from wms_base_location
</sql>
<select id="selectWmsBaseLocationList" parameterType="WmsBaseLocation" resultMap="WmsBaseLocationResult">
<include refid="selectWmsBaseLocationVo"/>
<where>
<if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
<if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if>
<if test="locRow != null "> and loc_row = #{locRow}</if>
<if test="layerNum != null "> and layer_num = #{layerNum}</if>
<if test="locColumn != null "> and loc_column = #{locColumn}</if>
<if test="activeFlag != null and activeFlag != ''"> and active_flag = #{activeFlag}</if>
<if test="materialTypeId != null "> and material_type_id = #{materialTypeId}</if>
<if test="qtyLimit != null "> and qty_limit = #{qtyLimit}</if>
<if test="instockFlag != null and instockFlag != ''"> and instock_flag = #{instockFlag}</if>
<if test="outstockFlag != null and outstockFlag != ''"> and outstock_flag = #{outstockFlag}</if>
<if test="locationStatus != null and locationStatus != ''"> and location_status = #{locationStatus}</if>
<if test="batchMix != null and batchMix != ''"> and batch_mix = #{batchMix}</if>
<if test="xCoordinate != null "> and x_coordinate = #{xCoordinate}</if>
<if test="yCoordinate != null "> and y_coordinate = #{yCoordinate}</if>
<if test="zCoordinate != null "> and z_coordinate = #{zCoordinate}</if>
<if test="shelfOrder != null and shelfOrder != ''"> and shelf_order = #{shelfOrder}</if>
<if test="checkOrder != null and checkOrder != ''"> and check_order = #{checkOrder}</if>
<if test="pickOrder != null and pickOrder != ''"> and pick_order = #{pickOrder}</if>
<if test="pickFlag != null and pickFlag != ''"> and pick_flag = #{pickFlag}</if>
<if test="isOpenKnFlag != null and isOpenKnFlag != ''"> and is_open_kn_flag = #{isOpenKnFlag}</if>
<if test="locationScrapType != null and locationScrapType != ''"> and location_scrap_type = #{locationScrapType}</if>
<if test="locationAttr != null and locationAttr != ''"> and location_attr = #{locationAttr}</if>
<if test="turnDemand != null and turnDemand != ''"> and turn_demand = #{turnDemand}</if>
<if test="checkCode != null and checkCode != ''"> and check_code = #{checkCode}</if>
<if test="workArea != null and workArea != ''"> and work_area = #{workArea}</if>
<if test="volumeLimit != null "> and volume_limit = #{volumeLimit}</if>
<if test="weightLimit != null "> and weight_limit = #{weightLimit}</if>
<if test="boxLimit != null "> and box_limit = #{boxLimit}</if>
<if test="palletLimit != null "> and pallet_limit = #{palletLimit}</if>
<if test="length != null "> and length = #{length}</if>
<if test="width != null "> and width = #{width}</if>
<if test="height != null "> and height = #{height}</if>
<if test="xPixels != null "> and x_pixels = #{xPixels}</if>
<if test="yPixels != null "> and y_pixels = #{yPixels}</if>
<if test="zPixels != null "> and z_pixels = #{zPixels}</if>
<if test="bord != null and bord != ''"> and bord = #{bord}</if>
<if test="productMix != null and productMix != ''"> and product_mix = #{productMix}</if>
</where>
</select>
<select id="selectWmsBaseLocationByLocationId" parameterType="Long" resultMap="WmsBaseLocationResult">
<include refid="selectWmsBaseLocationVo"/>
where location_id = #{locationId}
</select>
<insert id="insertWmsBaseLocation" parameterType="WmsBaseLocation" useGeneratedKeys="true" keyProperty="locationId">
insert into wms_base_location
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="warehouseId != null">warehouse_id,</if>
<if test="locationCode != null and locationCode != ''">location_code,</if>
<if test="locRow != null">loc_row,</if>
<if test="layerNum != null">layer_num,</if>
<if test="locColumn != null">loc_column,</if>
<if test="activeFlag != null and activeFlag != ''">active_flag,</if>
<if test="materialTypeId != null">material_type_id,</if>
<if test="qtyLimit != null">qty_limit,</if>
<if test="instockFlag != null">instock_flag,</if>
<if test="outstockFlag != null">outstock_flag,</if>
<if test="locationStatus != null and locationStatus != ''">location_status,</if>
<if test="batchMix != null">batch_mix,</if>
<if test="xCoordinate != null">x_coordinate,</if>
<if test="yCoordinate != null">y_coordinate,</if>
<if test="zCoordinate != null">z_coordinate,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="delFlag != null">del_flag,</if>
<if test="shelfOrder != null">shelf_order,</if>
<if test="checkOrder != null">check_order,</if>
<if test="pickOrder != null">pick_order,</if>
<if test="pickFlag != null">pick_flag,</if>
<if test="isOpenKnFlag != null">is_open_kn_flag,</if>
<if test="locationScrapType != null">location_scrap_type,</if>
<if test="locationAttr != null">location_attr,</if>
<if test="turnDemand != null">turn_demand,</if>
<if test="checkCode != null">check_code,</if>
<if test="workArea != null">work_area,</if>
<if test="volumeLimit != null">volume_limit,</if>
<if test="weightLimit != null">weight_limit,</if>
<if test="boxLimit != null">box_limit,</if>
<if test="palletLimit != null">pallet_limit,</if>
<if test="length != null">length,</if>
<if test="width != null">width,</if>
<if test="height != null">height,</if>
<if test="xPixels != null">x_pixels,</if>
<if test="yPixels != null">y_pixels,</if>
<if test="zPixels != null">z_pixels,</if>
<if test="bord != null">bord,</if>
<if test="productMix != null">product_mix,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="warehouseId != null">#{warehouseId},</if>
<if test="locationCode != null and locationCode != ''">#{locationCode},</if>
<if test="locRow != null">#{locRow},</if>
<if test="layerNum != null">#{layerNum},</if>
<if test="locColumn != null">#{locColumn},</if>
<if test="activeFlag != null and activeFlag != ''">#{activeFlag},</if>
<if test="materialTypeId != null">#{materialTypeId},</if>
<if test="qtyLimit != null">#{qtyLimit},</if>
<if test="instockFlag != null">#{instockFlag},</if>
<if test="outstockFlag != null">#{outstockFlag},</if>
<if test="locationStatus != null and locationStatus != ''">#{locationStatus},</if>
<if test="batchMix != null">#{batchMix},</if>
<if test="xCoordinate != null">#{xCoordinate},</if>
<if test="yCoordinate != null">#{yCoordinate},</if>
<if test="zCoordinate != null">#{zCoordinate},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="shelfOrder != null">#{shelfOrder},</if>
<if test="checkOrder != null">#{checkOrder},</if>
<if test="pickOrder != null">#{pickOrder},</if>
<if test="pickFlag != null">#{pickFlag},</if>
<if test="isOpenKnFlag != null">#{isOpenKnFlag},</if>
<if test="locationScrapType != null">#{locationScrapType},</if>
<if test="locationAttr != null">#{locationAttr},</if>
<if test="turnDemand != null">#{turnDemand},</if>
<if test="checkCode != null">#{checkCode},</if>
<if test="workArea != null">#{workArea},</if>
<if test="volumeLimit != null">#{volumeLimit},</if>
<if test="weightLimit != null">#{weightLimit},</if>
<if test="boxLimit != null">#{boxLimit},</if>
<if test="palletLimit != null">#{palletLimit},</if>
<if test="length != null">#{length},</if>
<if test="width != null">#{width},</if>
<if test="height != null">#{height},</if>
<if test="xPixels != null">#{xPixels},</if>
<if test="yPixels != null">#{yPixels},</if>
<if test="zPixels != null">#{zPixels},</if>
<if test="bord != null">#{bord},</if>
<if test="productMix != null">#{productMix},</if>
</trim>
</insert>
<update id="updateWmsBaseLocation" parameterType="WmsBaseLocation">
update wms_base_location
<trim prefix="SET" suffixOverrides=",">
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
<if test="locationCode != null and locationCode != ''">location_code = #{locationCode},</if>
<if test="locRow != null">loc_row = #{locRow},</if>
<if test="layerNum != null">layer_num = #{layerNum},</if>
<if test="locColumn != null">loc_column = #{locColumn},</if>
<if test="activeFlag != null and activeFlag != ''">active_flag = #{activeFlag},</if>
<if test="materialTypeId != null">material_type_id = #{materialTypeId},</if>
<if test="qtyLimit != null">qty_limit = #{qtyLimit},</if>
<if test="instockFlag != null">instock_flag = #{instockFlag},</if>
<if test="outstockFlag != null">outstock_flag = #{outstockFlag},</if>
<if test="locationStatus != null and locationStatus != ''">location_status = #{locationStatus},</if>
<if test="batchMix != null">batch_mix = #{batchMix},</if>
<if test="xCoordinate != null">x_coordinate = #{xCoordinate},</if>
<if test="yCoordinate != null">y_coordinate = #{yCoordinate},</if>
<if test="zCoordinate != null">z_coordinate = #{zCoordinate},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="shelfOrder != null">shelf_order = #{shelfOrder},</if>
<if test="checkOrder != null">check_order = #{checkOrder},</if>
<if test="pickOrder != null">pick_order = #{pickOrder},</if>
<if test="pickFlag != null">pick_flag = #{pickFlag},</if>
<if test="isOpenKnFlag != null">is_open_kn_flag = #{isOpenKnFlag},</if>
<if test="locationScrapType != null">location_scrap_type = #{locationScrapType},</if>
<if test="locationAttr != null">location_attr = #{locationAttr},</if>
<if test="turnDemand != null">turn_demand = #{turnDemand},</if>
<if test="checkCode != null">check_code = #{checkCode},</if>
<if test="workArea != null">work_area = #{workArea},</if>
<if test="volumeLimit != null">volume_limit = #{volumeLimit},</if>
<if test="weightLimit != null">weight_limit = #{weightLimit},</if>
<if test="boxLimit != null">box_limit = #{boxLimit},</if>
<if test="palletLimit != null">pallet_limit = #{palletLimit},</if>
<if test="length != null">length = #{length},</if>
<if test="width != null">width = #{width},</if>
<if test="height != null">height = #{height},</if>
<if test="xPixels != null">x_pixels = #{xPixels},</if>
<if test="yPixels != null">y_pixels = #{yPixels},</if>
<if test="zPixels != null">z_pixels = #{zPixels},</if>
<if test="bord != null">bord = #{bord},</if>
<if test="productMix != null">product_mix = #{productMix},</if>
</trim>
where location_id = #{locationId}
</update>
<delete id="deleteWmsBaseLocationByLocationId" parameterType="Long">
delete from wms_base_location where location_id = #{locationId}
</delete>
<delete id="deleteWmsBaseLocationByLocationIds" parameterType="String">
delete from wms_base_location where location_id in
<foreach item="locationId" collection="array" open="(" separator="," close=")">
#{locationId}
</foreach>
</delete>
<select id="selectWmsBaseLocationByLocationCode" parameterType="String" resultMap="WmsBaseLocationResult">
<include refid="selectWmsBaseLocationVo"/>
where location_code = #{locationCode}
</select>
<select id="selectEmptyWmsBaseLocationList" parameterType="WmsBaseLocation" resultMap="WmsBaseLocationResult">
select location_id, warehouse_id, location_code, loc_row, layer_num, loc_column, active_flag,
material_type_id, qty_limit, instock_flag, outstock_flag, location_status,
batch_mix, x_coordinate, y_coordinate, z_coordinate from wms_base_location wbl
<where>
and not exists (select 1 from wms_raw_stock wrs where wrs.location_code = wbl.location_code and wrs.total_amount>0 )
<if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
<if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if>
<if test="locRow != null "> and loc_row = #{locRow}</if>
<if test="layerNum != null "> and layer_num = #{layerNum}</if>
<if test="locColumn != null "> and loc_column = #{locColumn}</if>
<if test="activeFlag != null and activeFlag != ''"> and active_flag = #{activeFlag}</if>
<if test="materialTypeId != null "> and material_type_id = #{materialTypeId}</if>
<if test="qtyLimit != null "> and qty_limit = #{qtyLimit}</if>
<if test="instockFlag != null and instockFlag != ''"> and instock_flag = #{instockFlag}</if>
<if test="outstockFlag != null and outstockFlag != ''"> and outstock_flag = #{outstockFlag}</if>
<if test="locationStatus != null and locationStatus != ''"> and location_status = #{locationStatus}</if>
<if test="batchMix != null and batchMix != ''"> and batch_mix = #{batchMix}</if>
<if test="xCoordinate != null "> and x_coordinate = #{xCoordinate}</if>
<if test="yCoordinate != null "> and y_coordinate = #{yCoordinate}</if>
<if test="zCoordinate != null "> and z_coordinate = #{zCoordinate}</if>
<if test="shelfOrder != null and shelfOrder != ''"> and shelf_order = #{shelfOrder}</if>
<if test="checkOrder != null and checkOrder != ''"> and check_order = #{checkOrder}</if>
<if test="pickOrder != null and pickOrder != ''"> and pick_order = #{pickOrder}</if>
<if test="pickFlag != null and pickFlag != ''"> and pick_flag = #{pickFlag}</if>
<if test="isOpenKnFlag != null and isOpenKnFlag != ''"> and is_open_kn_flag = #{isOpenKnFlag}</if>
<if test="locationScrapType != null and locationScrapType != ''"> and location_scrap_type = #{locationScrapType}</if>
<if test="locationAttr != null and locationAttr != ''"> and location_attr = #{locationAttr}</if>
<if test="turnDemand != null and turnDemand != ''"> and turn_demand = #{turnDemand}</if>
<if test="checkCode != null and checkCode != ''"> and check_code = #{checkCode}</if>
<if test="workArea != null and workArea != ''"> and work_area = #{workArea}</if>
<if test="volumeLimit != null "> and volume_limit = #{volumeLimit}</if>
<if test="weightLimit != null "> and weight_limit = #{weightLimit}</if>
<if test="boxLimit != null "> and box_limit = #{boxLimit}</if>
<if test="palletLimit != null "> and pallet_limit = #{palletLimit}</if>
<if test="length != null "> and length = #{length}</if>
<if test="width != null "> and width = #{width}</if>
<if test="height != null "> and height = #{height}</if>
<if test="xPixels != null "> and x_pixels = #{xPixels}</if>
<if test="yPixels != null "> and y_pixels = #{yPixels}</if>
<if test="zPixels != null "> and z_pixels = #{zPixels}</if>
<if test="bord != null and bord != ''"> and bord = #{bord}</if>
<if test="productMix != null and productMix != ''"> and product_mix = #{productMix}</if>
</where>
</select>
</mapper>