例如: java
public List<AutoProject> searchAutoProject(Integer status) { String sql = "SELECT * FROM auto_report_project WHERE status = ${status}"; sql = sql.replace("${status}", status + ""); try { return getJdbcTemplate().query(sql, new BeanPropertyRowMapper(AutoProject.class)); } catch (DataAccessException e) { e.printStackTrace(); throw new RuntimeException(e); } }其中,query方法裏面的sql語句,須要一個BeanPropertyRowMapper這樣一個類去對應自動映射