cause
In recent project development, an advanced query function is involved. SQL is nearly 100 lines long. When troubleshooting SQL problems, it needs to be spliced into executable SQL. Some of the mybatis log plug-ins on the market are charged, and some are only applicable to the lower version of idea, and SQL is often lost. The process is painful. So, in a rage, he developed a mybatis log plus plug-in.
Function introduction
Restore SQL
You can restore the mybatis log output from the console to executable SQL statements.
Filter switch
You can select filter on and pause.
picture
SQL formatting
You can choose whether to format SQL as needed.
picture
Custom rules
You can customize filtering rules.
picture
Custom color
You can customize the colors of different SQL statement types as needed.
picture
picture
Manually capture SQL
Select the console SQL log and right-click the capture SQL menu to restore SQL.
picture
Version Description
Since the source code of IntelliJ project was migrated to jdk11 in September 2020, jdk11 will be required to start ide 2020.3 and above based on IntelliJ.Therefore, two versions have been developed, and the applicable version of idea is as follows:
version | IntelliJ IDEA version |
---|---|
mybatis-log-plus-2.0.0.zip | IDEA 2020.2~IDEA 2021.3 |
mybatis-log-plus-1.0.0.zip | IDEA 2017.2 ~ IDEA 2020.2 |
Installation tutorial
Online installation:
Idea — > setting — > plugins — > search mybatis log plus
image.png
Local installation:
IDEA–>Setting–>Plugins–> “Install plugin from disk…”
picture
Select the zip installation package and directly click OK to complete the installation!
picture
Wechat official account “Java post station” background, send: plug-in, you can receive the installation package!