mirror of
https://github.com/suhf/No1WMS.git
synced 2026-02-04 19:54:00 +09:00
tiles * 일때 기능 없앰
This commit is contained in:
@@ -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<AccountDto> list = accountService.selectAll(search, start, ConstantValues.PER_PAGE);
|
||||
|
||||
mav.addObject("list", list);
|
||||
mav.setViewName("account/list");
|
||||
return mav;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
19
src/main/java/com/no1/wms/account/AccountMapper.java
Normal file
19
src/main/java/com/no1/wms/account/AccountMapper.java
Normal file
@@ -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<AccountDto> selectAll(Map<String, Object> m);
|
||||
}
|
||||
@@ -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<AccountDto> selectAll(String search, int start, int perPage){
|
||||
HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
|
||||
|
||||
|
||||
|
||||
return mapper.selectAll(map);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
package com.no1.wms.account;
|
||||
|
||||
public class AccountServiceImpl {
|
||||
|
||||
}
|
||||
@@ -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<AuthorityDto> list = authorityService.selectAll(search, start, PER_PAGE);
|
||||
List<AuthorityDto> list = authorityService.selectAll(search, start, ConstantValues.PER_PAGE);
|
||||
mav.addObject("list", list);
|
||||
mav.setViewName("/authority/list");
|
||||
return mav;
|
||||
|
||||
5
src/main/java/com/no1/wms/utils/ConstantValues.java
Normal file
5
src/main/java/com/no1/wms/utils/ConstantValues.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package com.no1.wms.utils;
|
||||
|
||||
public class ConstantValues {
|
||||
public static final int PER_PAGE = 1000;
|
||||
}
|
||||
6
src/main/resources/mappers/AccountMapper.xml
Normal file
6
src/main/resources/mappers/AccountMapper.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTO Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.no1.wms.authority.AuthorityMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -2,15 +2,24 @@
|
||||
<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN" "http://tiles.apache.org/dtds/tiles-config_3_0.dtd">
|
||||
|
||||
<tiles-definitions>
|
||||
|
||||
<definition name="layout-empty" template="/WEB-INF/views/base/empty.jsp">
|
||||
<put-attribute name="content" value="" />
|
||||
</definition>
|
||||
|
||||
<definition name="layout-tiles" template="/WEB-INF/views/base/layout.jsp">
|
||||
<put-attribute name="navigation" value="/WEB-INF/views/base/navigation.jsp" />
|
||||
<put-attribute name="content" value="">
|
||||
</put-attribute>
|
||||
<put-attribute name="content" value="" />
|
||||
</definition>
|
||||
|
||||
<definition name="*" extends="layout-tiles" template="/WEB-INF/views/base/empty.jsp">
|
||||
<put-attribute name="content" value="/WEB-INF/views/modal/{1}.jsp" />
|
||||
</definition>
|
||||
|
||||
<definition name="*/*" extends="layout-tiles">
|
||||
<put-attribute name="content" value="/WEB-INF/views/{1}/{2}.jsp" />
|
||||
</definition>
|
||||
|
||||
<definition name="*/*/*" extends="layout-tiles">
|
||||
<put-attribute name="content" value="/WEB-INF/views/{1}/{2}/{3}.jsp" />
|
||||
</definition>
|
||||
|
||||
@@ -6,6 +6,6 @@
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
kkkkkk
|
||||
ddddddddddddddddd
|
||||
</body>
|
||||
</html>
|
||||
3
src/main/webapp/WEB-INF/views/modal/empty.jsp
Normal file
3
src/main/webapp/WEB-INF/views/modal/empty.jsp
Normal file
@@ -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"%>
|
||||
<tiles:insertAttribute name="content" />
|
||||
Reference in New Issue
Block a user