public MarginRate getMarginRateByBrokerId(final Integer brokerId) {
ParameterizedRowMapper<MarginRate> mapper = new ParameterizedRowMapper<MarginRate>() {
public MarginRate mapRow(ResultSet rs, int rowNum) throws SQLException {
MarginRate marginRate = new MarginRate();
// marginRate.setBrokerId(rs.getObject("broker_id") == null ? null
// : (Integer) rs.getObject("broker_id"));
// marginRate.setShortMargin(rs.getObject("short") == null ? null
// : (Double) rs.getObject("short"));
// marginRate.setLongMargin(rs.getObject("long") == null ? null
// : (Double) rs.getObject("long"));
marginRate.setBrokerId(brokerId);
marginRate.setShortRate(rs.getDouble("short_rate"));
marginRate.setLongRate(rs.getDouble("long_rate"));
return marginRate;
}
};
return getSimpleJdbcTemplate().queryForObject(MARGIN_RATE_SQL, mapper,