application.properties
//springboot名称 spring.application.name=springboot-w //端口号 server.port=8082 //mysql spring.datasource.driver-class-name=com.mysql.jdbc.Driver //数据库url地址 spring.datasource.url=jdbc:mysql://localhost:3306/suppliesmanager?characterEncoding=utf-8&&useSSL=false //账号 spring.datasource.username=root //密码 spring.datasource.password=x5 mybatis.mapper-locations=classpath:mapper/*.xml
application.yml
```go thymeleaf: prefix: classpath: /templates # 访问template下的html文件需要配置模板,映射
pom
<dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.49</version> </dependency> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>2.3.0</version> </dependency>
mapper.xml
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > <mapper namespace="com.student.mapper.stumapper"> </mapper>