Fix format (FINERACT-854)
This commit is contained in:
committed by
Petri Tuomola
parent
5919d38f69
commit
f96fc7df39
+4
-4
@@ -60,7 +60,7 @@ public class ProvisioningEntriesReadPlatformServiceImpl implements ProvisioningE
|
||||
formattedDate = "'" + formattedDate + "'";
|
||||
LoanProductProvisioningEntryMapper mapper = new LoanProductProvisioningEntryMapper();
|
||||
final String sql = mapper.schema();
|
||||
return this.jdbcTemplate.query(sql, mapper, new Object[] {formattedDate, formattedDate, formattedDate});
|
||||
return this.jdbcTemplate.query(sql, mapper, new Object[] { formattedDate, formattedDate, formattedDate });
|
||||
}
|
||||
|
||||
private static final class LoanProductProvisioningEntryMapper implements RowMapper<LoanProductProvisioningEntryData> {
|
||||
@@ -76,9 +76,9 @@ public class ProvisioningEntriesReadPlatformServiceImpl implements ProvisioningE
|
||||
.append(" LEFT JOIN m_loan loan on sch.loan_id = loan.id")
|
||||
.append(" JOIN m_loanproduct_provisioning_mapping lpm on lpm.product_id = loan.product_id")
|
||||
.append(" JOIN m_provisioning_criteria_definition pcd on pcd.criteria_id = lpm.criteria_id and ")
|
||||
.append("(pcd.min_age <= GREATEST(datediff(?").append(",sch.duedate),0) and ")
|
||||
.append("GREATEST(datediff(?").append(",sch.duedate),0) <= pcd.max_age) and ")
|
||||
.append("pcd.criteria_id is not null ").append("LEFT JOIN m_client mclient ON mclient.id = loan.client_id ")
|
||||
.append("(pcd.min_age <= GREATEST(datediff(?").append(",sch.duedate),0) and ").append("GREATEST(datediff(?")
|
||||
.append(",sch.duedate),0) <= pcd.max_age) and ").append("pcd.criteria_id is not null ")
|
||||
.append("LEFT JOIN m_client mclient ON mclient.id = loan.client_id ")
|
||||
.append("LEFT JOIN m_group mgroup ON mgroup.id = loan.group_id ")
|
||||
.append("where loan.loan_status_id=300 and sch.duedate = ")
|
||||
.append("(select MIN(sch1.duedate) from m_loan_repayment_schedule sch1 where sch1.loan_id=loan.id and sch1.completed_derived=false)");
|
||||
|
||||
+10
-15
@@ -130,46 +130,41 @@ public class EmailReadPlatformServiceImpl implements EmailReadPlatformService {
|
||||
@Override
|
||||
public Collection<EmailData> retrieveAllPending(final SearchParameters searchParameters) {
|
||||
final String sqlPlusLimit = (searchParameters.getLimit() > 0) ? " limit 0, " + searchParameters.getLimit() : "";
|
||||
final String sql = "select " + this.emailRowMapper.schema() + " where emo.status_enum = "
|
||||
+ EmailMessageStatusType.PENDING.getValue() + sqlPlusLimit;
|
||||
final String sql = "select " + this.emailRowMapper.schema() + " where emo.status_enum = " + sqlPlusLimit;
|
||||
|
||||
return this.jdbcTemplate.query(sql, this.emailRowMapper, new Object[] {});
|
||||
return this.jdbcTemplate.query(sql, this.emailRowMapper, new Object[] { EmailMessageStatusType.PENDING.getValue() });
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<EmailData> retrieveAllSent(final SearchParameters searchParameters) {
|
||||
final String sqlPlusLimit = (searchParameters.getLimit() > 0) ? " limit 0, " + searchParameters.getLimit() : "";
|
||||
final String sql = "select " + this.emailRowMapper.schema() + " where emo.status_enum = " + EmailMessageStatusType.SENT.getValue()
|
||||
+ sqlPlusLimit;
|
||||
final String sql = "select " + this.emailRowMapper.schema() + " where emo.status_enum = ?" + sqlPlusLimit;
|
||||
|
||||
return this.jdbcTemplate.query(sql, this.emailRowMapper, new Object[] {});
|
||||
return this.jdbcTemplate.query(sql, this.emailRowMapper, new Object[] { EmailMessageStatusType.SENT.getValue() });
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> retrieveExternalIdsOfAllSent(final Integer limit) {
|
||||
final String sqlPlusLimit = (limit > 0) ? " limit 0, " + limit : "";
|
||||
final String sql = "select external_id from " + this.emailRowMapper.tableName() + " where status_enum = "
|
||||
+ EmailMessageStatusType.SENT.getValue() + sqlPlusLimit;
|
||||
final String sql = "select external_id from " + this.emailRowMapper.tableName() + " where status_enum = " + sqlPlusLimit;
|
||||
|
||||
return this.jdbcTemplate.queryForList(sql, Long.class);
|
||||
return this.jdbcTemplate.queryForList(sql, Long.class, new Object[] { EmailMessageStatusType.SENT.getValue() });
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<EmailData> retrieveAllDelivered(final Integer limit) {
|
||||
final String sqlPlusLimit = (limit > 0) ? " limit 0, " + limit : "";
|
||||
final String sql = "select " + this.emailRowMapper.schema() + " where emo.status_enum = "
|
||||
+ EmailMessageStatusType.DELIVERED.getValue() + sqlPlusLimit;
|
||||
final String sql = "select " + this.emailRowMapper.schema() + " where emo.status_enum = ?" + sqlPlusLimit;
|
||||
|
||||
return this.jdbcTemplate.query(sql, this.emailRowMapper, new Object[] {});
|
||||
return this.jdbcTemplate.query(sql, this.emailRowMapper, new Object[] { EmailMessageStatusType.DELIVERED.getValue() });
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<EmailData> retrieveAllFailed(final SearchParameters searchParameters) {
|
||||
final String sqlPlusLimit = (searchParameters.getLimit() > 0) ? " limit 0, " + searchParameters.getLimit() : "";
|
||||
final String sql = "select " + this.emailRowMapper.schema() + " where emo.status_enum = " + EmailMessageStatusType.FAILED.getValue()
|
||||
+ sqlPlusLimit;
|
||||
final String sql = "select " + this.emailRowMapper.schema() + " where emo.status_enum = ?" + sqlPlusLimit;
|
||||
|
||||
return this.jdbcTemplate.query(sql, this.emailRowMapper, new Object[] {});
|
||||
return this.jdbcTemplate.query(sql, this.emailRowMapper, new Object[] { EmailMessageStatusType.FAILED.getValue() });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+3
-2
@@ -56,12 +56,13 @@ public class ConfigurationReadPlatformServiceImpl implements ConfigurationReadPl
|
||||
|
||||
if (survey) {
|
||||
sql += " JOIN x_registered_table on x_registered_table.registered_table_name = c.name ";
|
||||
sql += " WHERE x_registered_table.category =" + DataTableApiConstant.CATEGORY_PPI;
|
||||
sql += " WHERE x_registered_table.category = ?";
|
||||
|
||||
}
|
||||
|
||||
sql += " order by c.id";
|
||||
final List<GlobalConfigurationPropertyData> globalConfiguration = this.jdbcTemplate.query(sql, this.rm, new Object[] {});
|
||||
final List<GlobalConfigurationPropertyData> globalConfiguration = this.jdbcTemplate.query(sql, this.rm,
|
||||
new Object[] { DataTableApiConstant.CATEGORY_PPI });
|
||||
|
||||
return new GlobalConfigurationData(globalConfiguration);
|
||||
}
|
||||
|
||||
+6
-8
@@ -263,7 +263,7 @@ public class GenericDataServiceImpl implements GenericDataService {
|
||||
final String sql = "select v.id, v.code_score, v.code_value from m_code m " + " join m_code_value v on v.code_id = m.id "
|
||||
+ " where m.code_name = ? order by v.order_position, v.id";
|
||||
|
||||
final SqlRowSet rsValues = this.jdbcTemplate.queryForRowSet(sql, String.class, new Object[] {codeName});
|
||||
final SqlRowSet rsValues = this.jdbcTemplate.queryForRowSet(sql, String.class, new Object[] { codeName });
|
||||
|
||||
rsValues.beforeFirst();
|
||||
while (rsValues.next()) {
|
||||
@@ -281,9 +281,8 @@ public class GenericDataServiceImpl implements GenericDataService {
|
||||
|
||||
final List<ResultsetColumnValueData> columnValues = new ArrayList<>();
|
||||
if (codeId != null) {
|
||||
final String sql = "select v.id, v.code_value from m_code_value v where v.code_id =?"
|
||||
+ " order by v.order_position, v.id";
|
||||
final SqlRowSet rsValues = this.jdbcTemplate.queryForRowSet(sql, Integer.class, new Object[] {codeId});
|
||||
final String sql = "select v.id, v.code_value from m_code_value v where v.code_id =?" + " order by v.order_position, v.id";
|
||||
final SqlRowSet rsValues = this.jdbcTemplate.queryForRowSet(sql, Integer.class, new Object[] { codeId });
|
||||
rsValues.beforeFirst();
|
||||
while (rsValues.next()) {
|
||||
final Integer id = rsValues.getInt("id");
|
||||
@@ -298,10 +297,9 @@ public class GenericDataServiceImpl implements GenericDataService {
|
||||
private SqlRowSet getDatatableMetaData(final String datatable) {
|
||||
|
||||
final String sql = "select COLUMN_NAME, IS_NULLABLE, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH, COLUMN_KEY"
|
||||
+ " from INFORMATION_SCHEMA.COLUMNS " + " where TABLE_SCHEMA = schema() and TABLE_NAME = ?"
|
||||
+ " order by ORDINAL_POSITION";
|
||||
+ " from INFORMATION_SCHEMA.COLUMNS " + " where TABLE_SCHEMA = schema() and TABLE_NAME = ?" + " order by ORDINAL_POSITION";
|
||||
|
||||
final SqlRowSet columnDefinitions = this.jdbcTemplate.queryForRowSet(sql, String.class, new Object[] {datatable});
|
||||
final SqlRowSet columnDefinitions = this.jdbcTemplate.queryForRowSet(sql, String.class, new Object[] { datatable });
|
||||
if (columnDefinitions.next()) {
|
||||
return columnDefinitions;
|
||||
}
|
||||
@@ -312,7 +310,7 @@ public class GenericDataServiceImpl implements GenericDataService {
|
||||
private SqlRowSet getDatatableCodeData(final String aDatatable, final String aColumnName) {
|
||||
String datatableColumnName = aDatatable.toLowerCase().replaceAll("\\s", "_") + "_" + aColumnName;
|
||||
final String sql = "select mc.id,mc.code_name from m_code mc join x_table_column_code_mappings xcc on xcc.code_id = mc.id where xcc.column_alias_name=?";
|
||||
final SqlRowSet rsValues = this.jdbcTemplate.queryForRowSet(sql, String.class, new Object[] {datatableColumnName});
|
||||
final SqlRowSet rsValues = this.jdbcTemplate.queryForRowSet(sql, String.class, new Object[] { datatableColumnName });
|
||||
|
||||
return rsValues;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user