Пример #1
0
  @TraceCall
  @Override
  public Record getPageNoThrow(Context ctx, long pageId) {
    String sql =
        new SQLBuilder.Select()
            .select(StringUtils2.splitArray(BASIC_COLS, ",", true))
            .from(pageTable)
            .where("destroyed_time=0 AND page_id = ${v(page_id)}", "page_id", pageId)
            .toString();

    SQLExecutor se = getSqlExecutor();
    Record pageRec = se.executeRecord(sql, null);
    if (MapUtils.isEmpty(pageRec)) return null;

    attachBasicInfo(ctx, pageRec);
    attachDetailInfo(ctx, pageRec);
    return pageRec;
  }
Пример #2
0
 @TraceCall
 @Override
 public RecordSet getPages(Context ctx, long[] pageIds) {
   RecordSet pageRecs = new RecordSet();
   if (ArrayUtils.isNotEmpty(pageIds)) {
     String sql =
         new SQLBuilder.Select()
             .select(StringUtils2.splitArray(BASIC_COLS, ",", true))
             .from(pageTable)
             .where(
                 "destroyed_time=0 AND page_id IN (${page_ids})",
                 "page_ids",
                 StringUtils2.join(pageIds, ","))
             .toString();
     SQLExecutor se = getSqlExecutor();
     se.executeRecordSet(sql, pageRecs);
     attachBasicInfo(ctx, pageRecs);
   }
   return pageRecs;
 }