例如:
<update id="updateUserInfo">
UPDATE dcy_article SET nick_name = #{nickName} , user_image = #{userImage}
WHERE user_id = #{userId}; -- 注意,最后加上英文分号
UPDATE dcy_comment SET nick_name = #{nickName} , user_image = #{userImage}
WHERE user_id = #{userId};
</update>
需要配置数据源:allowMultiQueries=true
spring:
datasource:
url: jdbc:mysql://172.21.25.56:3306/dcy_blog_article?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8&allowMultiQueries=true