use of com.webank.wedatasphere.qualitis.rule.entity.TemplateStatisticsInputMeta in project Qualitis by WeBankFinTech.
the class JdbcTranslator method sentenceWithoutRunDate.
private void sentenceWithoutRunDate(Set<TemplateStatisticsInputMeta> templateStatisticsInputMetas, List<RuleVariable> ruleVariables, List<String> list, String applicationId, String createTime, Integer count, Long ruleId, Map<String, Long> ruleMetricMap) throws RuleVariableNotSupportException, RuleVariableNotFoundException {
for (TemplateStatisticsInputMeta s : templateStatisticsInputMetas) {
String funcName = s.getFuncName();
String value = getValue(ruleVariables, s);
String persistSentence = statisticsAndSaveResultTemplate.replace(STATISTICS_VALUE_PLACEHOLDER, funcName + "(" + value + ")").replace(STATISTICS_APPLICATION_ID_PLACEHOLDER, applicationId).replace(STATISTICS_RESULT_TYPE_PLACEHOLDER, s.getResultType()).replace(STATISTICS_CREATE_TIME_PLACEHOLDER, createTime).replace(SqlTemplateConverter.VARIABLE_NAME_PLACEHOLDER, getVariable(count)).replace(STATISTICS_RULE_ID_PLACEHOLDER, ruleId + "");
if (ruleMetricMap.get(value) != null) {
persistSentence = persistSentence.replace(STATISTICS_RULE_METRIC_ID_PLACEHOLDER, ruleMetricMap.get(value) + "");
} else {
if (CollectionUtils.isNotEmpty(ruleMetricMap.values())) {
persistSentence = persistSentence.replace(STATISTICS_RULE_METRIC_ID_PLACEHOLDER, ruleMetricMap.values().iterator().next() + "");
} else {
persistSentence = persistSentence.replace(STATISTICS_RULE_METRIC_ID_PLACEHOLDER, "-1");
}
}
persistSentence = persistSentence.replace(STATISTICS_RUN_DATE_PLACEHOLDER, "-1");
list.add(persistSentence);
LOGGER.info("Succeed to get persist sentence. sentence: {}", persistSentence);
}
}
Aggregations