理解使用场景 1)If 2)Choose(when,otherwise) 相当于 switch 3)trim(where,set) ①where ② trim:移除prefixOverrides中的内容,加上prefix中的内容 ③ set trim实现set: 4)foreach 参数传入List时,mybatis会默认使用
          理解使用场景

1) If

2) Choose(when,otherwise)
相当于 switch

3) trim(where,set)
① where

② trim:移除prefixOverrides中的内容,加上prefix中的内容


③ set

trim实现set:

4) foreach
参数传入List时,mybatis会默认使用list作为key来获取值,数组Array的key默认为array。Collection=”list | array”,index为索引下标
参数为Map时,则index表示key,item为值
① 实现in的集合操作

②实现批量保存

5) Mybatis的内置参数


6) bind元素

7) sql片段

8) 特殊字符处理

CDATA节点:

