没有条件查询,正常,按条件查询时,查询不出结果,log日志中的sql正确,在数据库中执行可以查询到结果
<select id="queryMessage2" parameterType="com.immoc.bean.Message" resultType="com.immoc.bean.Message" >
SELECT id as id, command as command, description as description, content as content FROM message where 1=1
<if test="command!=null and !"".equals(command.trim())">
and command=#{command}
</if>
<if test="description!=null and !"".equals(description.trim())">
and description like '%' #{description} '%'
</if>
</select>
为什么我这样配置,按条件查询,查询不出结果呢?