接口中的方法:
@Override
public void deleteProject(int id) {
String sql="delete from projectlisttable where id="+id;
jdbcTemplate.update(sql);
System.out.println("删除成功");
}
控制层的方法
// 删除数据
@RequestMapping(value = "/deletedata", method = RequestMethod.GET)
public String deletedata(ModelMap map, HttpServletRequest request) {
int id = Integer.parseInt(request.getParameter("id"));
System.out.println(id);
projectFindAllList.deleteProject(id);
List<ProjectAll> listall = projectFindAllList.findAll();
map.put("listall", listall);
return "table";
}