使用Generator生成的方法insertselective,

insertselective返回主键ID
发现返回的为影响条数,0为失败,1为一条数据收到影响也就是成功,实体类属性id里面也没有主键映射上。

加上下面红线位置的即可
insertselective返回主键ID
useGeneratedKeys=“true”
keyProperty="pojo主键字段"

insertselective返回主键ID
去实体类中即可拿到主键id

相关文章:

  • 2021-09-02
  • 2021-05-25
  • 2022-12-23
  • 2021-04-09
  • 2022-02-05
  • 2021-07-28
  • 2022-12-23
猜你喜欢
  • 2022-02-01
  • 2021-12-02
  • 2021-08-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案