[Mybatis beginners’ lecture from 0 to 90%] 09: Mybatis dynamic SQL: if, where, set tags

CSDN achieves 100 million technical people


Preface

Dynamic SQL is one of the highlight features of Mybatis, if you have experienced it Splicing SQL, then you can feel for yourself how cool dynamic SQL is!! It smells so good~

In addition, Mybatis has designed dynamic SQL so naturally that people can understand and accept it just by looking at it. I think this is also the case with Mybaits. One of the reasons why it is so popular is that SQL code and JAVA codeare seamlessly integrated, Incredible, really elegant!


1. if tag

if is very commonly used for conditional judgment, and ifJava =4> Similar ifif testWhen is established, execute the sql inside it, such as select field judgment, join

Guess you like

Origin blog.csdn.net/scm_2008/article/details/134129244