代码如下
<select id="test" returnType="java.lang.Integer">
select count(*) from test t where #{col} = 'xxxx'
</select>
Integer test(@Param("col") String col);
当时使用的时候返回的结果非常奇怪,不描述了。
正确写法 #{col} 改为 ${col},
<select id="test" returnType="java.lang.Integer">
select count(*) from test t where ${col} = 'xxxx'
</select>