标签:动态sql param bind res rom java sql from tis
Oracle中使用bind的写法
<select id="selectUser" resultType="user" parameterType="user"> <bind name="pattern" value="‘%‘ + username + ‘%‘" /> select id,sex,age,username,password from user where username LIKE #{pattern} </select>
Oracle中不使用bind的写法
<select id="selectUser" resultType="user" parameterType="user"> select id,sex,age,username,password from user where username LIKE CONCAT(CONCAT(‘%‘,#{username}),‘%‘) </select>
mybaitis动态sql利用bind标签代替%拼接完成模糊查询
标签:动态sql param bind res rom java sql from tis
原文地址:https://www.cnblogs.com/LingCoder/p/9565159.html