由于项目用的是oracle 贴出代码片段
<selectKey keyProperty="id" resultType="java.lang.String" order="BEFORE">
Select fn_seq_format(S_hog_role_profile.nextval, 'HR') as id from dual
</selectKey>
这段写在新增语句之前,不用返回值,新增的主键自动映射到传入的参数Map内,不适用于批量返回主键
由于项目用的是oracle 贴出代码片段
<selectKey keyProperty="id" resultType="java.lang.String" order="BEFORE">
Select fn_seq_format(S_hog_role_profile.nextval, 'HR') as id from dual
</selectKey>
这段写在新增语句之前,不用返回值,新增的主键自动映射到传入的参数Map内,不适用于批量返回主键