一、简介
Mybatis Log Free是一款免费的IntelliJ IDEA插件,用于记录MyBatis执行的SQL语句。该插件可以帮助开发者快速排查MyBatis执行时的问题,提高开发效率;
这个插件我主要就是用来自动填充参数,拼凑出完整的sql语句;
二、安装与使用
File -> Settings -> Plugins
![](https://img-blog.csdnimg.cn/img_convert/7e4a27b2b7db73bb8bc169d07f400105.png)
![](https://img-blog.csdnimg.cn/img_convert/85b175128c0bf0fa1f95ff4c59ae32f9.png)
安装完成后重启IDEA
之后在Tools中就可以找到Mybatis Log plugin,点击后就可以打开控制栏
![](https://img-blog.csdnimg.cn/img_convert/e9013d7a22fb0d6ff578921a4cd735d1.png)
![](https://img-blog.csdnimg.cn/img_convert/6e510078e4c939b54360882a45d9e58c.png)
下面去程序里跑一个sql看看,正常我们Debug下打印的sql如下,不会自动填充参数
![](https://img-blog.csdnimg.cn/img_convert/75ded8a0d1a8a0d3d3bef16d5de62347.png)
而Mybatis Log Plugin Free中打印的sql如下,是会自动填充参数的
![](https://img-blog.csdnimg.cn/img_convert/e7a4ce4376faa5521aaaed7cb3718b37.png)