4. 动态SQL

MyBatis的强大特性之一便是它的动态SQL。以下是MyBatis的动态SQL在XML中支持的几种标签。

  • if

  • choose(when、otherwise)

  • trim(where、set)

  • foreach

  • bind

4.1 if 标签用法

4.2 choose 标签用法

4.3 where、set、trim 标签用法

Last updated