IDEA creates spring boot+mybatis project

1. File->new->project, select the project type as shown below:

2. Next, name the project and other general options

3. Next, choose dependency

4. Next, directly finished

5. Add spring boot and mybatis configuration. It should be noted here that the yml configuration distinguishes data types, so please add quotes to the string as much as possible, otherwise it is easy to cause problems. For example, if the database password is not quoted at the beginning, spring boot will recognize it as 0 , Causing the database to fail to connect

6. Carry out simple demo development. Pay attention to the hierarchical structure. The SQL xml file needs to be placed in the resources directory. Otherwise, the xml file cannot be loaded, causing the SQL not to be read, and an Invalid bound statement (not found) error is reported.

7. The SQL path name namespace+id must be consistent with the package+class name+method name of the corresponding DAO class

During the development process, there will be some dependencies that need to be added to the pom.

After introducing lombok dependencies, pay attention when using @Data and @Setter annotations. You need to install the lombok plug-in to call the get and set methods. The plug-in is only for the convenience of coding. The plug-in is not installed, but the set and other methods are called. An error will be prompted, but it is normal after compilation. In settings->plugins->marketplace, search and install the lombok plug-in; or download the plug-in package for offline installation.