|
@@ -512,6 +512,64 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
+
|
|
|
+ <select id="selectAllocatingLocationAccordingConditionsOrderBy" parameterType="BaseLocationInfo" resultMap="BaseLocationInfoLotattResult">
|
|
|
+ select b.*
|
|
|
+ from base_location_info b
|
|
|
+ where warehouse_id = #{warehouseId} and is_empty = 'Y' and stock_status = '00'
|
|
|
+ and zone_id in
|
|
|
+ <foreach item="item" collection="zoneId" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ <if test="bindSku != null and bindSku != ''"> and b.userdefine10 = #{bindSku}</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="selectAllocatingInventoryAccordingConditionsOrderBy" parameterType="BaseLocationInfo" resultMap="BaseLocationInfoLotattResult">
|
|
|
+ select
|
|
|
+ b.*
|
|
|
+ , 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 is_empty = 'N' and stock_status = '00'
|
|
|
+ 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,
|