Mybatis自定义SQL更新JSON字段抛错
UPDATE mf_shopping.product
<set>
<if test="visitsNum != null">
VISITS_NUM = #{visitsNum},
</if>
<if test="carouselPic != null">
CAROUSEL_PIC = #{carouselPic},
</if>
</set>
WHERE ID = #{id}
其中CAROUSEL_PIC字段类型为JSON,修改如下即可解决
CAROUSEL_PIC = #{carouselPic,jdbcType=VARCHAR,typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler},
以上是 Mybatis自定义SQL更新JSON字段抛错 的全部内容, 来源链接: utcz.com/z/513735.html