mapping文件:
insert into WF_RISK_PROJECT_APPROVAL (RISKTGID, PROJID, CREATEDATE, UPDATEDATE, STATUS, CONCLUSION, CREATOR, RISKTYPE, APPLYTYPE, ISCOMPENSATORY) values (#{risktgid,jdbcType=NUMERIC}, #{projid,jdbcType=NUMERIC}, #{createdate,jdbcType=TIMESTAMP}, #{updatedate,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, #{conclusion,jdbcType=VARCHAR}, #{creator,jdbcType=VARCHAR}, #{risktype,jdbcType=INTEGER}, #{applytype,jdbcType=INTEGER}, #{iscompensatory,jdbcType=INTEGER}) SELECT @@IDENTITY AS RISKTGID insert into WF_RISK_PROJECT_APPROVAL RISKTGID, PROJID, CREATEDATE, UPDATEDATE, STATUS, CONCLUSION, CREATOR, RISKTYPE, APPLYTYPE, ISCOMPENSATORY, #{risktgid,jdbcType=NUMERIC}, #{projid,jdbcType=NUMERIC}, #{createdate,jdbcType=TIMESTAMP}, #{updatedate,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, #{conclusion,jdbcType=VARCHAR}, #{creator,jdbcType=VARCHAR}, #{risktype,jdbcType=INTEGER}, #{applytype,jdbcType=INTEGER}, #{iscompensatory,jdbcType=INTEGER}, SELECT @@IDENTITY AS RISKTGID
如上中的selectKey中的写法即可,然后就可以在action中使用了