标签:map cat user and 模糊 mybatis where from char
mybatis的模糊查询格式;
<select id="xxx" parameterType="com.model.xxx" resultMap="BaseResultMap"> select * from users WHERE 1=1 <if test="name != null and name != ‘‘" > and name like CONCAT(‘%‘,#{name,jdbcType=VARCHAR},‘%‘) </if> <if test="identity != null and identity != ‘‘" > and identity like CONCAT(‘%‘,#{identity,jdbcType=VARCHAR},‘%‘) </if> <if test="phon != null and phon != ‘‘" > and phon like CONCAT(‘%‘,#{phon,jdbcType=VARCHAR},‘%‘) </if> </select>
标签:map cat user and 模糊 mybatis where from char
原文地址:http://www.cnblogs.com/YLQBL/p/7810903.html