public List<ThesysShipFeeVO> listByFeeType(String siteId, int feeType) throws SQLException { Connection con = null; PreparedStatement stmt = null; ResultSet rs = null; List<ThesysShipFeeVO> result = new ArrayList<ThesysShipFeeVO>(); try { con = getConnection(); String sql = "SELECT * FROM LAPHONE_SHIP_FEE where SITE_ID=? AND FEE_TYPE=? ORDER BY COND_END"; stmt = con.prepareStatement(sql); stmt.setString(1, siteId); stmt.setInt(2, feeType); rs = stmt.executeQuery(); while (rs.next()) { result.add(ThesysShipFeeVO.getInstance(rs)); } } finally { closeAll(con, stmt, rs); } return result; }
public ThesysShipFeeVO getRow(String siteId, int feeType, int conditionEnd) throws SQLException { Connection con = null; PreparedStatement stmt = null; ResultSet rs = null; ThesysShipFeeVO result = null; try { con = getConnection(); String sql = "SELECT top 1 * FROM LAPHONE_SHIP_FEE where SITE_ID=? AND FEE_TYPE=? AND COND_END=? ORDER BY COND_END"; stmt = con.prepareStatement(sql); int idx = 1; stmt.setString(idx++, siteId); stmt.setInt(idx++, feeType); stmt.setInt(idx++, conditionEnd); rs = stmt.executeQuery(); if (rs.next()) { result = ThesysShipFeeVO.getInstance(rs); } } finally { closeAll(con, stmt, rs); } return result; }