- application.yaml 配置
mybatis-plus:
# 配置要掃描的xml文件目錄,classpath* 代表所有模塊的resources目錄 classpath 不加星號代表當前模塊下的resources目錄
mapper-locations: classpath*:/mapper/*.xml
# 實體掃描,*通配符
typeAliasesPackage: com.demo.*.entity
- 註解
@MapperScan("com.demo.**.mapper")