use of com.nhn.dbtool.query.parser.sqlmap.model.IterateTag in project cubrid-manager by CUBRID.
the class MapperFileImpl method prepareQueryConditionList.
private void prepareQueryConditionList(Map<String, QueryCondition> queryConditionMap, List<SqlMapCondition> sqlMapConditionList) {
for (SqlMapCondition sqlMapCondition : sqlMapConditionList) {
if (sqlMapCondition == null) {
continue;
}
if (sqlMapCondition.getMyBatisTestConditions() == null || sqlMapCondition.getMyBatisTestConditions().size() == 0) {
String value = sqlMapCondition.getValue();
if (sqlMapCondition instanceof SelectKeyTag) {
continue;
}
if (!(sqlMapCondition instanceof DynamicTag)) {
if (sqlMapCondition instanceof IsNotEmptyTag) {
value = "isNotEmpty";
} else if (sqlMapCondition instanceof IsEmptyTag) {
value = "isEmpty";
} else if (sqlMapCondition.getCompareValue() != null && sqlMapCondition.getCompareValue().length() > 0) {
value = sqlMapCondition.getCompareValue();
}
if (sqlMapCondition instanceof IterateTag) {
// skip
} else if (!"dynamic_param".equals(sqlMapCondition.getProperty())) {
String key = sqlMapCondition.getProperty() + ":" + value;
queryConditionMap.put(key, new QueryCondition(sqlMapCondition.getProperty(), value));
}
}
} else {
for (MyBatisTestCondition mybatisTestCondition : sqlMapCondition.getMyBatisTestConditions()) {
if (mybatisTestCondition != null) {
String key = mybatisTestCondition.getProperty() + ":" + mybatisTestCondition.getValue();
queryConditionMap.put(key, new QueryCondition(mybatisTestCondition.getProperty(), mybatisTestCondition.getValue()));
}
}
}
if (sqlMapCondition.getChildConditionList() != null) {
prepareQueryConditionList(queryConditionMap, sqlMapCondition.getChildConditionList());
}
}
}
Aggregations