getWaterLineFieldWhere method

WhereData getWaterLineFieldWhere(
  1. int? id,
  2. int? table_field_id,
  3. List<ChangeType>? changeTypeList,
  4. UiType? uiType,
  5. NotifyState? notifyState,
  6. int? localTs,
  7. SqlOperator tsOperator,
  8. bool? includeMax,
)

Implementation

WhereData getWaterLineFieldWhere(
    int? id,
    int? table_field_id,
    List<ChangeType>? changeTypeList,
    UiType? uiType,
    NotifyState? notifyState,
    int? localTs,
    SqlOperator tsOperator,
    bool? includeMax) {
  if (!initialized) throw ArgumentError(AbstractDao.C_MUST_INIT);
  WhereData whereData = WhereData();
  whereData.set("id", SqlOperator.EQUAL, id);
  if (includeMax == null) includeMax = false;

  if (table_field_id != null)
    whereData.set("table_field_id", SqlOperator.EQUAL, table_field_id);

  if (changeTypeList != null) {
    String inString = "";
    bool firstPass = true;
    for (ChangeType ct in changeTypeList) {
      if (!firstPass) inString += ",";
      inString += "" + WaterLineField.getChangeTypeValue(ct).toString();
      firstPass = false;
    }
    whereData.set("change_type", SqlOperator.IN, inString);
  }
  if (uiType != null)
    whereData.set(
        "ui_type", SqlOperator.EQUAL, WaterLineField.getUiTypeValue(uiType));
  if (notifyState != null)
    whereData.set("notify_state", SqlOperator.EQUAL,
        WaterLineField.getNotifyStateValue(notifyState));
  whereData.set("local_ts", tsOperator, localTs);
  if (!includeMax)
    whereData.set("id", SqlOperator.LESS, DbConstants.C_MEDIUMINT_MAX);
  return whereData;
}