/** * 根据条件检索原始订单项 * * @param originalOrderItem * @return */ public List<OriginalOrderItem> findOriginalOrderItem(OriginalOrderItem originalOrderItem) { Search search = new Search(OriginalOrderItem.class); if (originalOrderItem != null) { if (NumberUtil.isNotNullOrNotZero(originalOrderItem.getOriginalOrderId())) { search.addFilterEqual("originalOrderId", originalOrderItem.getOriginalOrderId()); } } return generalDAO.search(search); }
/** * 根据条件查询唯一的原始订单项 * * @param originalOrderItem * @return */ @Transactional(readOnly = true) public OriginalOrderItem getOriginalOrderItemByCondition(OriginalOrderItem originalOrderItem) { if (logger.isInfoEnabled()) { logger.info("getOriginalOrderItemByCondition方法参数为OriginalOrderItem[{}]", originalOrderItem); } Search search = new Search(OriginalOrderItem.class); if (originalOrderItem != null) { if (StringUtils.isNotBlank(originalOrderItem.getSku())) { search.addFilterEqual("sku", originalOrderItem.getSku()); } if (StringUtils.isNotBlank(originalOrderItem.getPlatformSubOrderNo())) { search.addFilterEqual("platformSubOrderNo", originalOrderItem.getPlatformSubOrderNo()); } if (!NumberUtil.isNullOrZero(originalOrderItem.getOriginalOrderId())) { search.addFilterEqual("originalOrderId", originalOrderItem.getOriginalOrderId()); } } List<OriginalOrderItem> originalOrderItemList = generalDAO.search(search); return CollectionUtils.isEmpty(originalOrderItemList) ? null : originalOrderItemList.get(0); }