1.mapper多参数语句:
select * from table where age= #{age}
<if test="uname !=null and uname !=' ' "> //判断非空
and uname like concat ( concat('%',#{uname}),'%') //like语句
</if>
2.foreach语句:
接口:public List<book> get(@Param("isbns") Set<String> isbns) throws Exception;
mapper语句:<select id="get" resultType="book">
select isbn, bname ,press from book where isbn in
<foreach item="isbn" index="index" collection="isbns" open="(" separator="," close=")">
#{isbn}
</>
3.语义冲突
//错误提示:The content of elements must consist of well-formed character data or markup. <= 是和等左边的符号冲突,需要用 进行转义
<![CDATA[ and buytime <= #{endDate} ]]>