ibatis sqlMap.xml 文件 like 查询的三种方案
ibatis sqlMap.xml 文件 like 查询的三种方案
原: dtd 位置 "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<?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>
相关推荐
zyjj 2020-07-04
bluet00 2020-06-25
godfather 2020-06-13
lt云飞扬gt 2020-06-09
旗木卡卡西 2020-06-02
徐悦TechBlog 2020-05-27
liuyang000 2020-03-05
xuanlvhaoshao 2020-02-21
ItBJLan 2020-02-20
tanrong 2020-02-15
gwn00 2020-02-01
一对儿程序猿 2020-01-18
xuanlvhaoshao 2020-01-02
gwn00 2020-01-09
tanrong 2019-12-22
tanrong 2019-12-16
一对儿程序猿 2019-11-10