/** * 根据条件查询唯一的原始订单 * * @param originalOrder * @return */ @Transactional(readOnly = true) public OriginalOrder getOriginalOrderByCondition(OriginalOrder originalOrder) { Search search = new Search(OriginalOrder.class); if (originalOrder != null) { if (StringUtils.isNotBlank(originalOrder.getPlatformOrderNo())) { search.addFilterEqual("platformOrderNo", originalOrder.getPlatformOrderNo()); } } List<OriginalOrder> originalOrderList = generalDAO.search(search); return CollectionUtils.isEmpty(originalOrderList) ? null : originalOrderList.get(0); }
/** * 查询 * * @param originalOrder * @return */ @Transactional(readOnly = true) public List<OriginalOrder> getOriginalOrder( OriginalOrder originalOrder, Date startTime, Date endTime) { if (logger.isInfoEnabled()) { logger.info( String.format( "getOriginalOrder方法参数为originalOrder[{}],startTime[{}],endTime[{}]", originalOrder, startTime, endTime)); } Search search = new Search(OriginalOrder.class); if (originalOrder != null) { if (StringUtils.isNotBlank(originalOrder.getPlatformOrderNo())) { search.addFilterLike( "platformOrderNo", "%" + originalOrder.getPlatformOrderNo().trim() + "%"); } if (!NumberUtil.isNullOrZero(originalOrder.getShopId())) { search.addFilterEqual("shopId", originalOrder.getShopId()); } if (!NumberUtil.isNullOrZero(originalOrder.getProcessed())) { search.addFilterEqual("processed", originalOrder.getProcessed()); } if (!NumberUtil.isNullOrZero(originalOrder.getOutShopId())) { search.addFilterEqual("outShopId", originalOrder.getOutShopId()); } if (!NumberUtil.isNullOrZero(originalOrder.getStatus())) { search.addFilterEqual("status", originalOrder.getStatus()); } if (originalOrder.getPlatformType() != null) { search.addFilterEqual("platformType", originalOrder.getPlatformType()); } if (startTime != null) { search.addFilterGreaterOrEqual("buyTime", startTime); } if (endTime != null) { search.addFilterLessOrEqual("buyTime", endTime); } } return generalDAO.search(search); }