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="自己的mapper文件路径">
</mapper>

 

mybatis

spring:
    datasource:
        driver-class-name: com.mysql.cj.jdbc.Driver
        username: 账号
        password: 密码
        url: jdbc:mysql://localhost:3306/数据库?serverTimezone=GMT&useUnicode=true&characterEncoding=utf-8
    ##格式化日期
    jackson:
      date-format: yyyy-MM-dd
mybatis:
  type-aliases-package: 实体类路径
  mapper-locations: classpath:/mapper/*.xml
##日志文件
  configuration:
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
#设置端口号
server:
port:

 

posted on 2022-10-16 19:56  最帅爸爸  阅读(229)  评论(0)    收藏  举报