123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610 |
- <?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.base.mapper.BaseLocationInfoMapper">
- <resultMap type="BaseLocationInfo" id="BaseLocationInfoResult">
- <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="heightLimit" column="height_limit" />
- <result property="weightLimit" column="weight_limit" />
- <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="zoneName" column="zone_name" />
- </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="heightLimit" column="height_limit" />
- <result property="weightLimit" column="weight_limit" />
- <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" />
- <result property="lotattVO.lotatt01" column="lotatt01" />
- <result property="lotattVO.lotatt02" column="lotatt02" />
- <result property="lotattVO.lotatt03" column="lotatt03" />
- <result property="lotattVO.lotatt04" column="lotatt04" />
- <result property="lotattVO.lotatt05" column="lotatt05" />
- <result property="lotattVO.lotatt06" column="lotatt06" />
- <result property="lotattVO.lotatt07" column="lotatt07" />
- <result property="lotattVO.lotatt08" column="lotatt09" />
- <result property="lotattVO.lotatt09" column="lotatt09" />
- <result property="lotattVO.lotatt10" column="lotatt10" />
- <result property="lotattVO.lotatt11" column="lotatt11" />
- <result property="lotattVO.lotatt12" column="lotatt12" />
- <result property="lotattVO.lotatt13" column="lotatt13" />
- <result property="lotattVO.lotatt14" column="lotatt14" />
- <result property="lotattVO.lotatt15" column="lotatt15" />
- <result property="lotattVO.lotatt16" column="lotatt16" />
- <result property="lotattVO.lotatt17" column="lotatt17" />
- <result property="lotattVO.lotatt18" column="lotatt18" />
- </resultMap>
- <resultMap type="lotattVO" id="LotattResult">
- <result property="lotatt01" column="lotatt01" />
- <result property="lotatt02" column="lotatt02" />
- <result property="lotatt03" column="lotatt03" />
- <result property="lotatt04" column="lotatt04" />
- <result property="lotatt05" column="lotatt05" />
- <result property="lotatt06" column="lotatt06" />
- <result property="lotatt07" column="lotatt07" />
- <result property="lotatt08" column="lotatt09" />
- <result property="lotatt09" column="lotatt09" />
- <result property="lotatt10" column="lotatt10" />
- <result property="lotatt11" column="lotatt11" />
- <result property="lotatt12" column="lotatt12" />
- <result property="lotatt13" column="lotatt13" />
- <result property="lotatt14" column="lotatt14" />
- <result property="lotatt15" column="lotatt15" />
- <result property="lotatt16" column="lotatt16" />
- <result property="lotatt17" column="lotatt17" />
- <result property="lotatt18" column="lotatt18" />
- </resultMap>
- <resultMap type="com.ruoyi.base.domain.dto.BaseLocationInfoSameColDTO" id="BaseLocationInfoSameColDTOResult">
- <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="heightLimit" column="height_limit" />
- <result property="weightLimit" column="weight_limit" />
- <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="isOb" column="isOb" />
- </resultMap>
- <sql id="selectBaseLocationInfoVo">
- select id, warehouse_id, zone_id, location_no, location_barcode, row_no, row_index, col_no, col_index, shift_no, shift_index, stock_status, is_empty, bind_sku, location_type, rack_id, agv_station, folded_tag, folded_count,height_limit,weight_limit, userdefine1, userdefine2, userdefine3, userdefine4, userdefine5, userdefine6, userdefine7, userdefine8, userdefine9, userdefine10, create_by, create_time, update_by, update_time, remark from base_location_info
- </sql>
- <select id="selectBaseLocationInfoList" parameterType="BaseLocationInfo" resultMap="BaseLocationInfoResult">
- select t1.*,t2.zone_name
- from base_location_info t1
- left join base_location_zone t2 on t2.zone_id=t1.zone_id
- <where>
- <if test="id != null "> and id like concat('%', #{id}, '%')</if>
- <if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
- <if test="zoneId != null "> and t1.zone_id = #{zoneId}</if>
- <if test="zoneName != null "> and zone_name = #{zoneName}</if>
- <if test="locationNo != null and locationNo != ''"> and location_no like concat('%', #{locationNo}, '%')</if>
- <if test="agvStation != null and agvStation != ''"> and agv_station like concat('%', #{agvStation}, '%')</if>
- <if test="stockStatus != null and stockStatus != ''"> and stock_status = #{stockStatus}</if>
- <if test="isEmpty != null and isEmpty != ''"> and is_empty = #{isEmpty}</if>
- <if test="locationType != null and locationType != ''"> and location_type = #{locationType}</if>
- </where>
- order by location_no
- </select>
- <select id="selectBaseLocationInfoByLocationNo" parameterType="BaseLocationInfo" resultMap="BaseLocationInfoResult">
- <include refid="selectBaseLocationInfoVo"/>
- where location_no = #{locationNo} and warehouse_id = #{warehouseId}
- </select>
- <select id="selectBaseLocationInfoById" parameterType="Long" resultMap="BaseLocationInfoResult">
- <include refid="selectBaseLocationInfoVo"/>
- where id = #{id}
- </select>
- <insert id="insertBaseLocationInfo" parameterType="BaseLocationInfo" useGeneratedKeys="true" keyProperty="id">
- insert into base_location_info
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="warehouseId != null">warehouse_id,</if>
- <if test="zoneId != null">zone_id,</if>
- <if test="locationNo != null">location_no,</if>
- <if test="locationBarcode != null">location_barcode,</if>
- <if test="rowNo != null">row_no,</if>
- <if test="rowIndex != null">row_index,</if>
- <if test="colNo != null">col_no,</if>
- <if test="colIndex != null">col_index,</if>
- <if test="shiftNo != null">shift_no,</if>
- <if test="shiftIndex != null">shift_index,</if>
- <if test="stockStatus != null">stock_status,</if>
- <if test="isEmpty != null">is_empty,</if>
- <if test="bindSku != null">bind_sku,</if>
- <if test="locationType != null">location_type,</if>
- <if test="rackId != null">rack_id,</if>
- <if test="agvStation != null">agv_station,</if>
- <if test="foldedTag != null">folded_tag,</if>
- <if test="foldedCount != null">folded_count,</if>
- <if test="heightLimit != null">height_limit,</if>
- <if test="weightLimit != null">weight_limit,</if>
- <if test="userdefine1 != null">userdefine1,</if>
- <if test="userdefine2 != null">userdefine2,</if>
- <if test="userdefine3 != null">userdefine3,</if>
- <if test="userdefine4 != null">userdefine4,</if>
- <if test="userdefine5 != null">userdefine5,</if>
- <if test="userdefine6 != null">userdefine6,</if>
- <if test="userdefine7 != null">userdefine7,</if>
- <if test="userdefine8 != null">userdefine8,</if>
- <if test="userdefine9 != null">userdefine9,</if>
- <if test="userdefine10 != null">userdefine10,</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="warehouseId != null">#{warehouseId},</if>
- <if test="zoneId != null">#{zoneId},</if>
- <if test="locationNo != null">#{locationNo},</if>
- <if test="locationBarcode != null">#{locationBarcode},</if>
- <if test="rowNo != null">#{rowNo},</if>
- <if test="rowIndex != null">#{rowIndex},</if>
- <if test="colNo != null">#{colNo},</if>
- <if test="colIndex != null">#{colIndex},</if>
- <if test="shiftNo != null">#{shiftNo},</if>
- <if test="shiftIndex != null">#{shiftIndex},</if>
- <if test="stockStatus != null">#{stockStatus},</if>
- <if test="isEmpty != null">#{isEmpty},</if>
- <if test="bindSku != null">#{bindSku},</if>
- <if test="locationType != null">#{locationType},</if>
- <if test="rackId != null">#{rackId},</if>
- <if test="agvStation != null">#{agvStation},</if>
- <if test="foldedTag != null">#{foldedTag},</if>
- <if test="foldedCount != null">#{foldedCount},</if>
- <if test="heightLimit != null">#{heightLimit},</if>
- <if test="weightLimit != null">#{weightLimit},</if>
- <if test="userdefine1 != null">#{userdefine1},</if>
- <if test="userdefine2 != null">#{userdefine2},</if>
- <if test="userdefine3 != null">#{userdefine3},</if>
- <if test="userdefine4 != null">#{userdefine4},</if>
- <if test="userdefine5 != null">#{userdefine5},</if>
- <if test="userdefine6 != null">#{userdefine6},</if>
- <if test="userdefine7 != null">#{userdefine7},</if>
- <if test="userdefine8 != null">#{userdefine8},</if>
- <if test="userdefine9 != null">#{userdefine9},</if>
- <if test="userdefine10 != null">#{userdefine10},</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="updateBaseLocationInfo" parameterType="BaseLocationInfo">
- update base_location_info
- <trim prefix="SET" suffixOverrides=",">
- <if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
- <if test="zoneId != null">zone_id = #{zoneId},</if>
- <if test="locationNo != null">location_no = #{locationNo},</if>
- <if test="locationBarcode != null">location_barcode = #{locationBarcode},</if>
- <if test="rowNo != null">row_no = #{rowNo},</if>
- <if test="rowIndex != null">row_index = #{rowIndex},</if>
- <if test="colNo != null">col_no = #{colNo},</if>
- <if test="colIndex != null">col_index = #{colIndex},</if>
- <if test="shiftNo != null">shift_no = #{shiftNo},</if>
- <if test="shiftIndex != null">shift_index = #{shiftIndex},</if>
- <if test="stockStatus != null">stock_status = #{stockStatus},</if>
- <if test="isEmpty != null">is_empty = #{isEmpty},</if>
- <if test="bindSku != null">bind_sku = #{bindSku},</if>
- <if test="locationType != null">location_type = #{locationType},</if>
- <if test="rackId != null">rack_id = #{rackId},</if>
- <if test="agvStation != null">agv_station = #{agvStation},</if>
- <if test="foldedTag != null">folded_tag = #{foldedTag},</if>
- <if test="foldedCount != null">folded_count = #{foldedCount},</if>
- <if test="heightLimit != null">height_limit = #{heightLimit},</if>
- <if test="weightLimit != null">weight_limit = #{weightLimit},</if>
- <if test="userdefine1 != null">userdefine1 = #{userdefine1},</if>
- <if test="userdefine2 != null">userdefine2 = #{userdefine2},</if>
- <if test="userdefine3 != null">userdefine3 = #{userdefine3},</if>
- <if test="userdefine4 != null">userdefine4 = #{userdefine4},</if>
- <if test="userdefine5 != null">userdefine5 = #{userdefine5},</if>
- <if test="userdefine6 != null">userdefine6 = #{userdefine6},</if>
- <if test="userdefine7 != null">userdefine7 = #{userdefine7},</if>
- <if test="userdefine8 != null">userdefine8 = #{userdefine8},</if>
- <if test="userdefine9 != null">userdefine9 = #{userdefine9},</if>
- <if test="userdefine10 != null">userdefine10 = #{userdefine10},</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 id = #{id}
- </update>
- <delete id="deleteBaseLocationInfoById" parameterType="Long">
- delete from base_location_info where id = #{id}
- </delete>
- <delete id="deleteBaseLocationInfoByIds" parameterType="String">
- delete from base_location_info where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <select id="selectSortedLocationListByZoneId" parameterType="BaseLocationInfo" resultMap="BaseLocationInfoResult">
- <include refid="selectBaseLocationInfoVo"/>
- where warehouse_id = #{warehouseId} and zone_id = #{zoneId}
- <if test="orderByClause != null and orderByClause != ''" >
- order by ${orderByClause}
- </if>
- <if test="orderByClause == null or orderByClause == ''">
- order by row_no + 0,row_index,shift_no + 0,shift_index,col_no + 0,col_index
- </if>
- </select>
- <select id="selectSortedLocationLotattListByZoneId" parameterType="BaseLocationInfo" 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, height_limit, weight_limit, inv.sku, inv.qty, att.*
- from base_location_info b left join inv_lot_loc_id inv on b.id = inv.location_id
- left join inv_lot_att att on inv.lotnum = att.lotnum
- where warehouse_id = #{warehouseId} and zone_id = #{zoneId}
- order by lpad(row_no, 11, '0'),row_index,lpad(shift_no, 11, '0'),shift_index,lpad(col_no, 11, '0'),col_index
- </select>
- <select id="selectInvLotattById" parameterType="Long" resultMap="LotattResult">
- select att.*
- from base_location_info b left join wcs_task w on b.id = w.location_to
- left join inv_lot_loc_id inv on w.location_from = inv.location_id
- left join inv_lot_att att on inv.lotnum = att.lotnum
- where b.id = #{id}
- </select>
- <update id="updateLocationStockStatus">
- update base_location_info set stock_status = #{status} where id = #{id}
- </update>
- <select id="checkIsRepeat" parameterType="BaseLocationInfo" resultMap="BaseLocationInfoResult">
- select * from base_location_info b
- where
- location_no = #{locationNo}
- </select>
- <select id="selectLocationBindSku" parameterType="string" resultMap="BaseLocationInfoResult">
- select b.* from base_location_info b
- left join base_location_zone bz on b.zone_id = bz.zone_id
- where bind_sku like concat('%', #{skuType}, '%') or ifnull(bind_sku,'') = ''
- and bz.userdefine1 = 'INV'
- order by lpad(row_no, 11, '0'),row_index,lpad(shift_no, 11, '0'),shift_index,lpad(col_no, 11, '0'),col_index
- </select>
- <select id="selectSameSkuColNo" resultType="string">
- select b.col_no
- from base_location_info b
- left join inv_lot_loc_id i on b.id = i.location_id
- left join inv_lot_att att on i.lotnum = att.lotnum
- left join base_sku s on i.sku = s.sku
- left join base_location_zone bz on b.zone_id = bz.zone_id
- where
- i.sku = #{sku}
- and bz.userdefine1 = 'INV'
- <if test="lotatt.lotatt01 != null and lotatt.lotatt01 != ''"> and att.lotatt01 = #{lotatt.lotatt01}</if>
- <if test="lotatt.lotatt02 != null and lotatt.lotatt02 != ''"> and att.lotatt02 = #{lotatt.lotatt02}</if>
- <if test="lotatt.lotatt03 != null and lotatt.lotatt03 != ''"> and att.lotatt03 = #{lotatt.lotatt03}</if>
- <if test="lotatt.lotatt04 != null and lotatt.lotatt04 != ''"> and att.lotatt04 = #{lotatt.lotatt04}</if>
- <if test="lotatt.lotatt05 != null and lotatt.lotatt05 != ''"> and att.lotatt05 = #{lotatt.lotatt05}</if>
- <if test="lotatt.lotatt06 != null and lotatt.lotatt06 != ''"> and att.lotatt06 = #{lotatt.lotatt06}</if>
- <if test="lotatt.lotatt07 != null and lotatt.lotatt07 != ''"> and att.lotatt07 = #{lotatt.lotatt07}</if>
- <if test="lotatt.lotatt08 != null and lotatt.lotatt08 != ''"> and att.lotatt08 = #{lotatt.lotatt08}</if>
- <if test="lotatt.lotatt09 != null and lotatt.lotatt09 != ''"> and att.lotatt09 = #{lotatt.lotatt09}</if>
- <if test="lotatt.lotatt10 != null and lotatt.lotatt10 != ''"> and att.lotatt10 = #{lotatt.lotatt10}</if>
- <if test="lotatt.lotatt11 != null and lotatt.lotatt11 != ''"> and att.lotatt11 = #{lotatt.lotatt11}</if>
- <if test="lotatt.lotatt12 != null and lotatt.lotatt12 != ''"> and att.lotatt12 = #{lotatt.lotatt12}</if>
- <if test="lotatt.lotatt13 != null and lotatt.lotatt13 != ''"> and att.lotatt13 = #{lotatt.lotatt13}</if>
- <if test="lotatt.lotatt14 != null and lotatt.lotatt14 != ''"> and att.lotatt14 = #{lotatt.lotatt14}</if>
- <if test="lotatt.lotatt15 != null and lotatt.lotatt15 != ''"> and att.lotatt15 = #{lotatt.lotatt15}</if>
- <if test="lotatt.lotatt16 != null and lotatt.lotatt16 != ''"> and att.lotatt16 = #{lotatt.lotatt16}</if>
- <if test="lotatt.lotatt17 != null and lotatt.lotatt17 != ''"> and att.lotatt17 = #{lotatt.lotatt17}</if>
- <if test="lotatt.lotatt18 != null and lotatt.lotatt18 != ''"> and att.lotatt18 = #{lotatt.lotatt18}</if>
- group by b.col_no
- order by lpad(b.col_no, 11, '0')
- </select>
- <select id="selectSameSkuTypeColNo" resultType="string">
- select b.col_no
- from base_location_info b
- left join base_location_zone bz on b.zone_id = bz.zone_id
- where b.bind_sku = #{skuType}
- and bz.userdefine1 = 'INV'
- 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
- </select>
- <select id="selectAllColNo" resultMap="BaseLocationInfoResult">
- select col_no,bind_sku from base_location_info b
- left join base_location_zone bz on b.zone_id = bz.zone_id
- where bz.userdefine1 = 'INV'
- group by col_no,bind_sku order by lpad(b.col_no, 11, '0')
- </select>
- <select id="selectLocationByColNo" parameterType="string" resultMap="BaseLocationInfoResult">
- select * from base_location_info where col_no = #{colNo} order by lpad(row_no, 11, '0'),row_index,lpad(shift_no, 11, '0'),shift_index,lpad(col_no, 11, '0'),col_index desc
- </select>
- <select id="selectLocationByColNos" parameterType="java.util.List" resultMap="BaseLocationInfoResult">
- select * from base_location_info
- where col_no in
- <foreach item="item" collection="colNos" separator="," open="(" close=")" index=""> #{item, jdbcType=VARCHAR}
- </foreach>
- order by lpad(row_no, 11, '0'),row_index,lpad(shift_no, 11, '0'),shift_index,lpad(col_no, 11, '0'),col_index desc
- </select>
- <select id="selectLocationIsTasking" resultType="int">
- select count(*) con from wcs_task
- where 1 = 1 and state in (9,0,1)
- <if test="locationType = 'from'"> and location_from = #{locationId}</if>
- <if test="locationType = 'to'"> and location_to = #{locationId}</if>
- </select>
- <select id="selectSortedLocationLotattListByZoneIdList" parameterType="BaseLocationInfo" 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, height_limit, weight_limit, att.*
- from base_location_info b left join inv_lot_loc_id inv on b.id = inv.location_id
- left join inv_lot_att att on inv.lotnum = att.lotnum
- where warehouse_id = #{warehouseId} and inv.sku is not null and zone_id in
- <foreach item="item" collection="zoneId" open="(" separator="," close=")">
- #{item}
- </foreach>
- <if test="lotatt.lotatt01 != null and lotatt.lotatt01 != ''"> and att.lotatt01 = #{lotatt.lotatt01}</if>
- <if test="lotatt.lotatt02 != null and lotatt.lotatt02 != ''"> and att.lotatt02 = #{lotatt.lotatt02}</if>
- <if test="lotatt.lotatt03 != null and lotatt.lotatt03 != ''"> and att.lotatt03 = #{lotatt.lotatt03}</if>
- <if test="lotatt.lotatt04 != null and lotatt.lotatt04 != ''"> and att.lotatt04 = #{lotatt.lotatt04}</if>
- <if test="lotatt.lotatt05 != null and lotatt.lotatt05 != ''"> and att.lotatt05 = #{lotatt.lotatt05}</if>
- <if test="lotatt.lotatt06 != null and lotatt.lotatt06 != ''"> and att.lotatt06 = #{lotatt.lotatt06}</if>
- <if test="lotatt.lotatt07 != null and lotatt.lotatt07 != ''"> and att.lotatt07 = #{lotatt.lotatt07}</if>
- <if test="lotatt.lotatt08 != null and lotatt.lotatt08 != ''"> and att.lotatt08 = #{lotatt.lotatt08}</if>
- <if test="lotatt.lotatt09 != null and lotatt.lotatt09 != ''"> and att.lotatt09 = #{lotatt.lotatt09}</if>
- <if test="lotatt.lotatt10 != null and lotatt.lotatt10 != ''"> and att.lotatt10 = #{lotatt.lotatt10}</if>
- <if test="lotatt.lotatt11 != null and lotatt.lotatt11 != ''"> and att.lotatt11 = #{lotatt.lotatt11}</if>
- <if test="lotatt.lotatt12 != null and lotatt.lotatt12 != ''"> and att.lotatt12 = #{lotatt.lotatt12}</if>
- <if test="lotatt.lotatt13 != null and lotatt.lotatt13 != ''"> and att.lotatt13 = #{lotatt.lotatt13}</if>
- <if test="lotatt.lotatt14 != null and lotatt.lotatt14 != ''"> and att.lotatt14 = #{lotatt.lotatt14}</if>
- <if test="lotatt.lotatt15 != null and lotatt.lotatt15 != ''"> and att.lotatt15 = #{lotatt.lotatt15}</if>
- <if test="lotatt.lotatt16 != null and lotatt.lotatt16 != ''"> and att.lotatt16 = #{lotatt.lotatt16}</if>
- <if test="lotatt.lotatt17 != null and lotatt.lotatt17 != ''"> and att.lotatt17 = #{lotatt.lotatt17}</if>
- <if test="lotatt.lotatt18 != null and lotatt.lotatt18 != ''"> and att.lotatt18 = #{lotatt.lotatt18}</if>
- order by lpad(row_no, 11, '0'),row_index,lpad(shift_no, 11, '0'),shift_index,lpad(col_no, 11, '0'),col_index
- </select>
- <select id="selectSortedLocationLotattListByZoneIdListOrderBy" parameterType="BaseLocationInfo" 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, height_limit, weight_limit, att.*
- from base_location_info b
- left join inv_lot_loc_id inv on b.id = inv.location_id
- left join inv_lot_att att on inv.lotnum = att.lotnum
- where warehouse_id = #{warehouseId} and zone_id in
- <foreach item="item" collection="zoneId" open="(" separator="," close=")">
- #{item}
- </foreach>
- <if test="sku != null and sku != ''"> and inv.sku = #{sku}</if>
- <if test="lotatt.lotatt01 != null and lotatt.lotatt01 != ''"> and att.lotatt01 = #{lotatt.lotatt01}</if>
- <if test="lotatt.lotatt02 != null and lotatt.lotatt02 != ''"> and att.lotatt02 = #{lotatt.lotatt02}</if>
- <if test="lotatt.lotatt03 != null and lotatt.lotatt03 != ''"> and att.lotatt03 = #{lotatt.lotatt03}</if>
- <if test="lotatt.lotatt04 != null and lotatt.lotatt04 != ''"> and att.lotatt04 = #{lotatt.lotatt04}</if>
- <if test="lotatt.lotatt05 != null and lotatt.lotatt05 != ''"> and att.lotatt05 = #{lotatt.lotatt05}</if>
- <if test="lotatt.lotatt06 != null and lotatt.lotatt06 != ''"> and att.lotatt06 = #{lotatt.lotatt06}</if>
- <if test="lotatt.lotatt07 != null and lotatt.lotatt07 != ''"> and att.lotatt07 = #{lotatt.lotatt07}</if>
- <if test="lotatt.lotatt08 != null and lotatt.lotatt08 != ''"> and att.lotatt08 = #{lotatt.lotatt08}</if>
- <if test="lotatt.lotatt09 != null and lotatt.lotatt09 != ''"> and att.lotatt09 = #{lotatt.lotatt09}</if>
- <if test="lotatt.lotatt10 != null and lotatt.lotatt10 != ''"> and att.lotatt10 = #{lotatt.lotatt10}</if>
- <if test="lotatt.lotatt11 != null and lotatt.lotatt11 != ''"> and att.lotatt11 = #{lotatt.lotatt11}</if>
- <if test="lotatt.lotatt12 != null and lotatt.lotatt12 != ''"> and att.lotatt12 = #{lotatt.lotatt12}</if>
- <if test="lotatt.lotatt13 != null and lotatt.lotatt13 != ''"> and att.lotatt13 = #{lotatt.lotatt13}</if>
- <if test="lotatt.lotatt14 != null and lotatt.lotatt14 != ''"> and att.lotatt14 = #{lotatt.lotatt14}</if>
- <if test="lotatt.lotatt15 != null and lotatt.lotatt15 != ''"> and att.lotatt15 = #{lotatt.lotatt15}</if>
- <if test="lotatt.lotatt16 != null and lotatt.lotatt16 != ''"> and att.lotatt16 = #{lotatt.lotatt16}</if>
- <if test="lotatt.lotatt17 != null and lotatt.lotatt17 != ''"> and att.lotatt17 = #{lotatt.lotatt17}</if>
- <if test="lotatt.lotatt18 != null and lotatt.lotatt18 != ''"> and att.lotatt18 = #{lotatt.lotatt18}</if>
- <if test="orderByClause != null and orderByClause != ''" >
- order by ${orderByClause}
- </if>
- <if test="orderByClause == null or orderByClause == ''">
- order by row_no + 0,row_index,shift_no + 0,shift_index,col_no + 0,col_index
- </if>
- </select>
- <select id="selectSortedLocationLotattListByLocationIdList" parameterType="BaseLocationInfo" 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, height_limit, weight_limit, att.*
- from base_location_info b left join inv_lot_loc_id inv on b.id = inv.location_id
- left join inv_lot_att att on inv.lotnum = att.lotnum
- where warehouse_id = #{warehouseId} and id in
- <foreach item="item" collection="locationId" open="(" separator="," close=")">
- #{item}
- </foreach>
- <if test="sku != null and sku != ''"> and (inv.sku = #{sku} or inv.sku is null)</if>
- <if test="lotatt != null">
- <if test="lotatt.lotatt01 != null and lotatt.lotatt01 != ''"> and att.lotatt01 = #{lotatt.lotatt01}</if>
- <if test="lotatt.lotatt02 != null and lotatt.lotatt02 != ''"> and att.lotatt02 = #{lotatt.lotatt02}</if>
- <if test="lotatt.lotatt03 != null and lotatt.lotatt03 != ''"> and att.lotatt03 = #{lotatt.lotatt03}</if>
- <if test="lotatt.lotatt04 != null and lotatt.lotatt04 != ''"> and att.lotatt04 = #{lotatt.lotatt04}</if>
- <if test="lotatt.lotatt05 != null and lotatt.lotatt05 != ''"> and att.lotatt05 = #{lotatt.lotatt05}</if>
- <if test="lotatt.lotatt06 != null and lotatt.lotatt06 != ''"> and att.lotatt06 = #{lotatt.lotatt06}</if>
- <if test="lotatt.lotatt07 != null and lotatt.lotatt07 != ''"> and att.lotatt07 = #{lotatt.lotatt07}</if>
- <if test="lotatt.lotatt08 != null and lotatt.lotatt08 != ''"> and att.lotatt08 = #{lotatt.lotatt08}</if>
- <if test="lotatt.lotatt09 != null and lotatt.lotatt09 != ''"> and att.lotatt09 = #{lotatt.lotatt09}</if>
- <if test="lotatt.lotatt10 != null and lotatt.lotatt10 != ''"> and att.lotatt10 = #{lotatt.lotatt10}</if>
- <if test="lotatt.lotatt11 != null and lotatt.lotatt11 != ''"> and att.lotatt11 = #{lotatt.lotatt11}</if>
- <if test="lotatt.lotatt12 != null and lotatt.lotatt12 != ''"> and att.lotatt12 = #{lotatt.lotatt12}</if>
- <if test="lotatt.lotatt13 != null and lotatt.lotatt13 != ''"> and att.lotatt13 = #{lotatt.lotatt13}</if>
- <if test="lotatt.lotatt14 != null and lotatt.lotatt14 != ''"> and att.lotatt14 = #{lotatt.lotatt14}</if>
- <if test="lotatt.lotatt15 != null and lotatt.lotatt15 != ''"> and att.lotatt15 = #{lotatt.lotatt15}</if>
- <if test="lotatt.lotatt16 != null and lotatt.lotatt16 != ''"> and att.lotatt16 = #{lotatt.lotatt16}</if>
- <if test="lotatt.lotatt17 != null and lotatt.lotatt17 != ''"> and att.lotatt17 = #{lotatt.lotatt17}</if>
- <if test="lotatt.lotatt18 != null and lotatt.lotatt18 != ''"> and att.lotatt18 = #{lotatt.lotatt18}</if>
- </if>
- order by lpad(row_no, 11, '0'),row_index,lpad(shift_no, 11, '0'),shift_index,lpad(col_no, 11, '0'),col_index desc
- </select>
- <select id="selectBeforeLocationByColNo" resultMap="BaseLocationInfoResult">
- select * from base_location_info where col_no = #{colNo} and col_index > #{colIndex} order by lpad(row_no, 11, '0'),row_index,lpad(shift_no, 11, '0'),shift_index,lpad(col_no, 11, '0'),col_index desc
- </select>
- <select id="selectSameColCanToLoc" resultMap="BaseLocationInfoSameColDTOResult">
- select * from (
- select *,false as isOb from base_location_info where col_no = #{colNo} and is_empty='Y' and stock_status='00'
- union all
- select *,false as isOb from base_location_info where col_no = #{colNo} and stock_status='10' and is_empty='N'
- and id in (select location_from from wcs_task where STATE in (1,4))
- union all
- select *,true as isOb from base_location_info where col_no = #{colNo} and is_empty='N' and stock_status='00'
- union all
- select b.*,true as isOb from base_location_info b left join wcs_task w on b.id = w.location_from and w.state not in(2,7,8)
- where col_no = #{colNo} and stock_status='10' and is_empty='N' and w.task_no is null
- ) t
- where t.col_index <![CDATA[ < ]]> #{colIndex}
- order by col_index desc
- </select>
- <select id="laneCheck" resultMap="BaseLocationInfoResult">
- select b.* from wcs_task w left join bas_location_info b
- <if test="laneType == 'LANE_FROM'">
- on w.location_from = b.id where w.state in (0,1,3,10,13)
- </if>
- <if test="laneType == 'LANE_TO'">
- on w.location_to = b.id where w.state in (0,1,3,4,10,13,14)
- </if>
- and b.col_no = #{colNo}
- and b.warehouse_id = #{warehouseId}
- </select>
- <!-- 库位视图-->
- <select id="queryByListAllInvLotAttView" resultType="com.ruoyi.base.domain.dto.BaseLocationGuiDTO" parameterType="Object">
- select t1.zone_id zoneId,t1.id,t1.location_no locationNo,t1.agv_station agvStation
- ,CONCAT(t1.row_no,t1.shift_no) rowNoShiftNo,t1.shift_no shiftNo,t1.shift_index shiftIndex,t1.col_no colNo,t1.col_index colIndex
- ,t1.stock_status stockStatus,t1.is_empty isEmpty
- ,t4.lotatt01,t4.lotatt02,t4.lotatt03,t4.lotatt04,t4.lotatt05,t4.lotatt06
- ,t4.lotatt07,t4.lotatt08,t4.lotatt09,t4.lotatt10,t4.lotatt11,t4.lotatt12
- ,t4.lotatt13,t4.lotatt14,t4.lotatt15,t4.lotatt16,t4.lotatt17,t4.lotatt18
- ,t5.sku,t5.desc1 skuName,t5.hazard_flag isEmptyPlate
- FROM
- base_location_info t1
- LEFT JOIN base_location_zone t2 on t2.zone_id = t1.zone_id
- LEFT JOIN (SELECT location_id,any_value(lotnum) lotnum,any_value(customer_id) customer_id,any_value(sku) sku from inv_lot_loc_id GROUP BY location_id) t3 on t3.location_id = t1.id
- LEFT JOIN inv_lot_att t4 on t4.lotnum = t3.lotnum
- LEFT JOIN base_sku t5 on t5.customer_id=t3.customer_id and t5.sku = t3.sku
- where t1.zone_id = #{zoneId} and t1.id not in (99997, 99998, 99999)
- <choose>
- <when test=" sort == '1'.toString() ">
- ORDER BY CONCAT(t1.row_no,t1.shift_no),t1.location_no
- </when >
- <when test=" sort == '2'.toString() ">
- ORDER BY t1.col_no + 0,t1.location_no
- </when >
- <otherwise>
- ORDER BY ${sort}
- </otherwise>
- </choose>
- </select>
- </mapper>
|