应用:
<select id="listByStage" parameterType="Map" resultType="java.util.Map">
SELECT * FROM w_course c,w_user u WHERE c.student_id=u.id
and c.stage >#{stage1} and c.stage <#{stage2} and
(IF(ISNULL(#{key}),true,u.real_name like #{key}) or
IF(ISNULL(#{key}),true,u.mobile like #{key})
)
limit #{start},#{limit}
</select>
出现大小写时,tomcat无法正常启动,需换成xml的转义字符。