This commit is contained in:
AKurakin 2024-02-12 13:43:57 +03:00
parent 50962c34b5
commit bc5377a752

View file

@ -52,14 +52,12 @@ public class RegistryMapStore extends TemplateMapStore<Registry> {
LocalDate today = LocalDate.now();
log.debug("loadAllKeys from {} with condition and today {}", getTableName(), today);
List<Long> keys;
String sql = "select id from " + getTableName() + " WHERE registry_designation='A' OR " +
"(registry_designation='D' AND (clearing_date = ? OR registry_status='PROC' OR registry_status='MNG')) OR" +
"((registry_designation='C' OR registry_designation='L') AND clearing_date=?) OR" +
"((registry_designation='O' OR registry_designation='T') AND (clearing_date=? OR registry_status='PROC' OR registry_status='MNG'))";
String sql = "select id from " + getTableName() + " WHERE registry_status<>'OK' or registry_status='OK' " +
"and (clearing_date = ? OR updated_at::date = ?)";
try {
keys = jdbcTemplate.query(sql,
(resultSet, i) -> resultSet.getLong("id"),
new Object[]{today, today, today});
new Object[]{today, today});
} catch (Throwable e) {
log.error("At load keys from {} (sql \"{}\"): {}", getTableName(), sql, ExceptionUtils.getStackTrace(e));
throw e;