1. Download the MybatisX plugin
Open idea, File—>Setting—>Plugins—>Marketplace—>Search for MybatisX and install it.
2. Use the database that comes with IDEA
First open the IDEA page, we first add the database
can be opened here
Add the MySQL database
and fill in the information
Select the database you use
View the table structure in the database
Create a new query and query the SQL statement
3. Automatic code generation
Right-click the form that needs to generate code
to fill in the information
Click Finish to generate code
4. Write the sql statement prompt in the xml file
set
sql prompt