4种标签: |
---|
1. if |
2. choose (when, otherwise) |
3. trim (where, set) |
4. foreach |
1.
<where> // 标签
and 写在语句之前
2.
优点: 可以避免if标签中 and 冗余 |
---|
3.
4.
5.
sql: select * from tbl_employee where id in (1,2,3); |
---|
6. bind标签 _lastName
在like查询中, eg: select * from employee where lastName like #{} ,此时, #{} 是一个完整的字符串,不能拼接。 所以需要提前拼接,通过_lastName引用的形式传值 |
---|
7. sql标签 include
作用: 抽取可以重复使用的sql片段,方便后续引用 |
---|