eas之EntityViewInfo对象mainQuery中查询条件

时间:2024-11-10 21:36:20

EntityViewInfo对象mainQuery中查询条件:
  添加查询字段:(Sql语句中的selectz子句内容)
    SelecttorItemCollection sic=new SelectorItemCollection();
    sic.add(new SelectorItemInfo("id"));
    sic.add(new SelectorItem("name"));
    this.mainQuery.getSelectors().addObjectCollection(sic);

添加过滤条件 (Sql语句中的where子句内容)
  FilterInfo filterInfo = new FilterInfo();
  StringBuffer maskString = new StringBuffer();
  filterInfo.getFilterItems().add(new FilterItemInfo("id", idLists, CompareType.INCLUDE));
  filterInfo.getFilterItems().add(new FilterItemInfo("fiVouchered",Boolean.TRUE));
  maskString.append("#0 AND #1");
  filterInfo.setMaskString(maskString.toString());
  filterInfo.mergeFilter(this.mainQuery.getFilter(), "AND");
  this.mainQuery.setFilter(filterInfo);

添加排序条件(sql语句中的order by子句内容)
  SorterItemInfo sorterInfo=new SorterItemInfo("owner.number");
  sorterInfo.setSortType(SortType.ASCEND);
  this.mainQuery.getSorter().add(sorterInfo);