tianyun 2 rokov pred
rodič
commit
fbed7d9313

+ 2 - 0
mybatis-test/src/main/java/com/alvin/db/Application.java

@@ -1,10 +1,12 @@
 package com.alvin.db;
 
 
+import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 
 @SpringBootApplication
+@MapperScan("com.alvin.db.mapper")
 public class Application {
     public static void main(String[] args) {
         SpringApplication.run(Application.class);

+ 5 - 0
mybatis-test/src/main/java/com/alvin/db/service/impl/AccessRoleServiceImpl.java

@@ -4,6 +4,7 @@ import com.alvin.db.entity.AccessRole;
 import com.alvin.db.mapper.AccessRoleMapper;
 import com.alvin.db.service.IAccessRoleService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 /**
@@ -17,4 +18,8 @@ import org.springframework.stereotype.Service;
 @Service
 public class AccessRoleServiceImpl extends ServiceImpl<AccessRoleMapper, AccessRole> implements IAccessRoleService {
 
+    @Autowired
+    private AccessRoleMapper accessRoleMapper;
+
+
 }

+ 1 - 1
mybatis-test/src/main/resources/application.yml

@@ -1,5 +1,5 @@
 server:
-  port: 9095
+  port: 9096
   servlet:
     encoding:
       charset: UTF-8