mapper.xml文件
<!-- 添加信息 -->
<insert id="insert" parameterType="实体类" useGeneratedKeys="true" keyProperty="id">
<!-- 添加送达大信息的同时获取自动生成的ID的值 -->
<selectKey resultType="int" keyProperty="sdid" order="AFTER" >
SELECT LAST_INSERT_ID() AS sdid
</selectKey>
insert into esd(ah,sdid,sdwj) values(#{ah},#{sdid},#{sdwj}
</insert>
时间: 2024-10-13 12:04:09