diff --git a/src/main/java/com/no1/wms/account/AccountController.java b/src/main/java/com/no1/wms/account/AccountController.java index fd9642f..6f2218d 100644 --- a/src/main/java/com/no1/wms/account/AccountController.java +++ b/src/main/java/com/no1/wms/account/AccountController.java @@ -1,4 +1,26 @@ package com.no1.wms.account; +import com.no1.wms.utils.ConstantValues; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.servlet.ModelAndView; + +import java.util.List; + +@Controller public class AccountController { + + @Autowired + AccountService accountService; + + public ModelAndView list(ModelAndView mav, @RequestParam(defaultValue = "") String search, @RequestParam(defaultValue = "0") int start){ + + List list = accountService.selectAll(search, start, ConstantValues.PER_PAGE); + + mav.addObject("list", list); + mav.setViewName("account/list"); + return mav; + } + } diff --git a/src/main/java/com/no1/wms/account/AccountMapper.java b/src/main/java/com/no1/wms/account/AccountMapper.java new file mode 100644 index 0000000..079dcf6 --- /dev/null +++ b/src/main/java/com/no1/wms/account/AccountMapper.java @@ -0,0 +1,19 @@ +package com.no1.wms.account; + +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +@Repository +@Mapper +public interface AccountMapper { + + int insert(AccountDto dto); + int update(AccountDto dto); + + int selectById(AccountDto dto); + + List selectAll(Map m); +} diff --git a/src/main/java/com/no1/wms/account/AccountMapper.xml b/src/main/java/com/no1/wms/account/AccountMapper.xml deleted file mode 100644 index e69de29..0000000 diff --git a/src/main/java/com/no1/wms/account/AccountService.java b/src/main/java/com/no1/wms/account/AccountService.java index 22c8441..b0e64e6 100644 --- a/src/main/java/com/no1/wms/account/AccountService.java +++ b/src/main/java/com/no1/wms/account/AccountService.java @@ -1,4 +1,35 @@ package com.no1.wms.account; -public interface AccountService { +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Service +public class AccountService { + @Autowired + AccountMapper mapper; + + public int insert(AccountDto dto){ + return mapper.insert(dto); + } + public int update(AccountDto dto){ + return mapper.update(dto); + } + + public int selectById(AccountDto dto){ + return mapper.selectById(dto); + } + + public List selectAll(String search, int start, int perPage){ + HashMap map = new HashMap(); + + + + + return mapper.selectAll(map); + } + } diff --git a/src/main/java/com/no1/wms/account/AccountServiceImpl.java b/src/main/java/com/no1/wms/account/AccountServiceImpl.java deleted file mode 100644 index 46e6f46..0000000 --- a/src/main/java/com/no1/wms/account/AccountServiceImpl.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.no1.wms.account; - -public class AccountServiceImpl { - -} diff --git a/src/main/java/com/no1/wms/authority/AuthorityController.java b/src/main/java/com/no1/wms/authority/AuthorityController.java index 3704b8c..ab32e84 100644 --- a/src/main/java/com/no1/wms/authority/AuthorityController.java +++ b/src/main/java/com/no1/wms/authority/AuthorityController.java @@ -1,6 +1,7 @@ package com.no1.wms.authority; import com.google.gson.Gson; +import com.no1.wms.utils.ConstantValues; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; @@ -14,11 +15,10 @@ import java.util.UUID; public class AuthorityController { @Autowired AuthorityService authorityService; - private static final int PER_PAGE = 1000; @GetMapping("/list") public ModelAndView list(ModelAndView mav, @RequestParam(defaultValue = "") String search, @RequestParam(defaultValue = "0") int start){ - List list = authorityService.selectAll(search, start, PER_PAGE); + List list = authorityService.selectAll(search, start, ConstantValues.PER_PAGE); mav.addObject("list", list); mav.setViewName("/authority/list"); return mav; diff --git a/src/main/java/com/no1/wms/utils/ConstantValues.java b/src/main/java/com/no1/wms/utils/ConstantValues.java new file mode 100644 index 0000000..11af54c --- /dev/null +++ b/src/main/java/com/no1/wms/utils/ConstantValues.java @@ -0,0 +1,5 @@ +package com.no1.wms.utils; + +public class ConstantValues { + public static final int PER_PAGE = 1000; +} diff --git a/src/main/resources/mappers/AccountMapper.xml b/src/main/resources/mappers/AccountMapper.xml new file mode 100644 index 0000000..571d0fd --- /dev/null +++ b/src/main/resources/mappers/AccountMapper.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/tiles/tiles.xml b/src/main/webapp/WEB-INF/tiles/tiles.xml index 1df94ea..bd77f29 100644 --- a/src/main/webapp/WEB-INF/tiles/tiles.xml +++ b/src/main/webapp/WEB-INF/tiles/tiles.xml @@ -2,15 +2,24 @@ + + + + + - - + + + + + + diff --git a/src/main/webapp/WEB-INF/views/base/hello.jsp b/src/main/webapp/WEB-INF/views/base/hello.jsp index f12087e..f3b33d9 100644 --- a/src/main/webapp/WEB-INF/views/base/hello.jsp +++ b/src/main/webapp/WEB-INF/views/base/hello.jsp @@ -6,6 +6,6 @@ Title -kkkkkk +ddddddddddddddddd \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/modal/empty.jsp b/src/main/webapp/WEB-INF/views/modal/empty.jsp new file mode 100644 index 0000000..d6aab83 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/modal/empty.jsp @@ -0,0 +1,3 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%> + \ No newline at end of file