コード例 #1
0
 /**
  * 查询店铺授权
  *
  * @param shopAuth
  * @return
  */
 @Transactional(readOnly = true)
 public List<ShopAuth> getShopAuth(ShopAuth shopAuth) {
   if (logger.isInfoEnabled()) {
     logger.info("getShop方法参数为shop[{}]", shopAuth);
   }
   Search search = new Search(ShopAuth.class);
   if (shopAuth != null) {
     if (!NumberUtil.isNullOrZero(shopAuth.getId())) {
       search.addFilterEqual("id", shopAuth.getId());
     }
   }
   search.addFilterEqual("isDelete", false);
   return generalDAO.search(search);
 }
コード例 #2
0
  /**
   * 根据条件查询唯一的授权信息
   *
   * @param shopAuth
   * @return
   */
  public ShopAuth getShopAuthByCondition(ShopAuth shopAuth) {
    if (logger.isInfoEnabled()) {
      logger.info("getShop方法参数为shop[{}]", shopAuth);
    }
    Search search = new Search(ShopAuth.class);
    if (shopAuth != null) {
      if (!NumberUtil.isNullOrZero(shopAuth.getId())) {
        search.addFilterEqual("id", shopAuth.getId());
      }
    }
    search.addFilterEqual("isDelete", false);

    List<ShopAuth> shopAuthList = generalDAO.search(search);
    return CollectionUtils.isNotEmpty(shopAuthList) ? shopAuthList.get(0) : null;
  }