|
@@ -0,0 +1,203 @@
|
|
|
+<?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.ruoyi.ams.inv.mapper.InvLotLocIdMapper">
|
|
|
+
|
|
|
+ <resultMap type="InvLotLocId" id="InvLotLocIdResult">
|
|
|
+ <result property="lotnum" column="lotnum" />
|
|
|
+ <result property="locationId" column="location_id" />
|
|
|
+ <result property="traceid" column="traceid" />
|
|
|
+ <result property="customerId" column="customer_id" />
|
|
|
+ <result property="sku" column="sku" />
|
|
|
+ <result property="qty" column="qty" />
|
|
|
+ <result property="qtyEach" column="qty_each" />
|
|
|
+ <result property="qtyallocated" column="qtyallocated" />
|
|
|
+ <result property="qtyallocatedEach" column="qtyallocated_each" />
|
|
|
+ <result property="qtypa" column="qtypa" />
|
|
|
+ <result property="qtyrpin" column="qtyrpin" />
|
|
|
+ <result property="qtyrpout" column="qtyrpout" />
|
|
|
+ <result property="qtymvin" column="qtymvin" />
|
|
|
+ <result property="qtymvout" column="qtymvout" />
|
|
|
+ <result property="qtyonhold" column="qtyonhold" />
|
|
|
+ <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" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <resultMap type="BaseLocationLotattVO" id="BaseLocationInfoLotattResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="warehouseId" column="warehouse_id" />
|
|
|
+ <result property="zoneId" column="zone_id" />
|
|
|
+ <result property="locationNo" column="location_no" />
|
|
|
+ <result property="locationBarcode" column="location_barcode" />
|
|
|
+ <result property="rowNo" column="row_no" />
|
|
|
+ <result property="rowIndex" column="row_index" />
|
|
|
+ <result property="colNo" column="col_no" />
|
|
|
+ <result property="colIndex" column="col_index" />
|
|
|
+ <result property="shiftNo" column="shift_no" />
|
|
|
+ <result property="shiftIndex" column="shift_index" />
|
|
|
+ <result property="stockStatus" column="stock_status" />
|
|
|
+ <result property="isEmpty" column="is_empty" />
|
|
|
+ <result property="bindSku" column="bind_sku" />
|
|
|
+ <result property="locationType" column="location_type" />
|
|
|
+ <result property="rackId" column="rack_id" />
|
|
|
+ <result property="agvStation" column="agv_station" />
|
|
|
+ <result property="foldedTag" column="folded_tag" />
|
|
|
+ <result property="foldedCount" column="folded_count" />
|
|
|
+ <result property="userdefine1" column="userdefine1" />
|
|
|
+ <result property="userdefine2" column="userdefine2" />
|
|
|
+ <result property="userdefine3" column="userdefine3" />
|
|
|
+ <result property="userdefine4" column="userdefine4" />
|
|
|
+ <result property="userdefine5" column="userdefine5" />
|
|
|
+ <result property="userdefine6" column="userdefine6" />
|
|
|
+ <result property="userdefine7" column="userdefine7" />
|
|
|
+ <result property="userdefine8" column="userdefine8" />
|
|
|
+ <result property="userdefine9" column="userdefine9" />
|
|
|
+ <result property="userdefine10" column="userdefine10" />
|
|
|
+ <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="sku" column="sku" />
|
|
|
+ <result property="qty" column="qty" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectInvLotLocIdVo">
|
|
|
+ select lotnum, location_id, traceid, customer_id, sku, qty, qty_each, qtyallocated, qtyallocated_each, qtypa, qtyrpin, qtyrpout, qtymvin, qtymvout, qtyonhold, create_by, create_time, update_by, update_time, remark from inv_lot_loc_id
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectInvLotLocIdList" parameterType="InvLotLocId" resultMap="InvLotLocIdResult">
|
|
|
+ <include refid="selectInvLotLocIdVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="traceid != null and traceid != ''"> and traceid = #{traceid}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectInvLotLocIdByLotnum" parameterType="String" resultMap="InvLotLocIdResult">
|
|
|
+ <include refid="selectInvLotLocIdVo"/>
|
|
|
+ where lotnum = #{lotnum}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertInvLotLocId" parameterType="InvLotLocId">
|
|
|
+ insert into inv_lot_loc_id
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="lotnum != null">lotnum,</if>
|
|
|
+ <if test="locationId != null">location_id,</if>
|
|
|
+ <if test="traceid != null">traceid,</if>
|
|
|
+ <if test="customerId != null">customer_id,</if>
|
|
|
+ <if test="sku != null">sku,</if>
|
|
|
+ <if test="qty != null">qty,</if>
|
|
|
+ <if test="qtyEach != null">qty_each,</if>
|
|
|
+ <if test="qtyallocated != null">qtyallocated,</if>
|
|
|
+ <if test="qtyallocatedEach != null">qtyallocated_each,</if>
|
|
|
+ <if test="qtypa != null">qtypa,</if>
|
|
|
+ <if test="qtyrpin != null">qtyrpin,</if>
|
|
|
+ <if test="qtyrpout != null">qtyrpout,</if>
|
|
|
+ <if test="qtymvin != null">qtymvin,</if>
|
|
|
+ <if test="qtymvout != null">qtymvout,</if>
|
|
|
+ <if test="qtyonhold != null">qtyonhold,</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>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="lotnum != null">#{lotnum},</if>
|
|
|
+ <if test="locationId != null">#{locationId},</if>
|
|
|
+ <if test="traceid != null">#{traceid},</if>
|
|
|
+ <if test="customerId != null">#{customerId},</if>
|
|
|
+ <if test="sku != null">#{sku},</if>
|
|
|
+ <if test="qty != null">#{qty},</if>
|
|
|
+ <if test="qtyEach != null">#{qtyEach},</if>
|
|
|
+ <if test="qtyallocated != null">#{qtyallocated},</if>
|
|
|
+ <if test="qtyallocatedEach != null">#{qtyallocatedEach},</if>
|
|
|
+ <if test="qtypa != null">#{qtypa},</if>
|
|
|
+ <if test="qtyrpin != null">#{qtyrpin},</if>
|
|
|
+ <if test="qtyrpout != null">#{qtyrpout},</if>
|
|
|
+ <if test="qtymvin != null">#{qtymvin},</if>
|
|
|
+ <if test="qtymvout != null">#{qtymvout},</if>
|
|
|
+ <if test="qtyonhold != null">#{qtyonhold},</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>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateInvLotLocId" parameterType="InvLotLocId">
|
|
|
+ update inv_lot_loc_id
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="locationId != null">location_id = #{locationId},</if>
|
|
|
+ <if test="traceid != null">traceid = #{traceid},</if>
|
|
|
+ <if test="customerId != null">customer_id = #{customerId},</if>
|
|
|
+ <if test="sku != null">sku = #{sku},</if>
|
|
|
+ <if test="qty != null">qty = #{qty},</if>
|
|
|
+ <if test="qtyEach != null">qty_each = #{qtyEach},</if>
|
|
|
+ <if test="qtyallocated != null">qtyallocated = #{qtyallocated},</if>
|
|
|
+ <if test="qtyallocatedEach != null">qtyallocated_each = #{qtyallocatedEach},</if>
|
|
|
+ <if test="qtypa != null">qtypa = #{qtypa},</if>
|
|
|
+ <if test="qtyrpin != null">qtyrpin = #{qtyrpin},</if>
|
|
|
+ <if test="qtyrpout != null">qtyrpout = #{qtyrpout},</if>
|
|
|
+ <if test="qtymvin != null">qtymvin = #{qtymvin},</if>
|
|
|
+ <if test="qtymvout != null">qtymvout = #{qtymvout},</if>
|
|
|
+ <if test="qtyonhold != null">qtyonhold = #{qtyonhold},</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>
|
|
|
+ </trim>
|
|
|
+ where lotnum = #{lotnum}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteInvLotLocIdByLotnum" parameterType="String">
|
|
|
+ delete from inv_lot_loc_id where lotnum = #{lotnum}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteInvLotLocIdByLotnums" parameterType="String">
|
|
|
+ delete from inv_lot_loc_id where lotnum in
|
|
|
+ <foreach item="lotnum" collection="array" open="(" separator="," close=")">
|
|
|
+ #{lotnum}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <select id="selectInvLocationList" resultMap="BaseLocationInfoLotattResult">
|
|
|
+ select
|
|
|
+ b.id, b.warehouse_id, b.zone_id, b.location_no, b.location_barcode, b.row_no, b.row_index, b.col_no, b.col_index, b.shift_no,
|
|
|
+ b.shift_index, b.stock_status, b.is_empty, b.bind_sku, b.location_type, b.rack_id, b.agv_station, b.folded_tag, b.folded_count,
|
|
|
+ b.userdefine1, b.userdefine2, b.userdefine3, b.userdefine4, b.userdefine5, b.userdefine6, b.userdefine7, b.userdefine8,
|
|
|
+ b.userdefine9, b.userdefine10, b.create_by, b.create_time, b.update_by, b.update_time, b.remark, inv.sku, inv.qty, att.*
|
|
|
+ from inv_lot_loc_id inv
|
|
|
+ left join inv_lot_att att on inv.lotnum = att.lotnum
|
|
|
+ left join base_location_info b on inv.location_id = b.id
|
|
|
+ left join base_sku sk on inv.sku = sk.sku
|
|
|
+ left join base_sku_type skt on sk.sku_type = skt.item_code
|
|
|
+ <where>
|
|
|
+ <if test="zoneId != null and zoneId != ''"> and b.zone_id = #{zoneId}</if>
|
|
|
+ <if test="sku != null and sku != ''"> and sk.sku = #{sku}</if>
|
|
|
+ <if test="skuType != null and skuType != ''"> and skt.item_code = #{skuType}</if>
|
|
|
+ </where>
|
|
|
+ order by lpad(b.row_no, 11, '0'),b.row_index,lpad(b.shift_no, 11, '0'),b.shift_index,lpad(b.col_no, 11, '0'),b.col_index desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectInvZoneBySkuOrSkuType" resultMap="BaseLocationInfoLotattResult">
|
|
|
+ select
|
|
|
+ b.zone_id
|
|
|
+ from inv_lot_loc_id inv
|
|
|
+ left join inv_lot_att att on inv.lotnum = att.lotnum
|
|
|
+ left join base_location_info b on inv.location_id = b.id
|
|
|
+ left join base_sku sk on inv.sku = sk.sku
|
|
|
+ left join base_sku_type skt on sk.sku_type = skt.item_code
|
|
|
+ <where>
|
|
|
+ <if test="sku != null and sku != ''"> and sk.sku = #{sku}</if>
|
|
|
+ <if test="skuType != null and skuType != ''"> and skt.item_code = #{skuType}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|