mybatis sql语法
时间: 2023-11-07 12:15:03 浏览: 184
mybatis动态sql
Mybatis SQL语法包括动态SQL技术和XML解析。动态SQL技术是一种根据特定条件动态拼装SQL语句的功能,它解决了拼接SQL语句字符串时的痛点问题。在Mybatis中,SQL语句通常写在mapper.xml文件中,但是XML解析时会遇到特殊字符需要进行转义处理,例如使用<代替<,>代替>,&代替&,'代替',"代替"等。另外,#{}在Mybatis中用于向prepareStatement中的预处理语句中设计参数值,可以理解为一个占位符即?。所以,Mybatis SQL语法是通过动态SQL技术拼装SQL语句,并在mapper.xml中进行XML解析,并且使用#{}作为参数的占位符。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [MyBatis基础语法详解,真的全面](https://blog.csdn.net/qq_42176665/article/details/127873388)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* [Mybatis常用语法汇总](https://blog.csdn.net/qw463800202/article/details/103221651)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文