Package com.google.code.lightssh.common.dao

Examples of com.google.code.lightssh.common.dao.SearchCondition


  }

  @Override
  public SystemParam getByName(String name) {
    ListPage<SystemParam> page = new ListPage<SystemParam>(1);
    SearchCondition sc = new SearchCondition();
    sc.equal("name", name );
    page = dao.list(page, sc);
   
    return (page.getList()==null||page.getList().isEmpty())
      ?null:page.getList().get(0);
  }
View Full Code Here


  }
 
  @Override
  public SystemParam getByGroupAndName(String group, String name) {
    ListPage<SystemParam> page = new ListPage<SystemParam>(1);
    SearchCondition sc = new SearchCondition();
    sc.equal("name", name );
    sc.equal("group", group );
    page = dao.list(page, sc);
   
    return (page.getList()==null||page.getList().isEmpty())
      ?null:page.getList().get(0);
  }
View Full Code Here

  }

  @Override
  public List<SystemParam> listByGroup(String group) {
    ListPage<SystemParam> page = new ListPage<SystemParam>( );
    SearchCondition sc = new SearchCondition();
    sc.equal("group", group );
    page = dao.list(page, sc);
   
    return page.getList();
  }
View Full Code Here

   
    String group = StringUtil.clean(param.getGroup())==null
      ?SystemParam.DEFAULT_GROUP_NAME:param.getGroup();
   
    ListPage<SystemParam> page = new ListPage<SystemParam>(1);
    SearchCondition sc = new SearchCondition();
    sc.equal("group", group ).equal("name",param.getName() );
    page = dao.list(page, sc);
   
    SystemParam exists = (page.getList()==null||page.getList().isEmpty())
      ?null:page.getList().get(0);
 
View Full Code Here

 
    return exists == null || exists.getIdentity().equals(param.getIdentity() );
  }
 
  public ListPage<SystemParam> list(ListPage<SystemParam> page,SystemParam t ) {
    SearchCondition sc = new SearchCondition();
    if( t != null ){
      if( t.getName() != null )
        sc.like("name",t.getName() );
     
      if( t.getGroup() != null )
        sc.like("group",t.getGroup() );
     
      if( t.getValue() != null )
        sc.like("value",t.getValue() );
    }
    return dao.list(page,sc);
  }
View Full Code Here

   * 工作任务队列大小
   */
  @Override
  public int getJobQueueSize( String jobTypeId ){
    ListPage<JobQueue> page = new ListPage<JobQueue>(0);
    SearchCondition sc = new SearchCondition();
    if( !StringUtils.isEmpty(jobTypeId) ){
      sc.equal("type.id", jobTypeId.trim() );
    }
    page = dao.list(page, sc);
   
    return page.getAllSize();
  }
View Full Code Here

   */
  public ListPage<JobQueue> list( ListPage<JobQueue> page,JobQueue t ){
    if( page == null )
      page = new ListPage<JobQueue>();
   
    SearchCondition sc = new SearchCondition();
    if( t != null ){
      if( t.getType() != null ){
        if( !StringUtils.isEmpty(t.getType().getId()) ){
          sc.equal("type.id", t.getType().getId().trim() );
        }
      }
     
      //...
    }
View Full Code Here

  public PlanDao getDao(){
    return (PlanDao)this.dao;
  }
 
  public ListPage<Plan> list(ListPage<Plan> page,Plan t ){
    SearchCondition sc = new SearchCondition();
    if( t != null ){
      if( !StringUtils.isEmpty(t.getId()) )
        sc.like( "id",t.getId() );
     
      if( t.get_pftPeriod() != null ){
        Calendar cal = Calendar.getInstance();
        Date start = t.get_pftPeriod().getStart();
        Date end = t.get_pftPeriod().getEnd();
       
        if( start != null ){
          cal.setTime(start);
          sc.greateThanOrEqual("planFireTime",cal);
        }
       
        if( end != null ){
          Calendar cal_end = Calendar.getInstance();
          cal_end.setTime(end);
          cal_end.add(Calendar.DAY_OF_MONTH, 1);
          cal_end.add(Calendar.SECOND, -1);
          sc.lessThanOrEqual("planFireTime",cal_end);
        }
      }
    }
   
    return super.list(page, sc);
View Full Code Here

   * 未成功记录
   */
  @Deprecated
  protected int getUnsuccessfulCount(String planId,String planDetailId ){
    ListPage<PlanDetail> page = new ListPage<PlanDetail>(0);
    SearchCondition sc = new SearchCondition();
    sc.equal("plan.id", planId);
    sc.notEqual("id", planDetailId);
    sc.notEqual("status", Status.SUCCESS );
   
    page = planDetailDao.list(page, sc);
   
    return page.getAllSize();
  }
View Full Code Here

  public List<PlanDetail> listDetail(String planId){
    if( StringUtils.isEmpty(planId) )
      return null;
   
    ListPage<PlanDetail> page = new ListPage<PlanDetail>(Integer.MAX_VALUE);
    SearchCondition sc = new SearchCondition();
    sc.equal("plan.id", planId );
   
    page.addAscending("sequence");
    page = this.planDetailDao.list(page, sc);
   
    return page.getList();
View Full Code Here

TOP

Related Classes of com.google.code.lightssh.common.dao.SearchCondition

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.