1、配制文件中加入

&allowMultiQueries=true

spring.datasource.url=jdbc:mysql://localhost:3306/db?serverTimezone=UTC
&useUnicode=true&characterEncoding=utf-8&useSSL=true&allowMultiQueries=true

2、二条语句之间加入;就可以了。

@Update("UPDATE JoinInfo set isdefault=0 where id>0;UPDATE JoinInfo 
set isdefault=#{isdefault},modifyDate=now() WHERE id = #{id}
")
void update(JoinInfo joinInfo);

其实最主要就是配制文件中要加一个关键字,不然会执行报错。

 

相关文章:

  • 2022-03-10
  • 2022-12-23
  • 2021-09-07
  • 2022-02-21
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-29
  • 2021-07-26
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案