ibatis sqlMap.xml 文件 like 查询的三种方案
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
"./sql-map-2.dtd">
<sqlMap namespace="Account">
<select id="getAllStudentLike1" resultClass="hashmap" parameterClass="String">
select * from student where name like #name#
<!-- sqlMapClient.queryForList("getAllStudentLike1" , "%张") ; -->
</select>
<select id="getAllStudentLike2" resultClass="hashmap" parameterClass="String">
select * from student where name like '%$name$%'
<!-- sqlMapClient.queryForList("getAllStudentLike2" , "张") ; -->
</select>
<select id="getAllStudentLike3" resultClass="hashmap" parameterClass="String">
select * from student where name like '%'||#name#||'%'
<!-- sqlMapClient.queryForList("getAllStudentLike3" , "张") ; -->
</select>
</sqlMap>
当一个人找不到出路的时候,最好的办法就是将当前能做好的事情做到极致,做到无人能及。