我在公司开发中摘取的一段例子,完全有效
<select id="strategy_get" resultType="map">
select * from strategy
where merchantid = #{merchantid}
<choose>
<when test="title != null and title != ''">
and title like concat(concat('%',#{title}),'%')
</when>
</choose>
</select>