IDEA中MyBatis Log Plugin的使用

本文选自IDEA官网,MyBatis Log是一款很好用的插件,尤其是sql中条件参数特别多的时候,不用我们一个一个把?手动替换,提高了开发效率,特地推荐。
IDEA中MyBatis Log Plugin的使用
Restore the mybatis generate sql to original whole sql.
It will generate sql statements with replace ? to the really param value.
Through the “Tools -> MyBatis Log Plugin” menu you can tail the sql log.
You can selected the “Filter” button on the left to filter the contents don’t wanna display.
You can selected the “Format Sql” button on the left to format the generate sql statements.
You can select the console sql log and right click “Restore Sql from Selection” menu to restore sql.
Prerequisite: sql log must contain “Preparing:” and “Parameters:”

把 mybatis 输出的sql日志还原成完整的sql语句。
将日志输出的sql语句中的问号 ? 替换成真正的参数值。
通过 “Tools -> MyBatis Log Plugin” 菜单或快捷键 “Ctrl+Shift+Alt+O” 启用。
点击窗口左边的 “Filter” 按钮,可以过滤不想要输出的sql语句。
点击窗口左边的 “Format Sql” 按钮,可以格式化输出的sql语句。
选中console的sql日志,右击 “Restore Sql from Selection” 菜单可以还原sql语句。
前提条件:输出的sql日志必须包含"Preparing:"和"Parameters:"才能正常解析。

IDEA中MyBatis Log Plugin的使用赶快使用起来吧~