sql语句中有"()" 、"[]"和其他特殊字符时执行报错,但是该sql能够在Navicat连接数据库中正常执行
请参考下面连接:
https://blog.csdn.net/drose29/article/details/103893228
只测试了"()",其他的还没有测试,要在mapper文件中添加@SqlParser(filter=true)注解
@SqlParser(filter=true)
List<Map<String,Object>> selectListOrg(@Param("orgCodeList")List<String> orgCodeList, @Param("type") String type);
后期测试:
测试了"[]"是有效的。
另外,还有一种情况也会存在mybatis报错的情况,需要将里面的注释去掉。
在mybatis的注解是 /* */ 或者 <!-- -->
错误信息如下: