环境搭建参考https://blog.csdn.net/YKYZSYA/article/details/108000053
对象封装参考https://blog.csdn.net/YKYZSYA/article/details/108070188
查所有参考https://blog.csdn.net/YKYZSYA/article/details/108034576
根据查所有界面传来的值进行删除
Dao层接口层 PersonDao.java
//删
public int shan(int pid);
Dao层mapper层 Personmapper.xml
<delete id="shan" parameterType="int">
delete from Person where pid=#{pid}
</delete>
Service层接口层 PersonSer.java
public int shan(int pid);
Service层实现层 PersonSerImpl.java
@Override
public int shan(int pid) {
// TODO Auto-generated method stub
return personDao.shan(pid);
}
Controller层 PersonCon.java
@RequestMapping("shan")
//从前台拿到pid
public ModelAndView shan(int pid) {
ModelAndView mv=new ModelAndView();
if (personSer.shan(pid)>0) {
//跳到查所有
mv.setViewName("redirect:queryall");
}
return mv;
}