<insert id="addadjunct" parameterClass="adjunct">
insert into t_project_adjunct(fadjunct,ftype,fcreater,fcreatetime,fdeleted)
values(#name#,1,#creater#,sysdate(),0)
<selectKey keyProperty="id" resultClass="int">
SELECT @@IDENTITY AS ID
</selectKey>
</insert>主要是<selectKey keyProperty="id" resultClass="int">
SELECT @@IDENTITY AS ID
</selectKey>语句,不过要注意返回类型
本文介绍了一个使用 MyBatis 的 SQL 语句示例,该语句用于向数据库表 t_project_adjunct 中插入一条记录,并通过 SELECT @@IDENTITY AS ID 获取最后插入记录的 ID 值。
472

被折叠的 条评论
为什么被折叠?



