mybatis-plus 主键自增问题

 

主键不自增:返回值是插入的条数

<insert id="add" parameterType="EStudent">
  insert into TStudent(name, age) values(#{name}, #{age})
</insert

 

主键自增:

<insert id="add" parameterType="EStudent" useGeneratedKeys="true" keyProperty="id">
  insert into TStudent(name, age) values(#{name}, #{age})
</insert>

原文地址:https://blog.csdn.net/qq_37186247/article/details/85238506

posted @ 2019-12-13 10:54  星朝  阅读(6049)  评论(0编辑  收藏  举报