Package com.codetroopers.play.elasticsearch

Examples of com.codetroopers.play.elasticsearch.Index$Finder


  public Pagination getPage(Integer siteId, Integer sendUserId,
      Integer receiverUserId, String title, Date sendBeginTime,
      Date sendEndTime, Boolean status, Integer box, Boolean cacheable,
      int pageNo, int pageSize) {
    String hql = " select msg from CmsReceiverMessage msg where 1=1 ";
    Finder finder = Finder.create(hql);
    if (siteId != null) {
      finder.append(" and msg.site.id=:siteId")
          .setParam("siteId", siteId);
    }
    // 垃圾箱
    if (sendUserId != null && receiverUserId != null) {
      finder
          .append(
              " and ((msg.msgReceiverUser.id=:receiverUserId  and msg.msgBox =:box) or (msg.msgSendUser.id=:sendUserId  and msg.msgBox =:box) )")
          .setParam("sendUserId", sendUserId).setParam(
              "receiverUserId", receiverUserId).setParam("box",
              box);
    } else {
      if (sendUserId != null) {
        finder.append(" and msg.msgSendUser.id=:sendUserId").setParam(
            "sendUserId", sendUserId);
      }
      if (receiverUserId != null) {
        finder.append(" and msg.msgReceiverUser.id=:receiverUserId")
            .setParam("receiverUserId", receiverUserId);
      }
      if (box != null) {
        finder.append(" and msg.msgBox =:box").setParam("box", box);
      }
    }
    if (StringUtils.isNotBlank(title)) {
      finder.append(" and msg.msgTitle like:title").setParam("title",
          "%" + title + "%");
    }
    if (sendBeginTime != null) {
      finder.append(" and msg.sendTime >=:sendBeginTime").setParam(
          "sendBeginTime", sendBeginTime);
    }
    if (sendEndTime != null) {
      finder.append(" and msg.sendTime <=:sendEndTime").setParam(
          "sendEndTime", sendEndTime);
    }
    if (status != null) {
      if (status) {
        finder.append(" and msg.msgStatus =true");
      } else {
        finder.append(" and msg.msgStatus =false");
      }
    }
    finder.append(" order by msg.id desc");

    return find(finder, pageNo, pageSize);
  }
