2. Dept insert 와 remove 를 구현하시오.
@PostMapping("/register")
public String register(DeptVO deptVO) {
System.out.println("register()..");
deptService.register(deptVO);
return "redirect:/dept/list";
}
@GetMapping("/remove")
public String remove(DeptVO deptVO) {
System.out.println("remove()..");
deptService.remove(deptVO);
return "redirect:/dept/list";
}
@Override
public void register(DeptVO deptVO) {
System.out.println("register()..");
deptMapper.insert(deptVO);
}
@Override
public void remove(DeptVO deptVO) {
System.out.println("remove()..");
deptMapper.delete(deptVO);
}
public void insert(DeptVO deptVO);
public void delete(DeptVO deptVO);
<insert id="insert" parameterType="edu.sejong.ex.vo.DeptVO">
<![CDATA[
insert into dept values (#{deptno}, #{dname}, #{loc})
]]>
</insert>
<delete id="delete" parameterType="edu.sejong.ex.vo.DeptVO">
<![CDATA[
delete from dept where deptno = #{deptno}
]]>
</delete>