<select id="search" resultMap="BaseResultMap" parameterType="com.pinyougou.pojo.TbBrand" > select * from tb_brand <trim prefix="WHERE" prefixOverrides="AND"> <if test="firstChar != null" > first_char like '%${firstChar}%' </if> <if test="name != null" > and name like '%${name}%' </if> </trim> </select>
转载于:https://my.oschina.net/u/4117203/blog/3048312