环境: mybatis
我的问题是mapper.xml文件中对like的拼接有问题。
换成下面这样就可以了:
(case when question_content like CONCAT('%',#{item},'%') then 1 else 0 end)
重点在:
CONCAT('%',#{item},'%')

环境: mybatis
我的问题是mapper.xml文件中对like的拼接有问题。
换成下面这样就可以了:
(case when question_content like CONCAT('%',#{item},'%') then 1 else 0 end)
重点在:
CONCAT('%',#{item},'%')