我现在有个需求,比如新增3条数据,主键是uuid自增,然后在xml文件中循环添加,那怎么返回这3条主键ID呢?service该怎么接?
谢谢大神们
<insert id="insert" parameterType="...." useGeneratedKeys="true" keyProperty="填入对象的属性名(会对应接收到表中的主键)">
sql语句
</insert>
有帮到你记得采纳
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.String">
select seq()//生成的id
</selectKey>