日期:2014-05-17 浏览次数:20877 次
String sql="select DEPT_ID as dept_id, DEPT_NAME as dept_name, DEPT_FATH_ID as dept_fath_id, DEPT_LEVEL as dept_level from M_DEPT where DEPT_ID=?"; Object[] obj=new Object[1]; obj[0]=new Integer(dept_id); List<Dept> deptList = this.getJdbcTemplate().query(sql,obj,new BeanPropertyRowMapper(Dept.class)); if(!deptList.isEmpty()) { return deptList.iterator().next(); }else { return null; }