<insert id ="addStudent" >
<selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
SELECT SEQ_TS_MODEL.NEXTVAL FROM DUAL
</selectKey>
insert into student values(#{id},#{name})
</insert>
注解方式:
@SelectKey(statement = "SELECT SEQ_TS_MODEL.NEXTVAL FROM DUAL", before = true, resultType = Integer.class, keyProperty = "id")