经验分享—模糊查询在实体类配置文件中的使用
模糊查询
<select id="findCivilBySspecialty" resultMap="BaseResultMap" parameterType="java.lang.String">
select csid,scode,sname,c.sid ggsid,sspecialty,cstime,csname
from civilservant c,student s
where c.sid=s.sid and sspecialty like '%${value}%';
</select>
而不能使用’%#{sspecialty}%’
条件查询
<select id="findCivilBySspecialty" resultMap="BaseResultMap" parameterType="java.lang.String">
select csid,scode,sname,c.sid ggsid,sspecialty,cstime,csname
from civilservant c,student s
where c.sid=s.sid and sspecialty = #{sspecialty};
</select>