标签:ack bin bind png 参数 bsp res gets value
<select id="getStuByTrim" resultType="student"> select * from student <!-- 绑定参数拼接字符串 --> <bind name="stuName" value="‘%‘+name+‘%‘"/> <trim prefix="where" prefixOverrides="and" > <if test="id!=null"> id = #{id} </if> <if test="name!=null && name.trim()!=‘‘"> and name like #{stuName} </if> </trim> </select>
这样我们在查询时,name属性可以不用自带%号
自动拼接了%
标签:ack bin bind png 参数 bsp res gets value
原文地址:https://www.cnblogs.com/lyh233/p/12362667.html