Example #1
0
  public JwList<AcUser> getAllActiveCargoWorkersByRole() {
    AcUserRoleDb ur = null;

    JwSqlSelect st = getSelect();
    st.from(ur.TABLE, ur.ALIAS);
    st.where().isEqual(ur.ALIAS, ur.ROLE, AcRoleEnum.CARGO_WORKER.getCode());
    st.where().isEqualColumn(ur.ALIAS, ur.LOGIN, ALIAS, LOGIN);
    st.where().isTrue(ALIAS, ACTIVE);
    return composeList(st);
  }
Example #2
0
  public JwList<AcUser> getAllActiveCargoWorkersByRoleForAirports(JwList<String> airportCodes) {
    AcUserAirportDb ua = null;
    AcUserRoleDb ur = null;

    JwSqlSelect st = getSelect();
    st.from(ua.TABLE, ua.ALIAS);
    st.from(ur.TABLE, ur.ALIAS);
    st.where().isEqual(ur.ALIAS, ur.ROLE, AcRoleEnum.CARGO_WORKER.getCode());
    st.where().isEqualColumn(ur.ALIAS, ur.LOGIN, ua.ALIAS, ua.LOGIN);
    st.where().isIn(ua.ALIAS, ua.AIRPORT_CODE, airportCodes.toStringArray());
    st.where().isEqualColumn(ua.ALIAS, ua.LOGIN, ALIAS, LOGIN);
    st.where().isTrue(ALIAS, ACTIVE);
    return composeList(st);
  }
Example #3
0
  public JwList<AcUser> getAllActiveCargoWorkersByRoleGroupForAirport(String airportCode) {
    AcUserAirportDb ua = null;
    AcUserRoleDb ur = null;
    AcRoleGroupRoleDb rgr = null;

    JwSqlSelect st = getSelect();
    st.from(ua.TABLE, ua.ALIAS);
    st.from(ur.TABLE, ur.ALIAS);
    st.from(rgr.TABLE, rgr.ALIAS);
    st.where().isEqual(rgr.ALIAS, rgr.ROLE, AcRoleEnum.CARGO_WORKER.getCode());
    st.where().isEqualColumn(rgr.ALIAS, rgr.ROLE_GROUP_CODE, ur.ALIAS, ur.ROLE);
    st.where().isEqualColumn(ur.ALIAS, ur.LOGIN, ua.ALIAS, ua.LOGIN);
    st.where().isEqual(ua.ALIAS, ua.AIRPORT_CODE, airportCode);
    st.where().isEqualColumn(ua.ALIAS, ua.LOGIN, ALIAS, LOGIN);
    st.where().isTrue(ALIAS, ACTIVE);
    return composeList(st);
  }