mybatis模糊查询
mybatis中使用模糊查询,因为需要读取参数值的原因,直接所以不能直接在读取的参数值旁边加上通佩服,应当使用如下方式,下面是实际使用代码:
<select id="selectRuleList" resultMap="BaseResultMap">
select * from t_dispatch_rule where is_del='0'
<if test ="paraMap!=null">
<if test="paraMap.ruleName !=null and paraMap.ruleName.toString != ' ' ">
ruleName like concat (concat ('%',#{ruleName}),'%')
</if>
</if>
</select>
实现的时候使用concat(’’,’’,’’)函数连接