1、if...else...的写法
<choose>
<when test="name != null and name != ''">
</when>
<otherwise>
</otherwise>
</choose>
2、比较日期大小时,敏感字符语句转字符串
<![CDATA[
]]>
3、if中字符串比较可以使用toString()
<if test="test_id != null and test_id != '' and test_id != '0'.toString()">
</if>
4、使用foreach标签进行批量新增
<insert id="batchInsert" parameterType="java.util.List">
INSERT INTO table_name (column1, column2) VALUES
<foreach collection="list" item="item" separator=",">
(#{item.property1}, #{item.property2})
</foreach>
</insert>