String sql = "select app_name, file_name, version, xml, comment, creator, create_time, is_published, publisher, publish_time " +
"from config_file_history where app_name=? and file_name=? and version=?";
List<FileHistory> r = getJdbcTemplate().query(sql, new Object[]{appName, fileName, version}, new RowMapper<FileHistory>() {
@Override
public FileHistory mapRow(ResultSet rs, int rowNum) throws SQLException {
return new FileHistory(rs.getString(1), rs.getString(2), rs.getInt(3), rs.getString(4),
rs.getString(5), rs.getString(6), rs.getDate(7), rs.getBoolean(8), rs.getString(9), rs.getDate(10));
}
});
return !r.isEmpty() ? r.get(0) : null;
}