mybatis 세팅됨

This commit is contained in:
Suh
2024-01-02 17:10:05 +09:00
parent bf8a470a94
commit 2864bb89d4
14 changed files with 174 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
package com.no1.wms;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

View File

@@ -0,0 +1,26 @@
package com.no1.wms.authority;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;
import java.util.UUID;
@Controller
public class AuthorityController {
@Autowired
AuthorityService authorityService;
@GetMapping("/test")
public ModelAndView test(ModelAndView mav){
AuthorityDto dto = authorityService.selectById("94690a18-a933-11ee-b9dd-0242ac110006");
System.out.println(dto.getName());
mav.setViewName("test/kkk");
return mav;
}
}

View File

@@ -0,0 +1,29 @@
package com.no1.wms.authority;
import lombok.AllArgsConstructor;
import lombok.Data;
import org.apache.ibatis.type.Alias;
import java.util.UUID;
@Data
@AllArgsConstructor
@Alias("AuthorityDto")
public class AuthorityDto {
private UUID id;
private String name;
private int account;
private int authority;
private int productCategory;
private int product;
private int prices;
private int vendor;
private int warehouse;
private int stock;
private int planIn;
private int productIn;
private int productOut;
private int board;
private boolean activation;
private boolean isGroupAuthority;
}

View File

@@ -0,0 +1,11 @@
package com.no1.wms.authority;
import org.apache.ibatis.annotations.Mapper;
import java.util.UUID;
@Mapper
public interface AuthorityMapper {
AuthorityDto selectById(String id);
}

View File

@@ -0,0 +1,17 @@
package com.no1.wms.authority;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.UUID;
@Service
public class AuthorityService {
@Autowired
AuthorityMapper mapper;
public AuthorityDto selectById(String id){
return mapper.selectById(id);
}
}

View File

@@ -0,0 +1,12 @@
package com.no1.wms.base;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@Controller
public class BaseController {
@GetMapping("/")
public String base(){
return "base/hello";
}
}

View File

@@ -0,0 +1,15 @@
package com.no1.wms.login;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;
@Controller
public class LoginController {
@GetMapping("/login")
public ModelAndView login(ModelAndView mav){
mav.setViewName("login");
return mav;
}
}

View File

@@ -0,0 +1,7 @@
package com.no1.wms.utils;
import java.util.UUID;
public class Utils {
}