public List getTransFeeDate( final String departmentCode, final String subDepartmentCode, final String countDate) { // TODO Auto-generated method stub List list = new ArrayList(); // exec P_TRANS_FEE_REPORT ?,?,? 为存储过程,TransFeeView是一个视图,并不是与数据库关联的实体类 list = (List) getJdbcTemplate().execute( " exec P_TRANS_FEE_REPORT ?,?,? " , new PreparedStatementCallback() { public Object doInPreparedStatement(PreparedStatement stmt) throws SQLException, DataAccessException { // TODO Auto-generated method stub List result = new ArrayList(); stmt.setString( 1 , countDate); stmt.setString( 2 ,departmentCode); stmt.setString( 3 , subDepartmentCode); ResultSet rs = stmt.executeQuery(); while (rs.next()) { TransFeeView feeView = new TransFeeView(); feeView.setItem(rs.getString( " Fld_Item " )); feeView.setOder( new Integer(rs.getInt( " Fld_Order " )).toString()); feeView.setDayFee( new Float(rs.getDouble( 3 )).toString()); feeView.setMonthFee( new Float(rs.getFloat( 4 )).toString()); feeView.setYearFee( new Float(rs.getFloat( 5 )).toString()); feeView.setReturnFee( new Float(rs.getFloat( 6 )).toString()); result.add(feeView); } return result; } } ); return list; }
本文为张军原创文章,转载无需和我联系,但请注明来自张军的军军小站,个人博客http://www.zhangjunbk.com