mybatis写like语句,照着网上的方法,试了好几种都报错
<if test="fdClassTime!=null and fdClassTime!=''">
and a.FD_CLASS_TIME like CONCAT('%',#{fdClassTime},'%')
</if>
后台报错(传到postman)
然后又在网上搜解决方法: concat是连接两个字符串的函数,这里连接了三个,把SQL改成两个concat嵌套的
<if test="fdClassTime!=null and fdClassTime!=''">
and a.FD_CLASS_TIME like CONCAT(CONCAT('%',#{fdClassTime}),'%')
</if>
上面这种写法运行成功