MapSqlParameterSource paramMap = new MapSqlParameterSource();
NamedParameterJdbcTemplate JdbcTemplate = new NamedParameterJdbcTemplate(this.getDataSource());
String[] newIds = ids.split(",");
List<Long> idsList = new ArrayList<Long>();
for (int i = 0; i < newIds.length; i++) {
idsList.add(Long.parseLong(newIds[i]));
}
paramMap.addValue("ids", idsList);
Integer count=JdbcTemplate.queryForInt(sql, paramMap);