<insert id="sql_Join_Nurse" parameterType="com.smart.project.web.user.vo.User" useGeneratedKeys="true"
keyProperty="id">
insert into user (name, email, nurse_age, nurse_gender, nurse_addr, nurse_tel, nurse_pay, fav_time,
nurse_type,
pw, role, nurse_pr)values
(#{name},#{email},#{nurse_age},#{nurse_gender},#{nurse_addr},#{nurse_tel},#{nurse_pay},#{fav_time},#{nurse_type},password(#{pw}),#{role}, #{nurse_pr});
<selectKey resultType="integer" keyProperty="id" order="AFTER">
SELECT LAST_INSERT_ID()
</selectKey>
</insert>
- insert후에 result결과를 임의로 auto increment로 생성된 id값을 받아올 수 있음
댓글