mybatis+oracle实现模糊查询

mybatis在mapper.xml中拼写sql本人感觉格式要求很严格,比如模糊查询使用like

<select id="selectStudent" parameterType="java.lang.String" resultType="com.Student">

-- 第一种 concat

select * from students where studentName like concat(#{studentName},'%')

--第二种 ||

select * from students where studentName like '%' || #{studentName} || '%'

</select>

在oracle中 concat不支持三个参数的 如concat('%',#{studentName},'%')
原文:https://blog.csdn.net/zyl_06/article/details/79575589 
 

猜你喜欢

转载自blog.csdn.net/qq_42352175/article/details/87927455