소스 검색

mp添加胜德包扫描注解

24282 1 년 전
부모
커밋
fd3277ba0f
2개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 0
      sd-starter/src/main/java/com/sd/SdApplication.java
  2. 1 1
      sd-starter/src/main/resources/application.yml

+ 2 - 0
sd-starter/src/main/java/com/sd/SdApplication.java

@@ -1,11 +1,13 @@
 package com.sd;
 
 import lombok.extern.slf4j.Slf4j;
+import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 
 @Slf4j
 @SpringBootApplication(scanBasePackages = {"com.sd.**", "com.ruoyi.**", "com.sd.**"})
+@MapperScan("com.sd.**.mapper")
 public class SdApplication {
 
     public static void main(String[] args) {

+ 1 - 1
sd-starter/src/main/resources/application.yml

@@ -134,7 +134,7 @@ spring:
 # MyBatis Plus配置
 mybatis-plus:
   # 搜索指定包别名
-  typeAliasesPackage: com.ruoyi.**.domain,com.sd.**.entity.po
+  typeAliasesPackage: com.ruoyi.**.domain,com.sd.**.entity.po,com.fjhx.**.entity.po
   # 配置mapper的扫描,找到所有的mapper.xml映射文件
   mapperLocations: classpath*:mapper/**/*Mapper.xml
   # 加载全局的配置文件