Browse Source

mp添加胜德包扫描注解

24282 1 year ago
parent
commit
fd3277ba0f

+ 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
   # 加载全局的配置文件