2022年2月

在application.yml配置如下

mybatis:
    // 实体类位置(可以在mapper文件中,不写配置)
    type-aliases-package: com.sskj.entity
    // 配置文件(如果启动外界配置,就不能启动configuration)
    config-location: classpath:mybatis/mybatis-config.xml
    // 映射文件
    mapper-locations: classpath:mybatis/mapper/*.xml

配置文件

xml文件的声明

<!DOCTYPE configuration
    PUBLIC "-//mybatis.org//DTD config 3.0//EN"
    "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
    
</configuration>

配置参考
https://mybatis.org/mybatis-3/zh/configuration.html

mapper文件

xml文件的声明

<!DOCTYPE mapper
    PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
    "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper>
    
</mapper>