일부 기능 DB화 연동 처리 - 중간백업
This commit is contained in:
parent
b616f5b653
commit
5085636391
@ -33,7 +33,6 @@
|
||||
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v8.5"/>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
||||
|
||||
43
db/settings/init.sql
Normal file
43
db/settings/init.sql
Normal file
@ -0,0 +1,43 @@
|
||||
create table SM_CODE_M (
|
||||
L_CODE_ID varchar(35) not null
|
||||
, L_CODE_NM varchar(50) not null
|
||||
, L_CODE_NM_EN varchar(50)
|
||||
, L_CODE_DESC varchar(500)
|
||||
, SORT_SEQ int
|
||||
, USE_YN varchar(1)
|
||||
, REG_ID varchar(35)
|
||||
, REG_DD datetime
|
||||
, MOD_ID varchar(35)
|
||||
, MOD_DD datetime
|
||||
);
|
||||
|
||||
create table SM_CODE_S (
|
||||
S_CODE_ID varchar(35) not null
|
||||
, L_CODE_ID varchar(35) not null
|
||||
, S_CODE_NM varchar(100)
|
||||
, S_CODE_NM_EN varchar(100)
|
||||
, S_CODE_DESC varchar(500)
|
||||
, SORT_SEQ int
|
||||
, COLUMN1 varchar(50)
|
||||
, COLUMN2 varchar(50)
|
||||
, USE_YN varchar(1)
|
||||
, REG_ID varchar(35)
|
||||
, REG_DD datetime
|
||||
, MOD_ID varchar(35)
|
||||
, MOD_DD datetime
|
||||
);
|
||||
|
||||
|
||||
select * from SM_CODE_M
|
||||
|
||||
|
||||
SELECT B.S_CODE_ID
|
||||
, B.S_CODE_NM
|
||||
|
||||
select *
|
||||
FROM SM_CODE_M A,
|
||||
SM_CODE_S B
|
||||
WHERE A.L_CODE_ID = B.L_CODE_ID
|
||||
AND A.USE_YN = 'Y'
|
||||
AND B.USE_YN = 'Y'
|
||||
ORDER BY B.SORT_SEQ
|
||||
5
pom.xml
5
pom.xml
@ -235,6 +235,11 @@
|
||||
<artifactId>mariadb-java-client</artifactId>
|
||||
<version>2.2.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-dbcp</groupId>
|
||||
<artifactId>commons-dbcp</artifactId>
|
||||
<version>1.4</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
@ -0,0 +1,306 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package egovframework.com.cmm.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import org.apache.ibatis.session.ResultHandler;
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import egovframework.rte.psl.dataaccess.EgovAbstractMapper;
|
||||
/**
|
||||
* EgovComAbstractDAO.java 클래스
|
||||
*
|
||||
* @author 서준식
|
||||
* @since 2011. 9. 23.
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- ------------- ----------------------
|
||||
* 2011. 9. 23. 서준식 최초 생성
|
||||
* 2016. 5. 11. 장동한 myBatis 방식 적용
|
||||
* </pre>
|
||||
*/
|
||||
public abstract class EgovComAbstractDAO extends EgovAbstractMapper{
|
||||
|
||||
private final Logger LOGGER = LoggerFactory.getLogger(this.getClass());
|
||||
|
||||
@Resource(name="egov.sqlSession")
|
||||
public void setSqlSessionFactory(SqlSessionFactory sqlSession) {
|
||||
super.setSqlSessionFactory(sqlSession);
|
||||
}
|
||||
|
||||
/**
|
||||
* 입력 처리 SQL mapping 을 실행한다.
|
||||
*
|
||||
* @param queryId - 입력 처리 SQL mapping 쿼리 ID
|
||||
*
|
||||
* @return DBMS가 지원하는 경우 insert 적용 결과 count
|
||||
*/
|
||||
@Override
|
||||
public int insert(String queryId) {
|
||||
LOGGER.debug("queryId = "+queryId);
|
||||
return getSqlSession().insert(queryId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 입력 처리 SQL mapping 을 실행한다.
|
||||
*
|
||||
* @param queryId - 입력 처리 SQL mapping 쿼리 ID
|
||||
* @param parameterObject - 입력 처리 SQL mapping 입력 데이터를 세팅한 파라메터 객체(보통 VO 또는 Map)
|
||||
*
|
||||
* @return DBMS가 지원하는 경우 insert 적용 결과 count
|
||||
*/
|
||||
@Override
|
||||
public int insert(String queryId, Object parameterObject) {
|
||||
LOGGER.debug("queryId = "+queryId);
|
||||
return getSqlSession().insert(queryId, parameterObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* 수정 처리 SQL mapping 을 실행한다.
|
||||
*
|
||||
* @param queryId - 수정 처리 SQL mapping 쿼리 ID
|
||||
*
|
||||
* @return DBMS가 지원하는 경우 update 적용 결과 count
|
||||
*/
|
||||
@Override
|
||||
public int update(String queryId) {
|
||||
LOGGER.debug("queryId = "+queryId);
|
||||
return getSqlSession().update(queryId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 수정 처리 SQL mapping 을 실행한다.
|
||||
*
|
||||
* @param queryId - 수정 처리 SQL mapping 쿼리 ID
|
||||
* @param parameterObject - 수정 처리 SQL mapping 입력 데이터(key 조건 및 변경 데이터)를 세팅한 파라메터 객체(보통 VO 또는 Map)
|
||||
*
|
||||
* @return DBMS가 지원하는 경우 update 적용 결과 count
|
||||
*/
|
||||
@Override
|
||||
public int update(String queryId, Object parameterObject) {
|
||||
LOGGER.debug("queryId = "+queryId);
|
||||
return getSqlSession().update(queryId, parameterObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* 삭제 처리 SQL mapping 을 실행한다.
|
||||
*
|
||||
* @param queryId - 삭제 처리 SQL mapping 쿼리 ID
|
||||
*
|
||||
* @return DBMS가 지원하는 경우 delete 적용 결과 count
|
||||
*/
|
||||
@Override
|
||||
public int delete(String queryId) {
|
||||
LOGGER.debug("queryId = "+queryId);
|
||||
return getSqlSession().delete(queryId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 삭제 처리 SQL mapping 을 실행한다.
|
||||
*
|
||||
* @param queryId - 삭제 처리 SQL mapping 쿼리 ID
|
||||
* @param parameterObject - 삭제 처리 SQL mapping 입력 데이터(일반적으로 key 조건)를 세팅한 파라메터 객체(보통 VO 또는 Map)
|
||||
*
|
||||
* @return DBMS가 지원하는 경우 delete 적용 결과 count
|
||||
*/
|
||||
@Override
|
||||
public int delete(String queryId, Object parameterObject) {
|
||||
LOGGER.debug("queryId = "+queryId);
|
||||
return getSqlSession().delete(queryId, parameterObject);
|
||||
}
|
||||
|
||||
//CHECKSTYLE:OFF
|
||||
/**
|
||||
* 명명규칙에 맞춰 selectOne()로 변경한다.
|
||||
* @deprecated select() 메소드로 대체
|
||||
*
|
||||
* @see EgovAbstractMapper.selectOne()
|
||||
*/
|
||||
//CHECKSTYLE:ON
|
||||
@Deprecated
|
||||
public Object selectByPk(String queryId, Object parameterObject) {
|
||||
LOGGER.debug("queryId = "+queryId);
|
||||
return getSqlSession().selectOne(queryId, parameterObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* 단건조회 처리 SQL mapping 을 실행한다.
|
||||
*
|
||||
* @param queryId - 단건 조회 처리 SQL mapping 쿼리 ID
|
||||
*
|
||||
* @return 결과 객체 - SQL mapping 파일에서 지정한 resultType/resultMap 에 의한 단일 결과 객체(보통 VO 또는 Map)
|
||||
*/
|
||||
@Override
|
||||
public <T> T selectOne(String queryId) {
|
||||
LOGGER.debug("queryId = "+queryId);
|
||||
return getSqlSession().selectOne(queryId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 단건조회 처리 SQL mapping 을 실행한다.
|
||||
*
|
||||
* @param queryId - 단건 조회 처리 SQL mapping 쿼리 ID
|
||||
* @param parameterObject - 단건 조회 처리 SQL mapping 입력 데이터(key)를 세팅한 파라메터 객체(보통 VO 또는 Map)
|
||||
*
|
||||
* @return 결과 객체 - SQL mapping 파일에서 지정한 resultType/resultMap 에 의한 단일 결과 객체(보통 VO 또는 Map)
|
||||
*/
|
||||
@Override
|
||||
public <T> T selectOne(String queryId, Object parameterObject) {
|
||||
LOGGER.debug("queryId = "+queryId);
|
||||
return getSqlSession().selectOne(queryId, parameterObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* 결과 목록을 Map 을 변환한다.
|
||||
* 모든 구문이 파라미터를 필요로 하지는 않기 때문에, 파라미터 객체를 요구하지 않는 형태로 오버로드되었다.
|
||||
*
|
||||
* @param queryId - 단건 조회 처리 SQL mapping 쿼리 ID
|
||||
* @param mapKey - 결과 객체의 프로퍼티 중 하나를 키로 사용
|
||||
*
|
||||
* @return 결과 객체 - SQL mapping 파일에서 지정한 resultType/resultMap 에 의한 단일 결과 객체(보통 VO 또는 Map)의 Map
|
||||
*/
|
||||
@Override
|
||||
public <K, V> Map<K, V> selectMap(String queryId, String mapKey) {
|
||||
LOGGER.debug("queryId = "+queryId);
|
||||
return getSqlSession().selectMap(queryId, mapKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* 결과 목록을 Map 을 변환한다.
|
||||
* 모든 구문이 파라미터를 필요로 하지는 않기 때문에, 파라미터 객체를 요구하지 않는 형태로 오버로드되었다.
|
||||
*
|
||||
* @param queryId - 단건 조회 처리 SQL mapping 쿼리 ID
|
||||
* @param parameterObject - 맵 조회 처리 SQL mapping 입력 데이터(조회 조건)를 세팅한 파라메터 객체(보통 VO 또는 Map)
|
||||
* @param mapKey - 결과 객체의 프로퍼티 중 하나를 키로 사용
|
||||
*
|
||||
* @return 결과 객체 - SQL mapping 파일에서 지정한 resultType/resultMap 에 의한 단일 결과 객체(보통 VO 또는 Map)의 Map
|
||||
*/
|
||||
@Override
|
||||
public <K, V> Map<K, V> selectMap(String queryId, Object parameterObject, String mapKey) {
|
||||
LOGGER.debug("queryId = "+queryId);
|
||||
return getSqlSession().selectMap(queryId, parameterObject, mapKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* 결과 목록을 Map 을 변환한다.
|
||||
* 모든 구문이 파라미터를 필요로 하지는 않기 때문에, 파라미터 객체를 요구하지 않는 형태로 오버로드되었다.
|
||||
*
|
||||
* @param queryId - 단건 조회 처리 SQL mapping 쿼리 ID
|
||||
* @param parameterObject - 맵 조회 처리 SQL mapping 입력 데이터(조회 조건)를 세팅한 파라메터 객체(보통 VO 또는 Map)
|
||||
* @param mapKey - 결과 객체의 프로퍼티 중 하나를 키로 사용
|
||||
* @param rowBounds - 특정 개수 만큼의 레코드를 건너띄게 함
|
||||
*
|
||||
* @return 결과 객체 - SQL mapping 파일에서 지정한 resultType/resultMap 에 의한 단일 결과 객체(보통 VO 또는 Map)의 Map
|
||||
*/
|
||||
@Override
|
||||
public <K, V> Map<K, V> selectMap(String queryId, Object parameterObject, String mapKey, RowBounds rowBounds) {
|
||||
LOGGER.debug("queryId = "+queryId);
|
||||
return getSqlSession().selectMap(queryId, parameterObject, mapKey, rowBounds);
|
||||
}
|
||||
|
||||
//CHECKSTYLE:OFF
|
||||
/**
|
||||
* 명명규칙에 맞춰 selectList()로 변경한다.
|
||||
*
|
||||
* @see EgovAbstractMapper.selectList()
|
||||
* @deprecated List<?> 메소드로 대체
|
||||
*/
|
||||
//CHECKSTYLE:ON
|
||||
@Deprecated
|
||||
public List<?> list(String queryId, Object parameterObject) {
|
||||
LOGGER.debug("queryId = "+queryId);
|
||||
return getSqlSession().selectList(queryId, parameterObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* 리스트 조회 처리 SQL mapping 을 실행한다.
|
||||
*
|
||||
* @param queryId - 리스트 조회 처리 SQL mapping 쿼리 ID
|
||||
*
|
||||
* @return 결과 List 객체 - SQL mapping 파일에서 지정한 resultType/resultMap 에 의한 결과 객체(보통 VO 또는 Map)의 List
|
||||
*/
|
||||
@Override
|
||||
public <E> List<E> selectList(String queryId) {
|
||||
LOGGER.debug("queryId = "+queryId);
|
||||
return getSqlSession().selectList(queryId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 리스트 조회 처리 SQL mapping 을 실행한다.
|
||||
*
|
||||
* @param queryId - 리스트 조회 처리 SQL mapping 쿼리 ID
|
||||
* @param parameterObject - 리스트 조회 처리 SQL mapping 입력 데이터(조회 조건)를 세팅한 파라메터 객체(보통 VO 또는 Map)
|
||||
*
|
||||
* @return 결과 List 객체 - SQL mapping 파일에서 지정한 resultType/resultMap 에 의한 결과 객체(보통 VO 또는 Map)의 List
|
||||
*/
|
||||
@Override
|
||||
public <E> List<E> selectList(String queryId, Object parameterObject) {
|
||||
LOGGER.debug("queryId = "+queryId);
|
||||
return getSqlSession().selectList(queryId, parameterObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* 리스트 조회 처리 SQL mapping 을 실행한다.
|
||||
*
|
||||
* @param queryId - 리스트 조회 처리 SQL mapping 쿼리 ID
|
||||
* @param parameterObject - 리스트 조회 처리 SQL mapping 입력 데이터(조회 조건)를 세팅한 파라메터 객체(보통 VO 또는 Map)
|
||||
* @param rowBounds - 특정 개수 만큼의 레코드를 건너띄게 함
|
||||
*
|
||||
* @return 결과 List 객체 - SQL mapping 파일에서 지정한 resultType/resultMap 에 의한 결과 객체(보통 VO 또는 Map)의 List
|
||||
*/
|
||||
@Override
|
||||
public <E> List<E> selectList(String queryId, Object parameterObject, RowBounds rowBounds) {
|
||||
LOGGER.debug("queryId = "+queryId);
|
||||
return getSqlSession().selectList(queryId, parameterObject, rowBounds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 부분 범위 리스트 조회 처리 SQL mapping 을 실행한다.
|
||||
* (부분 범위 - pageIndex 와 pageSize 기반으로 현재 부분 범위 조회를 위한 skipResults, maxResults 를 계산하여 ibatis 호출)
|
||||
*
|
||||
* @param queryId - 리스트 조회 처리 SQL mapping 쿼리 ID
|
||||
* @param parameterObject - 리스트 조회 처리 SQL mapping 입력 데이터(조회 조건)를 세팅한 파라메터 객체(보통 VO 또는 Map)
|
||||
* @param pageIndex - 현재 페이지 번호
|
||||
* @param pageSize - 한 페이지 조회 수(pageSize)
|
||||
*
|
||||
* @return 부분 범위 결과 List 객체 - SQL mapping 파일에서 지정한 resultType/resultMap 에 의한 부분 범위 결과 객체(보통 VO 또는 Map) List
|
||||
*/
|
||||
@Override
|
||||
public List<?> listWithPaging(String queryId, Object parameterObject, int pageIndex, int pageSize) {
|
||||
LOGGER.debug("queryId = "+queryId);
|
||||
int skipResults = pageIndex * pageSize;
|
||||
//int maxResults = (pageIndex * pageSize) + pageSize;
|
||||
|
||||
RowBounds rowBounds = new RowBounds(skipResults, pageSize);
|
||||
|
||||
return getSqlSession().selectList(queryId, parameterObject, rowBounds);
|
||||
}
|
||||
|
||||
/**
|
||||
* SQL 조회 결과를 ResultHandler를 이용해서 출력한다.
|
||||
* ResultHandler를 상속해 구현한 커스텀 핸들러의 handleResult() 메서드에 따라 실행된다.
|
||||
*
|
||||
* @param queryId - 리스트 조회 처리 SQL mapping 쿼리 ID
|
||||
* @param handler - 조회 결과를 제어하기 위해 구현한 ResultHandler
|
||||
* @return
|
||||
*
|
||||
* @return 결과 List 객체 - SQL mapping 파일에서 지정한 resultType/resultMap 에 의한 결과 객체(보통 VO 또는 Map)의 List
|
||||
*/
|
||||
@Override
|
||||
public void listToOutUsingResultHandler(String queryId, ResultHandler handler) {
|
||||
LOGGER.debug("queryId = "+queryId);
|
||||
getSqlSession().select(queryId, handler);
|
||||
}
|
||||
}
|
||||
@ -68,7 +68,7 @@ public class BoardController extends NlibCommonController
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/board/listNotices.do")
|
||||
public String listNotices(HttpServletRequest req, Authentication authentication, @RequestParam Map<String, String> paramMap, ModelMap model) {
|
||||
public String listNotices(HttpServletRequest req, Authentication authentication, @RequestParam Map<String, String> paramMap, ModelMap model) throws Exception {
|
||||
|
||||
String searchKeyword = paramMap.get("searchKeyword");
|
||||
String pageIndex = StringUtil.getString(paramMap.get("pageIndex"), "1");
|
||||
@ -82,24 +82,18 @@ public class BoardController extends NlibCommonController
|
||||
log.debug("listNotices > articleType = " + articleType);
|
||||
log.debug("listNotices > message = " + message);
|
||||
|
||||
DataApiReqVO reqVOforCode = new DataApiReqVO();
|
||||
reqVOforCode.setAuthKey(createAuthKey(req, authentication));
|
||||
reqVOforCode.setPageIndex(0);
|
||||
reqVOforCode.setPageSize(0);
|
||||
// 페이징 사이즈 코드 목록 조회
|
||||
reqVOforCode.addInfoItem("codeUpperId", "PAGE_SIZE");
|
||||
DataApiResVO resVOforPageSize = codeService.listCodes(reqVOforCode);
|
||||
List<HashMap<String,String>> pageSizeCodes = codeService.listCodes("PAGE_SIZE");
|
||||
|
||||
// 공지사항 유형 코드 목록 조회
|
||||
reqVOforCode.addInfoItem("codeUpperId", "ARTICLE_TYPE");
|
||||
DataApiResVO resVOforArticleType = codeService.listCodes(reqVOforCode);
|
||||
List<HashMap<String,String>> articleTypeCodes = codeService.listCodes("ARTICLE_TYPE");
|
||||
|
||||
// 반환 정보
|
||||
model.addAttribute("pageIndex" , pageIndex);
|
||||
model.addAttribute("pageSize" , pageSize);
|
||||
model.addAttribute("searchKeyword", searchKeyword);
|
||||
model.addAttribute("pageSizeCodes", resVOforPageSize.getList());
|
||||
model.addAttribute("articleTypeCodes", resVOforArticleType.getList());
|
||||
model.addAttribute("pageSizeCodes", pageSizeCodes);
|
||||
model.addAttribute("articleTypeCodes", articleTypeCodes);
|
||||
model.addAttribute("articleType" , articleType);
|
||||
model.addAttribute("message" , message);
|
||||
|
||||
@ -114,7 +108,7 @@ public class BoardController extends NlibCommonController
|
||||
*/
|
||||
@RequestMapping(value="/board/listNoticesAjax.do")
|
||||
public ResponseEntity<String> listNoticesAjax(HttpServletRequest req,
|
||||
Authentication authentication, @RequestBody Map<String, String> paramMap) {
|
||||
Authentication authentication, @RequestBody Map<String, String> paramMap) throws Exception {
|
||||
|
||||
String searchKeyword = paramMap.get("searchKeyword");
|
||||
String pageIndex = StringUtil.getString(paramMap.get("pageIndex"), "1");
|
||||
@ -159,7 +153,7 @@ public class BoardController extends NlibCommonController
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/board/selectNotice.do")
|
||||
public String selectNotice(HttpServletRequest req, Authentication authentication, @RequestParam Map<String, String> paramMap, ModelMap model) {
|
||||
public String selectNotice(HttpServletRequest req, Authentication authentication, @RequestParam Map<String, String> paramMap, ModelMap model) throws Exception {
|
||||
|
||||
// 목록 이동시 전달할 매개변수
|
||||
String searchKeyword = paramMap.get("searchKeyword");
|
||||
@ -212,7 +206,7 @@ public class BoardController extends NlibCommonController
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/board/listFAQs.do")
|
||||
public String listFAQs(HttpServletRequest req, Authentication authentication, @RequestParam Map<String, String> paramMap, ModelMap model) {
|
||||
public String listFAQs(HttpServletRequest req, Authentication authentication, @RequestParam Map<String, String> paramMap, ModelMap model) throws Exception {
|
||||
|
||||
String searchKeyword = paramMap.get("searchKeyword");
|
||||
String pageIndex = StringUtil.getString(paramMap.get("pageIndex"), "1");
|
||||
@ -230,20 +224,20 @@ public class BoardController extends NlibCommonController
|
||||
reqVOforCode.setAuthKey(createAuthKey(req, authentication));
|
||||
reqVOforCode.setPageIndex(0);
|
||||
reqVOforCode.setPageSize(0);
|
||||
|
||||
|
||||
// 페이징 사이즈 코드 목록 조회
|
||||
reqVOforCode.addInfoItem("codeUpperId", "PAGE_SIZE");
|
||||
DataApiResVO resVOforPageSize = codeService.listCodes(reqVOforCode);
|
||||
List<HashMap<String,String>> pageSizeCodes = codeService.listCodes("PAGE_SIZE");
|
||||
|
||||
// 유형 코드 목록 조회
|
||||
reqVOforCode.addInfoItem("codeUpperId", "FAQ_TYPE");
|
||||
DataApiResVO resVOforFaqType = codeService.listCodes(reqVOforCode);
|
||||
List<HashMap<String,String>> articleTypeCodes = codeService.listCodes("FAQ_TYPE");
|
||||
|
||||
// 반환 정보
|
||||
model.addAttribute("pageIndex" , pageIndex);
|
||||
model.addAttribute("pageSize" , pageSize);
|
||||
model.addAttribute("searchKeyword", searchKeyword);
|
||||
model.addAttribute("pageSizeCodes", resVOforPageSize.getList());
|
||||
model.addAttribute("faqTypeCodes" , resVOforFaqType.getList());
|
||||
model.addAttribute("pageSizeCodes", pageSizeCodes);
|
||||
model.addAttribute("faqTypeCodes" , articleTypeCodes);
|
||||
model.addAttribute("message" , message);
|
||||
model.addAttribute("faqType" , faqType);
|
||||
model.addAttribute("faqType" , faqType);
|
||||
@ -260,7 +254,7 @@ public class BoardController extends NlibCommonController
|
||||
*/
|
||||
@RequestMapping(value="/board/listFAQsAjax.do")
|
||||
public ResponseEntity<String> listFAQsAjax(HttpServletRequest req,
|
||||
Authentication authentication, @RequestBody Map<String, String> paramMap) {
|
||||
Authentication authentication, @RequestBody Map<String, String> paramMap) throws Exception {
|
||||
|
||||
String searchKeyword = paramMap.get("searchKeyword");
|
||||
String pageIndex = StringUtil.getString(paramMap.get("pageIndex"), "1");
|
||||
@ -307,7 +301,7 @@ public class BoardController extends NlibCommonController
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/board/selectFAQAjax.do")
|
||||
public ResponseEntity<String> selectFAQAjax(HttpServletRequest req, Authentication authentication, @RequestBody Map<String, String> paramMap) {
|
||||
public ResponseEntity<String> selectFAQAjax(HttpServletRequest req, Authentication authentication, @RequestBody Map<String, String> paramMap) throws Exception {
|
||||
|
||||
// 게시물 번호
|
||||
String articleNo = paramMap.get("articleNo");
|
||||
@ -336,7 +330,7 @@ public class BoardController extends NlibCommonController
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/board/listQnAs.do")
|
||||
public String listQnAs(HttpServletRequest req, Authentication authentication, @RequestParam Map<String, String> paramMap, ModelMap model) {
|
||||
public String listQnAs(HttpServletRequest req, Authentication authentication, @RequestParam Map<String, String> paramMap, ModelMap model) throws Exception {
|
||||
|
||||
String searchKeyword = paramMap.get("searchKeyword");
|
||||
String pageIndex = StringUtil.getString(paramMap.get("pageIndex"), "1");
|
||||
@ -348,19 +342,15 @@ public class BoardController extends NlibCommonController
|
||||
log.debug("listQnAs > searchKeyword = " + searchKeyword);
|
||||
log.debug("listQnAs > message = " + message);
|
||||
|
||||
|
||||
// 페이징 사이즈 코드 목록 조회
|
||||
DataApiReqVO reqVOforPageSize = new DataApiReqVO();
|
||||
reqVOforPageSize.setAuthKey(createAuthKey(req, authentication));
|
||||
reqVOforPageSize.setPageIndex(pageIndex);
|
||||
reqVOforPageSize.setPageSize(pageSize);
|
||||
reqVOforPageSize.addInfoItem("codeUpperId", "PAGE_SIZE");
|
||||
DataApiResVO resVOforPageSize = codeService.listCodes(reqVOforPageSize);
|
||||
List<HashMap<String,String>> pageSizeCodes = codeService.listCodes("PAGE_SIZE");
|
||||
|
||||
// 반환 정보
|
||||
model.addAttribute("pageIndex" , pageIndex);
|
||||
model.addAttribute("pageSize" , pageSize);
|
||||
model.addAttribute("searchKeyword", searchKeyword);
|
||||
model.addAttribute("pageSizeCodes", resVOforPageSize.getList());
|
||||
model.addAttribute("pageSizeCodes", pageSizeCodes);
|
||||
model.addAttribute("message" , message);
|
||||
|
||||
return "nlib/board/listQnAs";
|
||||
@ -374,7 +364,7 @@ public class BoardController extends NlibCommonController
|
||||
*/
|
||||
@RequestMapping(value="/board/listQnAsAjax.do")
|
||||
public ResponseEntity<String> listQnAsAjax(HttpServletRequest req,
|
||||
Authentication authentication, @RequestBody Map<String, String> paramMap) {
|
||||
Authentication authentication, @RequestBody Map<String, String> paramMap) throws Exception {
|
||||
|
||||
String searchKeyword = paramMap.get("searchKeyword");
|
||||
String pageIndex = StringUtil.getString(paramMap.get("pageIndex"), "1");
|
||||
@ -418,7 +408,7 @@ public class BoardController extends NlibCommonController
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/board/selectQnA.do")
|
||||
public String selectQnA(HttpServletRequest req, Authentication authentication, @RequestParam Map<String, String> paramMap, ModelMap model) {
|
||||
public String selectQnA(HttpServletRequest req, Authentication authentication, @RequestParam Map<String, String> paramMap, ModelMap model) throws Exception {
|
||||
|
||||
// 목록 이동시 전달할 매개변수
|
||||
String searchKeyword = paramMap.get("searchKeyword");
|
||||
@ -470,7 +460,7 @@ public class BoardController extends NlibCommonController
|
||||
@RequestMapping("/board/insertQnAForm.do")
|
||||
public String insertQnAForm(HttpServletRequest req, Authentication authentication
|
||||
, @RequestParam Map<String, String> paramMap
|
||||
, ModelMap model) {
|
||||
, ModelMap model) throws Exception {
|
||||
|
||||
// 입력 매개변수 출력 설정
|
||||
addParamsToModel(paramMap, model);
|
||||
@ -492,7 +482,7 @@ public class BoardController extends NlibCommonController
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/board/insertQnA.do")
|
||||
public String insertQnA(HttpServletRequest req, Authentication authentication, @RequestParam Map<String, String> paramMap, ModelMap model) {
|
||||
public String insertQnA(HttpServletRequest req, Authentication authentication, @RequestParam Map<String, String> paramMap, ModelMap model) throws Exception {
|
||||
|
||||
NlibLoginVO loginVO = getNlibLoginVO(authentication);
|
||||
|
||||
@ -565,7 +555,7 @@ public class BoardController extends NlibCommonController
|
||||
}
|
||||
|
||||
@RequestMapping("/board/verifyWriter.do")
|
||||
public String verifyWriter(HttpServletRequest req) {
|
||||
public String verifyWriter(HttpServletRequest req) throws Exception {
|
||||
return "nlib/board/verifyWriter";
|
||||
}
|
||||
|
||||
@ -579,7 +569,7 @@ public class BoardController extends NlibCommonController
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/board/updateQnAForm.do")
|
||||
public String updateQnAForm(HttpServletRequest req, Authentication authentication, @RequestParam Map<String, String> paramMap, ModelMap model) {
|
||||
public String updateQnAForm(HttpServletRequest req, Authentication authentication, @RequestParam Map<String, String> paramMap, ModelMap model) throws Exception {
|
||||
|
||||
// 목록 이동시 전달할 매개변수
|
||||
String searchKeyword = paramMap.get("searchKeyword");
|
||||
@ -657,7 +647,7 @@ public class BoardController extends NlibCommonController
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/board/updateQnA.do")
|
||||
public String updateQnA(HttpServletRequest req, Authentication authentication, @RequestParam Map<String, String> paramMap, ModelMap model) {
|
||||
public String updateQnA(HttpServletRequest req, Authentication authentication, @RequestParam Map<String, String> paramMap, ModelMap model) throws Exception {
|
||||
|
||||
log.debug("paramMap > " + paramMap);
|
||||
|
||||
@ -758,7 +748,7 @@ public class BoardController extends NlibCommonController
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/board/deleteQnA.do")
|
||||
public String deleteQnA(HttpServletRequest req, Authentication authentication, @RequestParam Map<String, String> paramMap, ModelMap model) {
|
||||
public String deleteQnA(HttpServletRequest req, Authentication authentication, @RequestParam Map<String, String> paramMap, ModelMap model) throws Exception {
|
||||
|
||||
String message = null;
|
||||
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
|
||||
package nlib.cmm.service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import nlib.restful.service.DataApiReqVO;
|
||||
@ -8,6 +11,6 @@ import nlib.restful.service.DataApiResVO;
|
||||
|
||||
public interface CodeService
|
||||
{
|
||||
public DataApiResVO listCodes(DataApiReqVO reqVO);
|
||||
public List<HashMap<String, String>> listCodes(String iCodeId) throws Exception;
|
||||
|
||||
}
|
||||
@ -1,28 +1,12 @@
|
||||
|
||||
package nlib.cmm.service.impl;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import nlib.cmm.web.MainController;
|
||||
import nlib.restful.DataApi;
|
||||
import nlib.restful.service.DataApiReqVO;
|
||||
import nlib.restful.service.DataApiResVO;
|
||||
import egovframework.rte.psl.dataaccess.mapper.Mapper;
|
||||
|
||||
@Repository("codeDAO")
|
||||
public class CodeDAO extends DataApi
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(CodeDAO.class);
|
||||
|
||||
/**
|
||||
* 주 자원의 URI
|
||||
*/
|
||||
public static final String RESOURCE_URI = "/uac/service/code/list";
|
||||
|
||||
public DataApiResVO listCodes(DataApiReqVO reqVO) {
|
||||
reqVO.setReqUrl(RESOURCE_URI + "/" + reqVO.getInfoItem("codeUpperId"));
|
||||
return get(reqVO);
|
||||
}
|
||||
@Mapper("codeDAO")
|
||||
public interface CodeDAO {
|
||||
|
||||
public List<HashMap<String, String>> listCodes(String iCodeId) throws Exception;
|
||||
}
|
||||
@ -1,6 +1,8 @@
|
||||
|
||||
package nlib.cmm.service.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
@ -9,8 +11,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
import nlib.cmm.service.CodeService;
|
||||
import nlib.restful.service.DataApiReqVO;
|
||||
import nlib.restful.service.DataApiResVO;
|
||||
import nlib.util.StringUtil;
|
||||
|
||||
@Service("codeService")
|
||||
public class CodeServiceImpl extends EgovAbstractServiceImpl implements CodeService
|
||||
@ -20,11 +21,10 @@ public class CodeServiceImpl extends EgovAbstractServiceImpl implements CodeServ
|
||||
@Resource(name="codeDAO")
|
||||
private CodeDAO codeDAO;
|
||||
|
||||
/*public DataApiResVO listCodes(DataApiReqVO reqVO) {
|
||||
return codeDAO.listCodes(reqVO);
|
||||
}*/
|
||||
public List<HashMap<String, String>> listCodes(String iCodeId) throws Exception {
|
||||
|
||||
public DataApiResVO listCodes(DataApiReqVO reqVO) {
|
||||
return codeDAO.listCodes(reqVO);
|
||||
if(StringUtil.isEmpty(iCodeId)) return null;
|
||||
|
||||
return codeDAO.listCodes(iCodeId.toUpperCase());
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,7 @@
|
||||
package nlib.cmm.web;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -8,17 +9,13 @@ import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import nlib.cmm.NlibCommonController;
|
||||
import nlib.cmm.service.CodeService;
|
||||
import nlib.restful.service.DataApiReqVO;
|
||||
import nlib.restful.service.DataApiResVO;
|
||||
import nlib.util.StringUtil;
|
||||
|
||||
@Controller
|
||||
public class CodeController extends NlibCommonController {
|
||||
@ -28,60 +25,16 @@ public class CodeController extends NlibCommonController {
|
||||
@Resource(name="codeService")
|
||||
private CodeService codeService;
|
||||
|
||||
@RequestMapping(value="/code/listCodesAjax.do")
|
||||
public ResponseEntity<String> listCodeAjax(HttpServletRequest req,
|
||||
Authentication authentication, @RequestBody Map<String, String> paramMap) {
|
||||
@RequestMapping( {"/code/listCodes.do"} )
|
||||
public String setContent(HttpServletRequest req, @RequestParam Map<String, String> paramMap, ModelMap model) throws Exception {
|
||||
|
||||
String codeSearchKeyword = paramMap.get("codeSearchKeyword");
|
||||
String codePageIndex = paramMap.get("codePageIndex");
|
||||
String codePageSize = paramMap.get("codePageSize");
|
||||
String codeUpperId = paramMap.get("codeUpperId");
|
||||
String lCodeId = paramMap.get("lCodeId");
|
||||
|
||||
log.debug("listCodeAjax > codeSearchKeyword = " + codeSearchKeyword);
|
||||
log.debug("listCodeAjax > codePageIndex = " + codePageIndex);
|
||||
log.debug("listCodeAjax > codePageSize = " + codePageSize);
|
||||
log.debug("listCodeAjax > codeUpperId = " + codeUpperId);
|
||||
List<HashMap<String, String>> resultList = codeService.listCodes(lCodeId);
|
||||
model.addAttribute("resultList", resultList);
|
||||
model.addAttribute("lCodeId", lCodeId);
|
||||
|
||||
//-------------------------------
|
||||
// REQ VO 구성
|
||||
//-------------------------------
|
||||
DataApiReqVO reqVO = new DataApiReqVO();
|
||||
reqVO.setAuthKey(createAuthKey(req, authentication));
|
||||
reqVO.setPageIndex(codePageIndex);
|
||||
reqVO.setPageSize(codePageSize);
|
||||
|
||||
// 추가 정보 설정
|
||||
reqVO.addInfoItem("searchKeyword", codeSearchKeyword);
|
||||
reqVO.addInfoItem("codeUpperId", codeUpperId);
|
||||
|
||||
// 요청
|
||||
DataApiResVO resVO = codeService.listCodes(reqVO);
|
||||
|
||||
//-------------------------------
|
||||
// JSON변환 응답 처리
|
||||
//-------------------------------
|
||||
// JS-GRID 페이징 처리를 포함한 응답값 처리
|
||||
// (1) 페이징을 서버단에서 처리하는 경우 (pagingloading = false)
|
||||
// {data: [{...}],
|
||||
// itemsCount: 255
|
||||
// }
|
||||
// (2) 페이징을 클라이언트에서 처리하는 경우 (pagingloading = true)
|
||||
// {data: [{...}],
|
||||
// itemsCount: 255
|
||||
// }
|
||||
|
||||
// 코드 페이징 사이즈값이 없거나 0인 경우, 서버에서 페이징 처리하지 않고 전체 데이터 전송
|
||||
if(StringUtil.isEmpty(codePageSize) || Integer.parseInt(codePageSize) <= 0) {
|
||||
return makeResponseEntityJson(resVO.getList());
|
||||
}
|
||||
|
||||
// 코드 페이징 처리되는 경우
|
||||
HashMap<String, Object> retMap = new HashMap<String, Object>();
|
||||
retMap.put("data", resVO.getList());
|
||||
retMap.put("itemsCount", resVO.getRecordTotCount());
|
||||
|
||||
return makeResponseEntityJson(retMap);
|
||||
return "nlib/code/listCodes";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -57,6 +57,7 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
.antMatchers("/board/**")
|
||||
.antMatchers("/inform/**")
|
||||
.antMatchers("/alert/**")
|
||||
.antMatchers("/code/**")
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
@ -23,6 +23,11 @@ Globals.DbType = maria
|
||||
|
||||
#MariaDB
|
||||
# hosts \ud30c\uc77c\uc5d0 \uc120 \ub4f1\ub85d \ud544\uc694 : 210.181.197.70 nlib-db.nculture.org
|
||||
# [\ub85c\uceecPC DB\uc124\uc815]
|
||||
# > create database uac_cltr_db;
|
||||
# > create user 'uac_cltr' identified by 'uac_cltr';
|
||||
# > grant all privileges on uac_cltr_db.* to 'uac_cltr';
|
||||
# > flush privileges;
|
||||
Globals.maria.DriverClassName=org.mariadb.jdbc.Driver
|
||||
Globals.maria.Url=jdbc:mariadb://nlib-db.nculture.org:3306/uac_cltr_db
|
||||
Globals.maria.UserName = uac_cltr
|
||||
|
||||
@ -13,9 +13,6 @@
|
||||
<!-- Type Aliases 설정-->
|
||||
<typeAliases>
|
||||
<typeAlias alias="egovMap" type="egovframework.rte.psl.dataaccess.util.EgovMap" />
|
||||
<typeAlias alias="FileVO" type="egovframework.com.cmm.service.FileVO" />
|
||||
<typeAlias alias="ComDefaultCodeVO" type="egovframework.com.cmm.ComDefaultCodeVO" />
|
||||
<typeAlias alias="comDefaultVO" type="egovframework.com.cmm.ComDefaultVO" />
|
||||
</typeAliases>
|
||||
|
||||
</configuration>
|
||||
@ -1,169 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><!--Converted at: Wed May 11 15:49:38 KST 2016-->
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="FileManageDAO">
|
||||
|
||||
<resultMap id="fileList" type="egovframework.com.cmm.service.FileVO">
|
||||
<result property="atchFileId" column="ATCH_FILE_ID"/>
|
||||
<result property="fileCn" column="FILE_CN"/>
|
||||
<result property="fileExtsn" column="FILE_EXTSN"/>
|
||||
<result property="fileMg" column="FILE_SIZE"/>
|
||||
<result property="fileSn" column="FILE_SN"/>
|
||||
<result property="fileStreCours" column="FILE_STRE_COURS"/>
|
||||
<result property="orignlFileNm" column="ORIGNL_FILE_NM"/>
|
||||
<result property="streFileNm" column="STRE_FILE_NM"/>
|
||||
<result property="creatDt" column="CREAT_DT"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="fileDetail" type="egovframework.com.cmm.service.FileVO">
|
||||
<result property="atchFileId" column="ATCH_FILE_ID"/>
|
||||
<result property="fileCn" column="FILE_CN"/>
|
||||
<result property="fileExtsn" column="FILE_EXTSN"/>
|
||||
<result property="fileMg" column="FILE_SIZE"/>
|
||||
<result property="fileSn" column="FILE_SN"/>
|
||||
<result property="fileStreCours" column="FILE_STRE_COURS"/>
|
||||
<result property="orignlFileNm" column="ORIGNL_FILE_NM"/>
|
||||
<result property="streFileNm" column="STRE_FILE_NM"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="selectFileList" parameterType="FileVO" resultMap="fileList">
|
||||
|
||||
SELECT
|
||||
a.ATCH_FILE_ID, b.FILE_CN, b.FILE_SN, b.FILE_STRE_COURS, b.STRE_FILE_NM,
|
||||
b.FILE_EXTSN, b.ORIGNL_FILE_NM, b.FILE_SIZE, a.CREAT_DT
|
||||
FROM
|
||||
COMTNFILE a, COMTNFILEDETAIL b
|
||||
WHERE
|
||||
a.ATCH_FILE_ID = #{atchFileId}
|
||||
AND
|
||||
a.ATCH_FILE_ID = b.ATCH_FILE_ID
|
||||
AND
|
||||
a.USE_AT = 'Y'
|
||||
ORDER BY b.FILE_SN
|
||||
|
||||
</select>
|
||||
|
||||
<insert id="insertFileMaster" parameterType="FileVO">
|
||||
|
||||
INSERT INTO COMTNFILE
|
||||
(ATCH_FILE_ID, CREAT_DT, USE_AT)
|
||||
VALUES
|
||||
( #{atchFileId}, SYSDATE(), 'Y')
|
||||
|
||||
</insert>
|
||||
|
||||
<insert id="insertFileDetail" parameterType="FileVO">
|
||||
|
||||
INSERT INTO COMTNFILEDETAIL
|
||||
( ATCH_FILE_ID, FILE_SN, FILE_STRE_COURS, STRE_FILE_NM,
|
||||
ORIGNL_FILE_NM, FILE_EXTSN, FILE_SIZE, FILE_CN )
|
||||
VALUES
|
||||
( #{atchFileId}, #{fileSn}, #{fileStreCours}, #{streFileNm},
|
||||
#{orignlFileNm}, #{fileExtsn}, #{fileMg}, #{fileCn} )
|
||||
|
||||
</insert>
|
||||
|
||||
<delete id="deleteFileDetail" parameterType="FileVO">
|
||||
|
||||
DELETE FROM COMTNFILEDETAIL
|
||||
WHERE
|
||||
ATCH_FILE_ID = #{atchFileId}
|
||||
AND
|
||||
FILE_SN = #{fileSn}
|
||||
|
||||
</delete>
|
||||
|
||||
<select id="getMaxFileSN" parameterType="FileVO" resultType="java.lang.Integer">
|
||||
|
||||
SELECT IFNULL(MAX(FILE_SN),0)+1 AS FILE_SN
|
||||
FROM COMTNFILEDETAIL
|
||||
WHERE ATCH_FILE_ID = #{atchFileId}
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectFileInf" parameterType="FileVO" resultMap="fileDetail">
|
||||
|
||||
SELECT
|
||||
ATCH_FILE_ID, FILE_CN, FILE_SN, FILE_STRE_COURS, STRE_FILE_NM,
|
||||
FILE_EXTSN, ORIGNL_FILE_NM, FILE_SIZE
|
||||
FROM
|
||||
COMTNFILEDETAIL
|
||||
WHERE
|
||||
ATCH_FILE_ID = #{atchFileId}
|
||||
AND
|
||||
FILE_SN = #{fileSn}
|
||||
|
||||
</select>
|
||||
|
||||
<update id="deleteCOMTNFILE" parameterType="FileVO">
|
||||
|
||||
UPDATE COMTNFILE
|
||||
SET USE_AT = 'N'
|
||||
WHERE ATCH_FILE_ID = #{atchFileId}
|
||||
|
||||
</update>
|
||||
|
||||
<select id="selectFileListByFileNm" parameterType="FileVO" resultMap="fileList">
|
||||
|
||||
SELECT
|
||||
a.ATCH_FILE_ID, b.FILE_CN, b.FILE_SN, b.FILE_STRE_COURS, b.STRE_FILE_NM,
|
||||
b.FILE_EXTSN, b.ORIGNL_FILE_NM, b.FILE_SIZE, a.CREAT_DT
|
||||
FROM
|
||||
COMTNFILE a, COMTNFILEDETAIL b
|
||||
WHERE
|
||||
a.ATCH_FILE_ID = b.ATCH_FILE_ID
|
||||
AND
|
||||
a.USE_AT = 'Y'
|
||||
|
||||
<if test="searchCnd == 'streFileNm'">AND
|
||||
b.STRE_FILE_NM LIKE CONCAT ('%', #{searchWrd},'%')
|
||||
</if>
|
||||
<if test="searchCnd == 'orignlFileNm'">AND
|
||||
b.ORIGNL_FILE_NM LIKE CONCAT ('%', #{searchWrd},'%')
|
||||
</if>
|
||||
|
||||
ORDER BY a.ATCH_FILE_ID, b.FILE_SN
|
||||
LIMIT #{recordCountPerPage} OFFSET #{firstIndex}
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectFileListCntByFileNm" parameterType="FileVO" resultType="java.lang.Integer">
|
||||
|
||||
SELECT
|
||||
COUNT(a.ATCH_FILE_ID)
|
||||
FROM
|
||||
COMTNFILE a, COMTNFILEDETAIL b
|
||||
WHERE
|
||||
a.ATCH_FILE_ID = b.ATCH_FILE_ID
|
||||
AND
|
||||
a.USE_AT = 'Y'
|
||||
|
||||
<if test="searchCnd == 'streFileNm'">AND
|
||||
b.STRE_FILE_NM LIKE CONCAT ('%', #{searchWrd},'%')
|
||||
</if>
|
||||
<if test="searchCnd == 'orignlFileNm'">AND
|
||||
b.ORIGNL_FILE_NM LIKE CONCAT ('%', #{searchWrd},'%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectImageFileList" parameterType="FileVO" resultMap="fileList">
|
||||
|
||||
SELECT
|
||||
a.ATCH_FILE_ID, b.FILE_CN, b.FILE_SN, b.FILE_STRE_COURS, b.STRE_FILE_NM,
|
||||
b.FILE_EXTSN, b.ORIGNL_FILE_NM, b.FILE_SIZE, a.CREAT_DT
|
||||
FROM
|
||||
COMTNFILE a, COMTNFILEDETAIL b
|
||||
WHERE
|
||||
a.ATCH_FILE_ID = #{atchFileId}
|
||||
AND
|
||||
a.ATCH_FILE_ID = b.ATCH_FILE_ID
|
||||
AND
|
||||
UPPER(b.FILE_EXTSN) IN ('GIF','JPG','BMP','PNG')
|
||||
AND
|
||||
a.USE_AT = 'Y'
|
||||
ORDER BY b.FILE_SN
|
||||
<mapper namespace="nlib.cmm.service.impl.CodeDAO">
|
||||
|
||||
<select id="listCodes" parameterType="String" resultType="egovMap">
|
||||
SELECT B.S_CODE_ID
|
||||
, B.S_CODE_NM
|
||||
FROM SM_CODE_M A,
|
||||
SM_CODE_S B
|
||||
WHERE A.L_CODE_ID = #{lCodeId}
|
||||
AND A.L_CODE_ID = B.L_CODE_ID
|
||||
AND A.USE_YN = 'Y'
|
||||
AND B.USE_YN = 'Y'
|
||||
ORDER BY B.SORT_SEQ
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans
|
||||
xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:util="http://www.springframework.org/schema/util"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
|
||||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.0.xsd">
|
||||
|
||||
<bean id="egov.propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
||||
<property name="locations">
|
||||
<list>
|
||||
<value>classpath:/egovframework/egovProps/globals.properties</value>
|
||||
<!-- value>file:/product/jeus/egovProps/globals.properties</value-->
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- DataSource -->
|
||||
<alias name="dataSource" alias="egov.dataSource" />
|
||||
|
||||
<!-- MariaDB -->
|
||||
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
|
||||
<property name="driverClassName" value="${Globals.maria.DriverClassName}"/>
|
||||
<property name="url" value="${Globals.maria.Url}" />
|
||||
<property name="username" value="${Globals.maria.UserName}"/>
|
||||
<property name="password" value="${Globals.maria.Password}"/>
|
||||
</bean>
|
||||
|
||||
<!-- DB Pool이 생성이 되더라고 특정 시간 호출되지 않으면 DBMS 설정에 따라 연결을 끊어질 때
|
||||
이 경우 DBCP를 사용하셨다면.. 다음과 같은 설정을 추가하시면 연결을 유지시켜 줍니다. -->
|
||||
<!--
|
||||
<property name="validationQuery" value="select 1 from dual" />
|
||||
<property name="testWhileIdle" value="true" />
|
||||
<property name="timeBetweenEvictionRunsMillis" value="60000" /> --> <!-- 1분 -->
|
||||
|
||||
<!-- DBCP가 아닌 WAS의 DataSource를 사용하시는 경우도 WAS별로 동일한 설정을 하실 수 있습니다.
|
||||
(WAS별 구체적인 설정은 WAS document 확인) -->
|
||||
</beans>
|
||||
@ -1,6 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd">
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:mybatis="http://mybatis.org/schema/mybatis-spring"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
|
||||
http://mybatis.org/schema/mybatis-spring http://mybatis.org/schema/mybatis-spring.xsd">
|
||||
|
||||
<!-- 실행환경에서 빈이름 참조(EgovAbstractDAO) -->
|
||||
<bean id="egov.lobHandler" class="org.springframework.jdbc.support.lob.DefaultLobHandler" lazy-init="true" />
|
||||
@ -9,17 +12,23 @@
|
||||
<bean id="egov.sqlSession" class="org.mybatis.spring.SqlSessionFactoryBean">
|
||||
<property name="dataSource" ref="egov.dataSource"/>
|
||||
<property name="configLocation" value="classpath:/egovframework/mapper/config/mapper-config.xml" />
|
||||
|
||||
<property name="mapperLocations">
|
||||
<list>
|
||||
<value>classpath:/egovframework/mapper/com/**/*_${Globals.DbType}.xml</value>
|
||||
<value>classpath:/egovframework/mapper/nlib/**/*.xml</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- Mybatis Session Template -->
|
||||
<bean id="egov.sqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
|
||||
<!-- <bean id="egov.sqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
|
||||
<constructor-arg ref="egov.sqlSession"/>
|
||||
</bean>
|
||||
</bean> -->
|
||||
|
||||
<alias name="egov.sqlSession" alias="sqlSession" />
|
||||
|
||||
<!-- MapperConfigurer setup for MyBatis Database Layer with @Mapper("deptMapper") in DeptMapper Interface -->
|
||||
<bean class="egovframework.rte.psl.dataaccess.mapper.MapperConfigurer">
|
||||
<property name="basePackage" value="nlib" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@ -6,10 +6,10 @@
|
||||
</Console>
|
||||
</Appenders>
|
||||
<Loggers>
|
||||
<Logger name="java.sql" level="INFO" additivity="false">
|
||||
<Logger name="java.sql" level="DEBUG" additivity="false">
|
||||
<AppenderRef ref="console" />
|
||||
</Logger>
|
||||
<Logger name="egovframework" level="DEBUG" additivity="false">
|
||||
<Logger name="egovframework" level="INFO" additivity="false">
|
||||
<AppenderRef ref="console" />
|
||||
</Logger>
|
||||
<!-- log SQL with timing information, post execution -->
|
||||
|
||||
83
src/main/webapp/WEB-INF/jsp/nlib/code/listCodes.jsp
Normal file
83
src/main/webapp/WEB-INF/jsp/nlib/code/listCodes.jsp
Normal file
@ -0,0 +1,83 @@
|
||||
<%
|
||||
/**
|
||||
* <pre>
|
||||
* @Class Name : listCodes.jsp
|
||||
*
|
||||
* @Description : 묻고답하기 목록을 조회한다.
|
||||
*
|
||||
*
|
||||
* @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @ ------------ -------- ---------------------------
|
||||
* @ 수정일 수정자 수정내용
|
||||
* @ ------------ -------- ---------------------------
|
||||
* @ 2021. 8. 5. KNKIM 최초 생성
|
||||
*
|
||||
*
|
||||
* @author 이씨플라자 * DIGITALSHIP KNKIM
|
||||
* @since 2021. 8. 5.
|
||||
* @version 1.0
|
||||
*
|
||||
*/
|
||||
%>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui" %>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
|
||||
<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %>
|
||||
|
||||
<c:set var="pageTitle">공통코드</c:set>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<title>${pageTitle}</title>
|
||||
|
||||
<script type="text/javaScript" language="javascript">
|
||||
|
||||
$( document ).ready(function() {
|
||||
|
||||
|
||||
}); // document ready
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1>${pageTitle }</h1>
|
||||
|
||||
메시지 : ${message}
|
||||
<br/>
|
||||
|
||||
<form name="codeForm" id="codeForm"
|
||||
action="${pageContext.request.contextPath}/code/listCodes.do"
|
||||
method="post">
|
||||
|
||||
<!-- 검색조건 -->
|
||||
<input type="text" name="lCodeId" id="lCodeId" title="검색어" value="${lCodeId }" size="35" maxlength="50" />
|
||||
<input type="submit" name="btnSearch" id="btnSearch" title="검색버튼" value="검색" />
|
||||
PAGE_SIZE_OPTION
|
||||
|
||||
</form>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>코드</th>
|
||||
<th>코드명</th>
|
||||
</tr>
|
||||
<c:forEach var="codeItem" items="${resultList }" varStatus="status">
|
||||
<tr>
|
||||
<td><c:out value="${codeItem.sCodeId }" /></td>
|
||||
<td><c:out value="${codeItem.sCodeNm }" /></td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -26,6 +26,7 @@
|
||||
<li><a href="#" style="color:#FF5;" onclick="javascript:location.href='${pageContext.request.contextPath}/sample/barcode/getMemberQRCodeForm.do';">QR코드</a></li>
|
||||
<li><a href="#" style="color:#FF5;" onclick="javascript:location.href='${pageContext.request.contextPath}/sample/password/getSampleEncoder.do';">암호화</a></li>
|
||||
<li><a href="#" style="color:#FF5;" onclick="javascript:location.href='${pageContext.request.contextPath}/system/reloadProperties.do';">프로퍼티갱신</a></li>
|
||||
<li><a href="#" style="color:#FF5;" onclick="javascript:location.href='${pageContext.request.contextPath}/code/listCodes.do';">코드조회</a></li>
|
||||
|
||||
</ul>
|
||||
<script type="text/javascript">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user