整体代码如下:
/p>
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
SELECT e.emp_id, e.emp_name, e.gender, e.email, e.d_id,d.dept_id,d.dept_name
FROM tbl_emp e join tbl_dept d on e.d_id=d.dept_id where e.emp_id = #{empId}
SELECT e.emp_id, e.emp_name, e.gender, e.email, e.d_id
FROM tbl_emp e where e.emp_id = #{empId}
useGeneratedKeys="true" keyProperty="empId" >
insert into tbl_emp(emp_name,email,gender)
value(#{empName},#{email},#{gender})
select employees_seq.nextval from dual
insert into tbl_emp(emp_id,emp_name,email,gender)
value(#{empId},#{empName},#{email},#{gender})