<!--${}是不进行预编译的,会直接进行sql语句的拼接;{}中的内容必须通过Map或者查询对象中获得-->
<select id="selectPersonByName" parameterType="java.util.Map" resultMap="BaseResultMap"> select * from person t where t.name like '%${name}%' </select>
本文介绍了一个MyBatis动态SQL的例子,展示了如何使用${}
<!--${}是不进行预编译的,会直接进行sql语句的拼接;{}中的内容必须通过Map或者查询对象中获得-->
<select id="selectPersonByName" parameterType="java.util.Map" resultMap="BaseResultMap"> select * from person t where t.name like '%${name}%' </select>

被折叠的 条评论
为什么被折叠?