...
sql = "...where 1=1 and s.content like '%?%'";
sqlValue.add(content);
...
一直出现错误Parameter index out of range (1 > number of parameters, which is 0)
自己修改 sql = "...where 1=1 and s.content like '%"+content+"%'";这样没有问题,但是感觉有些生硬。
询问了同事说用concat比较好
sql = "...where 1=1 and s.content like concat('%',?,'%')";
sqlValue.add(content);
...