Spring Boot中使用MyBatis
传参方式:
使用@Param
@Insert("INSERT INTO USER(NAME, AGE) VALUES(#{name}, #{age})")
int insert(@Param("name") String name, @Param("age") Integer age);
使用Map
@Insert("INSERT INTO USER(NAME, AGE) VALUES(#{name,jdbcType=VARCHAR}, #{age,jdbcType=INTEGER})")
int insertByMap(Map<String, Object> map);
使用对象
@Insert("INSERT INTO USER(NAME, AGE) VALUES(#{name}, #{age})")
int insertByUser(User user);

相关文章:

  • 2021-12-16
  • 2022-12-23
  • 2022-12-23
  • 2021-10-09
  • 2021-07-08
  • 2021-10-02
  • 2021-10-18
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-17
  • 2021-10-06
  • 2021-04-19
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案