Invalid bound statement (not found) @Update注解写的怎么还报错!

现象

如下DAO代码,非MapperXML方式,写的报错:Invalid bound statement (not found)

@Update("<script>update record set visible = 0 " +
            "where id in " +
            "<foreach collection='list' item='item' separator=',' open'(' close=')'>" +
            "#{item}" +
            "</foreach>" +
            "</script>")
    int updateRecordToHide(@Param("list") List<Long> list);

原因

结果发现,是@Update中的脚本写的有问题,语法错误!!

open'(' close=')'

应该改成

open='(' close=')'
posted @ 2021-12-24 16:35  一杯半盏  阅读(137)  评论(0编辑  收藏  举报