@Override
  public int findByTieIdAndTeachTypeIdAndPageCount(
      ClassroomTimetableListVo classroomTimetableListVo, int tieId) {
    Condition a =
        Tables.CLASSROOM_COURSE_TIMETABLE_INFO
            .TIE_ID
            .eq((tieId))
            .and(
                Tables.CLASSROOM_COURSE_TIMETABLE_INFO.TEACH_TYPE_ID.eq(
                    classroomTimetableListVo.getTeachTypeId()));

    if (StringUtils.hasLength(classroomTimetableListVo.getTimetableInfoFileName())) {
      a =
          a.and(
              Tables.CLASSROOM_COURSE_TIMETABLE_INFO.TIMETABLE_INFO_FILE_NAME.like(
                  "%" + classroomTimetableListVo.getTimetableInfoFileName() + "%"));
    }

    if (StringUtils.hasLength(classroomTimetableListVo.getTimetableInfoTerm())) {
      a =
          a.and(
              Tables.CLASSROOM_COURSE_TIMETABLE_INFO.TIMETABLE_INFO_TERM.like(
                  "%" + classroomTimetableListVo.getTimetableInfoTerm() + "%"));
    }

    if (StringUtils.hasLength(classroomTimetableListVo.getClassroom())) {
      a =
          a.and(
              Tables.CLASSROOM_COURSE_TIMETABLE_INFO.CLASSROOM.like(
                  "%" + classroomTimetableListVo.getClassroom() + "%"));
    }
    Record1<Integer> record1 =
        create.selectCount().from(Tables.CLASSROOM_COURSE_TIMETABLE_INFO).where(a).fetchOne();
    return record1.value1();
  }
Exemplo n.º 2
0
  @Override
  public boolean isRegistered(String chargeBoxId) {
    Record1<Integer> r =
        ctx.selectOne().from(CHARGE_BOX).where(CHARGE_BOX.CHARGE_BOX_ID.eq(chargeBoxId)).fetchOne();

    return (r != null) && (r.value1() == 1);
  }
Exemplo n.º 3
0
  @Test
  public void testPostgresUDTTypes() throws Exception {
    UUID uuid1 = UUID.randomUUID();
    UUID uuid2 = UUID.randomUUID();

    UUID[] array = new UUID[] {uuid1, uuid2};

    UUuidsRecord uuids = new UUuidsRecord();
    uuids.setU1(uuid1);
    uuids.setU2(array);

    Field<UUuidsRecord> val = val(uuids).as("val");
    Record1<UUuidsRecord> record = create().select(val).fetchOne();
    assertEquals(uuids, record.getValue(val));
    assertEquals(uuid1, record.getValue(val).getU1());
    assertEquals(uuid1, record.getValue(val).getU2()[0]);
    assertEquals(uuid2, record.getValue(val).getU2()[1]);
  }
Exemplo n.º 4
0
 @Override
 public final Condition and(Record1<T1> record) {
   return and(record.valuesRow());
 }