View Full Code Here


  public List getList(Integer siteId, Integer sendUserId,
      Integer receiverUserId, String title, Date sendBeginTime,
      Date sendEndTime, Boolean status, Integer box, Boolean cacheable) {
    String hql = " select msg from CmsReceiverMessage msg where 1=1  ";
    Finder finder = Finder.create(hql);
    if (siteId != null) {
      finder.append(" and msg.site.id=:siteId")
          .setParam("siteId", siteId);
    }
    // 垃圾箱
    if (sendUserId != null && receiverUserId != null) {
      finder
          .append(
              " and ((msg.msgReceiverUser.id=:receiverUserId  and msg.msgBox =:box) or (msg.msgSendUser.id=:sendUserId  and msg.msgBox =:box) )")
          .setParam("sendUserId", sendUserId).setParam(
              "receiverUserId", receiverUserId).setParam("box",
              box);
    else {
      if (sendUserId != null) {
        finder.append(" and msg.msgSendUser.id=:sendUserId").setParam(
            "sendUserId", sendUserId);
      }
      if (receiverUserId != null) {
        finder.append(" and msg.msgReceiverUser.id=:receiverUserId")
            .setParam("receiverUserId", receiverUserId);
      }
      if (box != null) {
        finder.append(" and msg.msgBox =:box").setParam("box", box);
      }
    }
    if (StringUtils.isNotBlank(title)) {
      finder.append(" and msg.msgTitle like:title").setParam("title",
          "%" + title + "%");
    }
    if (sendBeginTime != null) {
      finder.append(" and msg.sendTime >=:sendBeginTime").setParam(
          "sendBeginTime", sendBeginTime);
    }
    if (sendEndTime != null) {
      finder.append(" and msg.sendTime <=:sendEndTime").setParam(
          "sendEndTime", sendEndTime);
    }
    if (status != null) {
      if (status) {
        finder.append(" and msg.msgStatus =true");
      } else {
        finder.append(" and msg.msgStatus =false");
      }
    }
    finder.append(" order by msg.id desc");
    return find(finder);
  }
View Full Code Here

public class CmsFriendlinkDaoImpl extends
    HibernateBaseDao<CmsFriendlink, Integer> implements CmsFriendlinkDao {
  @SuppressWarnings("unchecked")
  public List<CmsFriendlink> getList(Integer siteId, Integer ctgId,
      Boolean enabled) {
    Finder f = Finder.create("from CmsFriendlink bean where 1=1");
    if (enabled != null) {
      f.append(" and bean.enabled=:enabled");
      f.setParam("enabled", enabled);
    }
    if (siteId != null) {
      f.append(" and bean.site.id=:siteId");
      f.setParam("siteId", siteId);
    }
    if (ctgId != null) {
      f.append(" and bean.category.id=:ctgId");
      f.setParam("ctgId", ctgId);
    }
    f.append(" order by bean.priority asc");
    return find(f);
  }
View Full Code Here

public class CmsAcquisitionTempDaoImpl extends
    HibernateBaseDao<CmsAcquisitionTemp, Integer> implements
    CmsAcquisitionTempDao {
  @SuppressWarnings("unchecked")
  public List<CmsAcquisitionTemp> getList(Integer siteId) {
    Finder f = Finder.create("from CmsAcquisitionTemp bean where 1=1");
    if (siteId != null) {
      f.append(" and bean.site.id=:siteId");
      f.setParam("siteId", siteId);
    }
    f.append(" order by bean.id desc");
    return find(f);
  }
View Full Code Here

  public Pagination getPage(Integer siteId, Integer sendUserId,
      Integer receiverUserId, String title, Date sendBeginTime,
      Date sendEndTime, Boolean status, Integer box, Boolean cacheable,
      int pageNo, int pageSize) {
    String hql = " select msg from CmsMessage msg where 1=1 ";
    Finder finder = Finder.create(hql);
    if (siteId != null) {
      finder.append(" and msg.site.id=:siteId")
          .setParam("siteId", siteId);
    }
    if(sendUserId != null&&receiverUserId != null){
      finder.append(" and (msg.msgSendUser.id=:sendUserId or msg.msgReceiverUser.id=:receiverUserId)").setParam(
          "sendUserId", sendUserId).setParam("receiverUserId", receiverUserId);
    }else{
      if (sendUserId != null) {
        finder.append(" and msg.msgSendUser.id=:sendUserId").setParam(
            "sendUserId", sendUserId);
      }
      if (receiverUserId != null) {
        finder.append(" and msg.msgReceiverUser.id=:receiverUserId")
            .setParam("receiverUserId", receiverUserId);
      }
    }
   
    if (StringUtils.isNotBlank(title)) {
      finder.append(" and msg.msgTitle like:title").setParam("title",
          "%" + title + "%");
    }
    if (sendBeginTime != null) {
      finder.append(" and msg.sendTime >=:sendBeginTime").setParam(
          "sendBeginTime", sendBeginTime);
    }
    if (sendEndTime != null) {
      finder.append(" and msg.sendTime <=:sendEndTime").setParam(
          "sendEndTime", sendEndTime);
    }
    if (status != null) {
      if (status) {
        finder.append(" and msg.msgStatus =true");
      } else {
        finder.append(" and msg.msgStatus =false");
      }
    }
    if (box != null) {
      finder.append(" and msg.msgBox =:box").setParam("box", box);
    }
    finder.append(" order by msg.id desc");
    return find(finder, pageNo, pageSize);
  }
View Full Code Here

TOP

Related Classes of com.codetroopers.play.elasticsearch.Index$Finder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.