| | |
| | | @Repository |
| | | public interface LocMastMapper extends BaseMapper<LocMast> { |
| | | |
| | | List<LocMast> queryFreeLocMast(@Param("rows") List<Integer> rows, @Param("rowsLen") Integer rowsLen, @Param("locType1") Short locType1); |
| | | |
| | | LocMast queryFreeLocMast0(@Param("row") Integer row, @Param("locType1") Short locType1); |
| | | |
| | | @Select("select loc_no from asr_loc_mast where 1=1 and loc_sts = 'O' and crn_no = #{crnNo}") |
| | | List<String> queryGroupEmptyStock(Integer crnNo); |
| | | |
| | | @Select("select count(*) as count from asr_loc_mast where 1=1 and loc_sts = 'O' and crn_no = #{crnNo}") |
| | | Integer selectEmptyLocCount(@Param("crnNo") Integer crnNo); |
| | | @Select("select count(*) as count from asr_loc_mast where 1=1 and loc_sts = 'O' and loc_type3 = #{locType3} and lev1 = #{lev}") |
| | | Integer selectEmptyLocCount(@Param("locType3") Short locType3, @Param("lev") Integer lev); |
| | | |
| | | List<LocMast> queryFreeLocMast2(Short locType1, Integer rowBeg, Integer rowEnd, Integer bayBeg, Integer bayEnd, Integer levBeg, Integer levEnd); |
| | | |
| | | /** |
| | | * 搜索指定区域可用库位 |
| | | */ |
| | | List<LocMast> selectAreaEmpty(Short locType1, Integer locType3); |
| | | |
| | | LocMast selectAvailableNearLocDesc(@Param("groupLoc") List<String> groupOuterLoc); |
| | | |
| | |
| | | |
| | | List<LocMast> selectEmptyByLocNos(@Param("locNos") List<String> locNos); |
| | | |
| | | LocMast selectByLoc(String locNo); |
| | | |
| | | Integer updateLocType2ByRBL(Integer locType2, Integer startRow, Integer endRow, Integer startBay, Integer endBay, Integer startLev, Integer endLev); |
| | | |
| | | } |
| | |
| | | /** |
| | | * 检索可用库位 |
| | | */ |
| | | List<LocMast> queryFreeLocMast(List<Integer> rows, Integer rowsLen, Short locType1); |
| | | List<LocMast> queryFreeLocMast2(Short locType1, Integer rowBeg, Integer rowEnd, Integer bayBeg, Integer bayEnd, Integer levBeg, Integer levEnd); |
| | | |
| | | /** |
| | | * 检索可用库位0 |
| | | * 搜索指定区域可用库位 |
| | | */ |
| | | LocMast queryFreeLocMast0(Integer row, Short locType1); |
| | | List<LocMast> selectAreaEmpty(Short locType1, Integer locType3); |
| | | |
| | | /** |
| | | * 获取同组货架的空库位 |
| | |
| | | * @return |
| | | */ |
| | | Boolean checkEmptyCount(LocMast locMast, int quaOfBlank); |
| | | |
| | | /** |
| | | * 当前库存明细是否为整托 |
| | | */ |
| | | Boolean checkWhole(List<LocDetl> locDetls); |
| | | |
| | | /** |
| | | * 判断是否是最外层的库位 |
| | |
| | | |
| | | List<LocMast> selectEmptyByLocNos(List<String> locNos); |
| | | |
| | | LocMast selectByLoc(String locNo); |
| | | |
| | | Integer updateLocType2ByRBL(Integer locType2, Integer startRow, Integer endRow, Integer startBay, Integer endBay, Integer startLev, Integer endLev); |
| | | |
| | | } |
| | |
| | | private WorkService workService; |
| | | |
| | | @Override |
| | | public List<LocMast> queryFreeLocMast(List<Integer> rows, Integer rowsLen, Short locType1) { |
| | | return this.baseMapper.queryFreeLocMast(rows, rowsLen, locType1); |
| | | } |
| | | |
| | | @Override |
| | | public List<LocMast> queryFreeLocMast2(Short locType1, Integer rowBeg, Integer rowEnd, Integer bayBeg, Integer bayEnd, Integer levBeg, Integer levEnd) { |
| | | return this.baseMapper.queryFreeLocMast2(locType1, rowBeg, rowEnd, bayBeg, bayEnd, levBeg, levEnd); |
| | | } |
| | | |
| | | @Override |
| | | public LocMast queryFreeLocMast0(Integer row, Short locType1) { |
| | | return this.baseMapper.queryFreeLocMast0(row, locType1); |
| | | public List<LocMast> selectAreaEmpty(Short locType1, Integer locType3) { |
| | | return this.baseMapper.selectAreaEmpty(locType1, locType3); |
| | | } |
| | | |
| | | @Override |
| | |
| | | if (locMast == null) { |
| | | return false; |
| | | } |
| | | return this.baseMapper.selectEmptyLocCount(locMast.getCrnNo()) > quaOfBlank; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean checkWhole(List<LocDetl> locDetls) { |
| | | return null; |
| | | return this.baseMapper.selectEmptyLocCount(locMast.getLocType3(), locMast.getLev1()) > quaOfBlank; |
| | | } |
| | | |
| | | @Override |
| | |
| | | public LocMast findNearloc(String locNo) { |
| | | int row = getRow(locNo); |
| | | LocMast locMast = null; |
| | | if (row>19) { |
| | | List<String> groupOuterLoc = Utils.getGroupOuterLoc(locNo); |
| | | if (!Cools.isEmpty(groupOuterLoc)) { |
| | | locMast = this.baseMapper.selectAvailableNearLocDesc(groupOuterLoc); |
| | | } |
| | | |
| | | }else { |
| | | List<String> groupOuterLoc = Utils.getGroupOuterLoc(locNo); |
| | | if (!Cools.isEmpty(groupOuterLoc)) { |
| | | locMast = this.baseMapper.selectAvailableNearLocAsc(groupOuterLoc); |
| | | } |
| | | List<String> groupOuterLoc = Utils.getGroupOuterLoc(locNo); |
| | | if (!Cools.isEmpty(groupOuterLoc)) { |
| | | locMast = this.baseMapper.selectAvailableNearLocAsc(groupOuterLoc); |
| | | } |
| | | return locMast; |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public LocMast selectByLoc(String locNo) { |
| | | return this.baseMapper.selectByLoc(locNo); |
| | | } |
| | | |
| | | @Override |
| | | public Integer updateLocType2ByRBL(Integer locType2, Integer startRow, Integer endRow, Integer startBay, Integer endBay, Integer startLev, Integer endLev) { |
| | | return this.baseMapper.updateLocType2ByRBL(locType2, startRow, endRow, startBay, endBay, startLev, endLev); |
| | | } |
| | |
| | | for (Integer row0 : CommonService.THIRD_GROUP_ROW_LIST) { |
| | | result.add(zerofill(String.valueOf(row0), 2) + locNo.substring(2)); |
| | | } |
| | | Collections.reverse(result); |
| | | return result; |
| | | } |
| | | if (CommonService.FOURTH_GROUP_ROW_LIST.contains(row)) { |
| | |
| | | // 目标库位 |
| | | LocMast locMast = null; |
| | | |
| | | //混载找库位 |
| | | locMast = getLocNoStep1(matNos, locTypeDto); |
| | | if (locMast != null) { |
| | | //找到库位,返回dto |
| | | return getLocNoStep6(staDescId, sourceStaNo, locMast);//返回dto |
| | | } |
| | | |
| | | //库位规则 |
| | | locMast = getLocNoStep2(matNos, locTypeDto); |
| | | locMast = getLocNoStepRule(matNos, locTypeDto); |
| | | if (locMast != null) { |
| | | //找到库位,返回dto |
| | | return getLocNoStep6(staDescId, sourceStaNo, locMast);//返回dto |
| | |
| | | //找到库位,返回dto |
| | | return getLocNoStep6(staDescId, sourceStaNo, locMast);//返回dto |
| | | } |
| | | // 根据物料频率查询库位 |
| | | |
| | | //搜索单品 |
| | | locMast = getLocNoStepSingle(matNos, locTypeDto); |
| | | if (locMast != null) { |
| | | //找到库位,返回dto |
| | | return getLocNoStep6(staDescId, sourceStaNo, locMast);//返回dto |
| | | } |
| | | |
| | | // 如果没有相近物料,则按规则轮询货架 |
| | | // 开始查找库位 ==============================>> |
| | | locMast = getLocNoStep5(locTypeDto, times); |
| | | //搜索混放 |
| | | locMast = getLocNoStepMixed(matNos, locTypeDto, times); |
| | | if (locMast != null) { |
| | | //找到库位,返回dto |
| | | return getLocNoStep6(staDescId, sourceStaNo, locMast);//返回dto |
| | |
| | | } |
| | | |
| | | /** |
| | | * 混载找库位 |
| | | */ |
| | | private LocMast getLocNoStep1(List<String> matNos, LocTypeDto locTypeDto) { |
| | | //判断当前货物是否为混载货物 |
| | | String firstMatNos = matNos.get(0); |
| | | boolean mixed = false;//默认不是混载货物 |
| | | for (String matNo : matNos) { |
| | | if (!firstMatNos.equals(matNo)) { |
| | | mixed = true;//混载货物 |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (!mixed) { |
| | | return null;//不是混载货物,直接跳出当前任务 |
| | | } |
| | | |
| | | // 找混载库位规则 |
| | | List<LocRule> locRules = locRuleService.findMixed(); |
| | | if (locRules == null || locRules.size() == 0) { |
| | | return null;//没有混载规则,跳出当前任务 |
| | | } |
| | | |
| | | for (LocRule locRule : locRules) { |
| | | if (locRule == null) { |
| | | continue; |
| | | } |
| | | |
| | | List<LocMast> locMasts = locMastService.queryFreeLocMast2(locTypeDto.getLocType1(), locRule.getRowBeg(), locRule.getRowEnd(), locRule.getBayBeg(), locRule.getBayEnd(), locRule.getLevBeg(), locRule.getLevEnd()); |
| | | |
| | | for (LocMast one : locMasts) { |
| | | LocMast locMast0 = locMastService.findOutMost(one.getLocNo()); |
| | | if (null != locMast0) { |
| | | // 浅库位符合尺寸检测 |
| | | if (VersionUtils.locMoveCheckLocType(locMast0, locTypeDto)) { |
| | | // 因库位移转、需预留空库位 |
| | | if (locMastService.checkEmptyCount(locMast0, 10)) { |
| | | return locMast0;//找到空余的混载库位 |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | if (locRules.get(0).getKeepGo() == 0) { |
| | | //找不到空库位,且禁止继续寻找其他非混载区域库位 |
| | | //找不到库位,抛出异常 |
| | | throw new CoolException("混载区域没有空库位"); |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 库位规则 |
| | | */ |
| | | private LocMast getLocNoStep2(List<String> matNos, LocTypeDto locTypeDto) { |
| | | private LocMast getLocNoStepRule(List<String> matNos, LocTypeDto locTypeDto) { |
| | | LocMast locMast = null; |
| | | // 库区锁定 |
| | | List<LocRule> locRules = locRuleService.find(Cools.isEmpty(matNos) ? null : matNos.get(0)); |
| | | if (locRules == null || locRules.size() == 0) { |
| | | return null;//没有库位规则,跳出当前任务 |
| | | } |
| | | |
| | | for (LocRule locRule : locRules) { |
| | | if (locRule == null) { |
| | | continue; |
| | | //库位规则只能在单品货物中生效 |
| | | if (matNos.size() == 1) { |
| | | // 库区锁定 |
| | | List<LocRule> locRules = locRuleService.find(Cools.isEmpty(matNos) ? null : matNos.get(0)); |
| | | if (locRules == null || locRules.isEmpty()) { |
| | | return null;//没有库位规则,跳出当前任务 |
| | | } |
| | | |
| | | List<LocMast> locMasts = locMastService.queryFreeLocMast2(locTypeDto.getLocType1(), locRule.getRowBeg(), locRule.getRowEnd(), locRule.getBayBeg(), locRule.getBayEnd(), locRule.getLevBeg(), locRule.getLevEnd()); |
| | | for (LocMast one : locMasts) { |
| | | LocMast locMast0 = locMastService.findOutMost(one.getLocNo()); |
| | | if (null != locMast0) { |
| | | // 浅库位符合尺寸检测 |
| | | if (VersionUtils.locMoveCheckLocType(locMast0, locTypeDto)) { |
| | | // 因库位移转、需预留空库位 |
| | | if (locMastService.checkEmptyCount(locMast0, 10)) { |
| | | return locMast0; |
| | | } |
| | | for (LocRule locRule : locRules) { |
| | | if (locRule == null) { |
| | | continue; |
| | | } |
| | | |
| | | List<LocMast> locMasts = locMastService.queryFreeLocMast2(locTypeDto.getLocType1(), locRule.getRowBeg(), locRule.getRowEnd(), locRule.getBayBeg(), locRule.getBayEnd(), locRule.getLevBeg(), locRule.getLevEnd()); |
| | | for (LocMast locMast0 : locMasts) { |
| | | //预留空库位 |
| | | if (locMastService.checkEmptyCount(locMast0, 10)) { |
| | | return locMast0; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (locRules.get(0).getKeepGo() == 0) { |
| | | //找不到空库位,且禁止继续寻找其他非混载区域库位 |
| | | //找不到库位,抛出异常 |
| | | throw new CoolException("规则区域没有空库位"); |
| | | if (locRules.get(0).getKeepGo() == 0) { |
| | | //找不到空库位,且禁止继续寻找其他非混载区域库位 |
| | | //找不到库位,抛出异常 |
| | | throw new CoolException("规则区域没有空库位"); |
| | | } |
| | | } |
| | | |
| | | return locMast; |
| | |
| | | return locMast; |
| | | } |
| | | |
| | | // 如果没有相近物料,则按规则轮询货架 |
| | | private LocMast getLocNoStep5(LocTypeDto locTypeDto, int times) { |
| | | // 搜索混放 |
| | | private LocMast getLocNoStepMixed(List<String> matNos, LocTypeDto locTypeDto, int times) { |
| | | LocMast locMast = null; |
| | | // 1.当检索库排为浅库位排时,优先寻找当前库排的深库位排 |
| | | List<LocMast> peakLocs = locMastService.selectAllPeakLoc(); |
| | | for (LocMast peakLoc : peakLocs) { |
| | | List<String> groupInnerLoc = Utils.getGroupInnerLoc(peakLoc.getLocNo()); |
| | | if (!Cools.isEmpty(groupInnerLoc)) { |
| | | if (!locMastService.checkAllLocEmpty(groupInnerLoc)) continue; |
| | | locMast = peakLoc; |
| | | break; |
| | | } else { |
| | | locMast = peakLoc; |
| | | break; |
| | | |
| | | if (matNos.size() > 1) { |
| | | List<LocMast> locMasts = locMastService.selectAreaEmpty(locTypeDto.getLocType1(), 1);//搜索混放库位 |
| | | //混放区域直接取第一个即可 |
| | | for (LocMast mast : locMasts) { |
| | | //预留空库位 |
| | | if (locMastService.checkEmptyCount(mast, 10)) { |
| | | locMast = mast; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | return locMast; |
| | | } |
| | | |
| | | // 搜索单品 |
| | | private LocMast getLocNoStepSingle(List<String> matNos, LocTypeDto locTypeDto) { |
| | | LocMast locMast = null; |
| | | // 1.先搜索单品 |
| | | if (matNos.size() == 1) { |
| | | //单品 |
| | | List<LocMast> locMasts = locMastService.selectAreaEmpty(locTypeDto.getLocType1(), 2);//搜索单品库位 |
| | | for (LocMast mast : locMasts) { |
| | | List<String> groupLoc = Utils.getGroupLoc(mast.getLocNo()); |
| | | if (!locMastService.checkAllLocEmpty(groupLoc)) { |
| | | continue; |
| | | } |
| | | |
| | | LocMast tmp = null; |
| | | for (String loc : groupLoc) { |
| | | LocMast locMast1 = locMastService.selectByLoc(loc); |
| | | if (locMast1 == null) { |
| | | continue; |
| | | } |
| | | |
| | | if (!locMast1.getLocSts().equals("O")) { |
| | | continue; |
| | | } |
| | | |
| | | tmp = locMast1; |
| | | break; |
| | | } |
| | | |
| | | //预留空库位 |
| | | if (tmp != null && locMastService.checkEmptyCount(mast, 10)) { |
| | | locMast = tmp; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return locMast; |
| | | } |
| | | |
| | | //返回dto |
| | | private StartupDto getLocNoStep6(Integer staDescId, Integer sourceStaNo, LocMast locMast) { |
| | | StartupDto startupDto = new StartupDto(); |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | return R.error("源站编号不能为空"); |
| | | } |
| | | List<WaitPakin> waitPakins = null; |
| | | Mat mat = null; |
| | | ArrayList<Mat> mats = new ArrayList<>(); |
| | | if (param.getIoType() == 1) { |
| | | if (Cools.isEmpty(param.getBarcode())) { |
| | | return R.error("条码不能为空"); |
| | |
| | | // } |
| | | waitPakins = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode())); |
| | | |
| | | if (Cools.isEmpty(waitPakins) || waitPakins.size()!=1) { |
| | | if (Cools.isEmpty(waitPakins)) { |
| | | WrkMast wrkMast = wrkMastService.selectByBarcode(param.getBarcode()); |
| | | if (wrkMast != null && (wrkMast.getIoType() == 103 || wrkMast.getIoType() == 104 || wrkMast.getIoType() == 107)) { |
| | | return R.parse(CodeRes.PICK_600); |
| | | } |
| | | return R.parse(CodeRes.NO_COMB_700); |
| | | } |
| | | mat = matService.selectByMatnr(waitPakins.get(0).getMatnr()); |
| | | mat.setWeight(waitPakins.get(0).getAnfme()); |
| | | |
| | | for (WaitPakin waitPakin : waitPakins) { |
| | | Mat mat = matService.selectByMatnr(waitPakin.getMatnr()); |
| | | mat.setWeight(waitPakin.getAnfme()); |
| | | mats.add(mat); |
| | | } |
| | | |
| | | int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet",param.getBarcode())); |
| | | int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet",param.getBarcode())); |
| | | if (countLoc > 0 || countWrk > 0) { |
| | |
| | | StartupDto dto = null; |
| | | switch (param.getIoType()) { |
| | | case 1://满托盘入库 |
| | | assert mat != null; |
| | | dto = startupFullPutStore(param.getSourceStaNo(), param.getBarcode(), locTypeDto, mat); |
| | | dto = startupFullPutStore(param.getSourceStaNo(), param.getBarcode(), locTypeDto, mats); |
| | | break; |
| | | case 10://空托盘入库 |
| | | dto = emptyPlateIn(param.getSourceStaNo(), locTypeDto, null); |
| | |
| | | * 全板入库 |
| | | */ |
| | | @Transactional |
| | | public StartupDto startupFullPutStore(Integer devpNo, String barcode, LocTypeDto locTypeDto, Mat mat) { |
| | | public StartupDto startupFullPutStore(Integer devpNo, String barcode, LocTypeDto locTypeDto, List<Mat> mats) { |
| | | // 源站点状态检测 |
| | | BasDevp sourceStaNo = basDevpService.checkSiteStatus(devpNo, true); |
| | | // 检索库位 |
| | | List<Mat> mats = Collections.singletonList(mat); |
| | | List<String> matnrList = mats.stream().map(Mat::getMatnr).distinct().collect(Collectors.toList()); |
| | | StartupDto dto = commonService.getLocNo(1, 1, devpNo, matnrList, locTypeDto,0); |
| | | int workNo = dto.getWorkNo(); |
| | |
| | | if (!res) { |
| | | throw new CoolException("保存工作档失败"); |
| | | } |
| | | // 生成工作档明细 |
| | | WrkDetl wrkDetl = new WrkDetl(); |
| | | wrkDetl.sync(mat); |
| | | wrkDetl.setAnfme(mat.getWeight()); |
| | | wrkDetl.setZpallet(barcode); |
| | | // wrkDetl.setAnfme(1.0D); |
| | | wrkDetl.setWrkNo(wrkMast.getWrkNo()); |
| | | wrkDetl.setIoTime(wrkMast.getIoTime()); |
| | | wrkDetl.setAppeTime(now); |
| | | wrkDetl.setModiTime(now); |
| | | if (!wrkDetlService.insert(wrkDetl)) { |
| | | throw new CoolException("保存工作明细失败"); |
| | | for (Mat mat : mats) { |
| | | // 生成工作档明细 |
| | | WrkDetl wrkDetl = new WrkDetl(); |
| | | wrkDetl.sync(mat); |
| | | wrkDetl.setAnfme(mat.getWeight()); |
| | | wrkDetl.setZpallet(barcode); |
| | | wrkDetl.setWrkNo(wrkMast.getWrkNo()); |
| | | wrkDetl.setIoTime(wrkMast.getIoTime()); |
| | | wrkDetl.setAppeTime(now); |
| | | wrkDetl.setModiTime(now); |
| | | if (!wrkDetlService.insert(wrkDetl)) { |
| | | throw new CoolException("保存工作明细失败"); |
| | | } |
| | | } |
| | | |
| | | // // 更新入库通知档 ioStatus ===>> Y |
| | | // Wrapper<WaitPakin> wrapper = new EntityWrapper<WaitPakin>() |
| | | // .eq("zpallet", barcode); |
| | |
| | | <result column="inv_wh" property="invWh" /> |
| | | <result column="mk" property="mk" /> |
| | | <result column="barcode" property="barcode" /> |
| | | <result column="Pdc_type" property="PdcType" /> |
| | | <result column="ctn_no" property="ctnNo" /> |
| | | <result column="qr_code_value" property="qrCodeValue" /> |
| | | <result column="status" property="status" /> |
| | | |
| | | </resultMap> |
| | | |
| | | <select id="queryFreeLocMast" resultMap="BaseResultMap"> |
| | | select |
| | | * |
| | | from asr_loc_mast |
| | | where 1=1 |
| | | and row1 in |
| | | <foreach item="item" collection="rows" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | and ctn_no = |
| | | ( |
| | | select |
| | | top 1 |
| | | ctn_no |
| | | from ( |
| | | select |
| | | ctn_no, |
| | | count(1) as count |
| | | from asr_loc_mast |
| | | where 1=1 |
| | | and row1 in |
| | | <foreach item="item" collection="rows" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | and loc_no not in ('0100101', '0200101', '0300101', '0400101') |
| | | and loc_sts = 'O' |
| | | group by ctn_no |
| | | ) a |
| | | where count = #{rowsLen} |
| | | order by right(ctn_no, 2) + 0 asc, left(ctn_no, 3) + 0 asc |
| | | ) |
| | | </select> |
| | | <select id="queryFreeLocMast" resultMap="BaseResultMap"> |
| | | select |
| | | * |
| | | from asr_loc_mast |
| | | where 1=1 |
| | | and row1 in |
| | | <foreach item="item" collection="rows" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | and ctn_no = |
| | | ( |
| | | select |
| | | top 1 |
| | | ctn_no |
| | | from ( |
| | | select |
| | | ctn_no, |
| | | count(1) as count |
| | | from asr_loc_mast |
| | | where 1=1 |
| | | and row1 in |
| | | <foreach item="item" collection="rows" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | and loc_no not in ('0100101', '0200101', '0300101', '0400101') |
| | | and (bay1 = 3 or bay1 = 11 or (bay1 = 7 and row1 = 10)) |
| | | and loc_sts = 'O' |
| | | group by ctn_no |
| | | ) a |
| | | where count = #{rowsLen} |
| | | order by right(ctn_no, 2) + 0 asc, left(ctn_no, 3) + 0 asc |
| | | ) |
| | | </select> |
| | | |
| | | <select id="queryFreeLocMast0" resultMap="BaseResultMap"> |
| | | select top 1 * |
| | | from asr_loc_mast |
| | | where row1=#{row} |
| | | and loc_sts='O' |
| | | order by loc_sts desc ,lev1 asc,bay1 asc |
| | | </select> |
| | | |
| | | <select id="selectAvailableNearLocDesc" resultMap="BaseResultMap"> |
| | | SELECT TOP 1 * FROM asr_loc_mast WHERE loc_sts IN ('O') |
| | |
| | | order by loc_sts desc ,lev1 asc,bay1 asc |
| | | </select> |
| | | |
| | | <select id="selectAreaEmpty" resultMap="BaseResultMap"> |
| | | select * from asr_loc_mast |
| | | where loc_sts in ('O') |
| | | and loc_type3 = #{locType3} |
| | | <if test="locType1 != null"> |
| | | and loc_type1 = #{locType1} |
| | | </if> |
| | | ORDER BY lev1,bay1,row1 |
| | | </select> |
| | | |
| | | <select id="selectEmptyByLocNos" resultMap="BaseResultMap"> |
| | | SELECT * FROM asr_loc_mast |
| | | WHERE loc_sts IN ('O') |
| | |
| | | row1 ASC |
| | | </select> |
| | | |
| | | <select id="selectByLoc" resultMap="BaseResultMap"> |
| | | select * from asr_loc_mast |
| | | where loc_no = #{locNo} |
| | | </select> |
| | | |
| | | <select id="updateLocType2ByRBL" resultMap="BaseResultMap"> |
| | | update asr_loc_mast set loc_type2 = #{locType2} |
| | | where (row1 >= #{startRow} and row1 <= #{endRow}) |