공지사항 : 목록, 상세조회 DB연동 변환 처리

This commit is contained in:
KNKIM 2021-09-14 16:43:08 +09:00
parent 9b49319fc9
commit 32335a2ae5
19 changed files with 283 additions and 237 deletions

View File

@ -1,12 +1,17 @@
package nlib.bbs.service;
import java.util.List;
import nlib.cmm.service.PagingVO;
import nlib.util.StringUtil;
public class ArticleVO extends PagingVO {
private String articleId; /* 게시글ID */
private String mngOrgCd; /* 관리문화원코드 */
private String mngOrgNm; /* 관리문화원명 */
private String bdType; /* 게시판유형 */
private String bdTypeName; /* 게시판유형명 */
private String title; /* 제목 */
private String content; /* 내용 */
@ -18,12 +23,27 @@ public class ArticleVO extends PagingVO {
private int viewCnt; /* 조회수 */
private String bdAttachFileId; /* 첨부파일아이디 */
private String attachYn; /* 첨부파일존재여부 */
private String regId; /* 등록자아이디 */
private String regNm; /* 등록자명 */
private String regDd; /* 등록일자 */
private String modId; /* 등록자아이디 */
private String modDd; /* 등록일자 */
private int rno; /* 글번호 */
// 검색관련
private String searchType; /* 검색대상구분 */
private String searchKeyword; /* 검색어 */
// 첨부파일
private List<AttachFileVO> attachFiles = null; /* 첨부파일목록 */
public int getAttachFileCnt() {
if(attachFiles == null) return 0;
return attachFiles.size();
}
public String getArticleId() {
return articleId;
@ -115,6 +135,57 @@ public class ArticleVO extends PagingVO {
public void setModDd(String modDd) {
this.modDd = modDd;
}
public String getRegNm() {
return regNm;
}
public void setRegNm(String regNm) {
this.regNm = regNm;
}
public int getRno() {
return rno;
}
public void setRno(int rno) {
this.rno = rno;
}
public String getSearchType() {
return searchType;
}
public void setSearchType(String searchType) {
this.searchType = searchType;
}
public String getSearchKeyword() {
return searchKeyword;
}
public String getEscapeSearchKeyword() {
return StringUtil.getSqlSearchKeyword(searchKeyword);
}
public void setSearchKeyword(String searchKeyword) {
this.searchKeyword = searchKeyword;
}
public String getAttachYn() {
return attachYn;
}
public void setAttachYn(String attachYn) {
this.attachYn = attachYn;
}
public String getMngOrgNm() {
return mngOrgNm;
}
public void setMngOrgNm(String mngOrgNm) {
this.mngOrgNm = mngOrgNm;
}
public String getBdTypeName() {
return bdTypeName;
}
public void setBdTypeName(String bdTypeName) {
this.bdTypeName = bdTypeName;
}
public List<AttachFileVO> getAttachFiles() {
return attachFiles;
}
public void setAttachFiles(List<AttachFileVO> attachFiles) {
this.attachFiles = attachFiles;
}
}

View File

@ -37,34 +37,10 @@ import nlib.util.StringUtil;
*
*/
@Mapper("ancmntDAO")
public interface AncmntDAO {
public interface AncmntDAO extends BoardDAO {
/*
* 게시글 목록을 조회한다.
* BoardDAO 상속 내용과 동일
*/
public List<ArticleVO> listArticles(ArticleVO ArticleVO) throws Exception;
/**
* 게시글 건수를 조회한다.
*/
public int countArticles(ArticleVO ArticleVO) throws Exception;
/**
* 조회수를 증가시킨다.
*
* @param
* @return
* @throws Exception
*/
public int updateRead(ArticleVO notiVO) throws Exception;
/**
* 게시글 상세 내용을 조회한다.
*
* @param
* @return
* @throws Exception
*/
public ArticleVO selectArticle(ArticleVO notiVO) throws Exception;
}

View File

@ -10,54 +10,19 @@ import org.springframework.stereotype.Service;
import nlib.bbs.service.ArticleVO;
import nlib.bbs.service.BoardService;
import nlib.util.StringUtil;
@Service("ancmntService")
public class AncmntServiceImpl implements BoardService
public class AncmntServiceImpl extends BoardServiceImpl
{
private static final Logger log = LoggerFactory.getLogger(AncmntServiceImpl.class);
static Logger log = LoggerFactory.getLogger(AncmntServiceImpl.class);
@Resource(name="ancmntDAO")
private AncmntDAO ancmntDAO;
AncmntDAO ancmntDAO;
/*
* 게시글 목록을 조회한다.
*/
public List<ArticleVO> listArticles(ArticleVO articleVO) throws Exception {
return ancmntDAO.listArticles(articleVO);
}
/**
* 게시글 건수를 조회한다.
*/
public int countArticles(ArticleVO articleVO) throws Exception {
return ancmntDAO.countArticles(articleVO);
}
/**
* 조회수를 증가시킨다.
*
* @param
* @return
* @throws Exception
*/
public int updateRead(ArticleVO articleVO) throws Exception {
return ancmntDAO.updateRead(articleVO);
}
/**
* 게시글 상세 내용을 조회한다.
*
* @param
* @return
* @throws Exception
*/
public ArticleVO selectArticle(ArticleVO articleVO) throws Exception {
updateRead(articleVO);
return ancmntDAO.selectArticle(articleVO);
@Override
public BoardDAO getBoardDAO() {
return ancmntDAO;
}
}

View File

@ -10,13 +10,14 @@ import egovframework.com.cmm.service.impl.EgovComAbstractDAO;
import egovframework.rte.psl.dataaccess.mapper.Mapper;
import nlib.cmm.service.NotificationVO;
import nlib.bbs.service.ArticleVO;
import nlib.bbs.service.AttachFileVO;
import nlib.cmm.service.NlibProperty;
import nlib.user.service.NlibLoginVO;
import nlib.util.StringUtil;
/**
* <pre>
* @Class Name : AncmntDAO.java
* @Class Name : BoardDAO.java
*
* @Description : 공지사항 정보 제공 DAO
*
@ -67,4 +68,15 @@ public interface BoardDAO {
* @throws Exception
*/
public ArticleVO selectArticle(ArticleVO notiVO) throws Exception;
/**
* 첨부파일 목록을 조회한다.
*
* @param
* @return
* @throws Exception
*/
public List<AttachFileVO> listAttachFiles(String attachFileId) throws Exception;
}

View File

@ -12,9 +12,9 @@ import nlib.restful.service.DataApiReqVO;
import nlib.restful.service.DataApiResVO;
@Service("boardService")
public class BoardServiceImpl implements BoardServiceApi
public class BoardServiceImplApi implements BoardServiceApi
{
private static final Logger log = LoggerFactory.getLogger(BoardServiceImpl.class);
private static final Logger log = LoggerFactory.getLogger(BoardServiceImplApi.class);
@Resource(name = "boardDAO")
private BoardDAOApi boardDAO;

View File

@ -47,23 +47,11 @@ public class AncmntController extends NlibCommonController
public String listAncmnts(
HttpServletRequest req,
@RequestParam Map<String, String> paramMap,
ArticleVO articleVO,
ArticleVO searchArticleVO,
ModelMap model
) throws Exception {
int pageIndex = StringUtil.toNumber(paramMap.get("pageIndex"), 1);
int pageSize = StringUtil.toNumber(paramMap.get("pageSize"), DEFUALT_PAGE_SIZE);
log.debug("listAncmnt > pageIndex = " + pageIndex);
log.debug("listAncmnt > pageSize = " + pageSize);
ArticleVO searchArticleVO = new ArticleVO();
searchArticleVO.setPageIndex(pageIndex);
searchArticleVO.setPageSize(pageSize);
model.addAttribute("searchArticleVO", searchArticleVO);
model.addAttribute("pageSize", pageSize);
model.addAttribute("pageIndex", pageIndex);
model.addAttribute("searchArticle", searchArticleVO);
return "nlib/bbs/listAncmnts";
}
@ -75,22 +63,17 @@ public class AncmntController extends NlibCommonController
* @return
*/
@RequestMapping(value="/bbs/listAncmntsAjax.do")
public ResponseEntity<String> listAncmntsAjax(HttpServletRequest req,
Authentication authentication, @RequestBody Map<String, String> paramMap) throws Exception {
public ResponseEntity<String> listAncmntsAjax(
HttpServletRequest req,
Authentication authentication,
@RequestBody ArticleVO searchArticleVO) throws Exception {
int pageIndex = StringUtil.toNumber(paramMap.get("pageIndex"), 1);
int pageSize = StringUtil.toNumber(paramMap.get("pageSize"), DEFUALT_PAGE_SIZE);
if(searchArticleVO.getPageIndex() < 1) searchArticleVO.setPageIndex(1);
if(searchArticleVO.getPageSize() < 1) searchArticleVO.setPageSize(DEFUALT_PAGE_SIZE);
log.debug("listNotificationsAjax > pageIndex = " + pageIndex);
log.debug("listNotificationsAjax > pageSize = " + pageSize);
List<ArticleVO> list = ancmntService.listArticles(searchArticleVO);
ArticleVO searchNotificationtVO = new ArticleVO();
searchNotificationtVO.setPageIndex(pageIndex);
searchNotificationtVO.setPageSize(pageSize);
List<ArticleVO> list = ancmntService.listArticles(searchNotificationtVO);
int totRecordCount = ancmntService.countArticles(searchNotificationtVO);
int totRecordCount = ancmntService.countArticles(searchArticleVO);
//-------------------------------
// JSON변환 응답 처리
@ -107,41 +90,22 @@ public class AncmntController extends NlibCommonController
}
// /**
// * 알림 상세 내용 조회한다.
// *
// * @param req
// * @return
// */
// @RequestMapping("/cmm/selectNotificationAjax.do")
// public ResponseEntity<String> selectNotificationAjax(HttpServletRequest req, Authentication authentication, @RequestBody Map<String, String> paramMap) throws Exception {
//
// String notiId = paramMap.get("notiId"); // 알림ID
// String pageIndex = paramMap.get("pageIndex");
// String pageSize = paramMap.get("pageSize");
//
// log.debug("selectNotificationAjax > notiId = " + notiId);
//
// ArticleVO paramNotiVO = new ArticleVO();
// paramNotiVO.setNotiId(notiId);
// paramNotiVO.setRecvUserId(getMbInfoId(req));
// paramNotiVO.setPageIndex(pageIndex);
// paramNotiVO.setPageSize(pageSize);
//
// // 읽음처리 상세내용 조회
// ArticleVO articleVO = ancmntService.selectNotification(paramNotiVO);
//
// //-------------------------------
// // JSON변환 응답 처리
// //-------------------------------
// // JS-GRID 페이징 처리를 포함한 응답값 처리
// // {data: [{...}],
// // itemsCount: 255
// // }
// HashMap<String, Object> retMap = new HashMap<String, Object>();
// retMap.put("data", articleVO);
//
// return makeResponseEntityJson(retMap);
// }
//
/**
* 알림 상세 내용 조회한다.
*
* @param req
* @return
*/
@RequestMapping("/bbs/selectAncmntArticle.do")
public String selectAncmntArticle(HttpServletRequest req, Authentication authentication, ArticleVO searchArticleVO, ModelMap model) throws Exception {
// 읽음처리 상세내용 조회
ArticleVO articleVO = ancmntService.selectArticle(searchArticleVO);
model.addAttribute("searchArticle", searchArticleVO);
model.addAttribute("article", articleVO);
return "nlib/bbs/selectAncmntArticle";
}
}

View File

@ -2,7 +2,6 @@ package nlib.cmm.fileupload;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@ -13,7 +12,6 @@ import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
@ -28,8 +26,8 @@ import org.springframework.web.servlet.ModelAndView;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import egovframework.com.cmm.EgovWebUtil;
import egovframework.com.cmm.service.FileVO;
import nlib.bbs.service.AttachFileVO;
import nlib.cmm.exception.ErrorMessage;
import nlib.cmm.service.NlibProperty;
import nlib.util.FileUtil;
@ -63,19 +61,16 @@ public class FileUploadController {
private static final Logger log = LoggerFactory.getLogger(FileUploadController.class);
@Resource(name="nlibProperty")
NlibProperty nlibProperty;
/**
* 첨부파일이 저장되는 최상위 위치
*/
private String FILEUPLOAD_BASE_PATH = nlibProperty.getProperty("fileupload.base.path");
private String FILEUPLOAD_BASE_PATH = NlibProperty.getProperty("fileupload.base.path");
/**
* 첨부파일 임시 저장 위치
*/
private String FILEUPLOAD_TEMP_SUBPATH = nlibProperty.getProperty("fileupload.temp.subpath");
private String FILEUPLOAD_TEMP_SUBPATH = NlibProperty.getProperty("fileupload.temp.subpath");
/**
* 경로 부적합 오류 메시지
@ -121,7 +116,7 @@ public class FileUploadController {
ErrorMessage errorMessage = new ErrorMessage("ERROR", message);
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(errorMessage);
}
String subPath = nlibProperty.getProperty(subPathKey);
String subPath = NlibProperty.getProperty(subPathKey);
if(StringUtil.isEmpty(subPath)) {
message = "첨부파일이 저장되는 하위 위치정보값을 찾을 수 없습니다.";
log.error(message + " : 매개변수 subPathKey의 속성값 부재");
@ -222,16 +217,16 @@ public class FileUploadController {
* @return
* @throws Exception
*/
@RequestMapping(value="/fileupload/downloadFiles.do")
public ModelAndView download(@RequestParam HashMap<Object, Object> params, ModelAndView mv) throws Exception {
@RequestMapping(value="/fileupload/downloadAttachFile.do")
public ModelAndView downloadAttachFile(AttachFileVO attachFileVO, ModelAndView mv) throws Exception {
// TODO 권한 설정 기능 추가 필요
String fid = (String) params.get("fid");
String fname = (String) params.get("fname");
String subPath = nlibProperty.getProperty((String) params.get("subPathKey"));
String subPath = NlibProperty.getProperty(attachFileVO.getSubPathKey());
String fullPath = FILEUPLOAD_BASE_PATH + "/" + subPath + "/" + attachFileVO.getFileId() + "-" + attachFileVO.getFileSeq();
log.debug("downloadAttachFile > fullPath = " + fullPath);
String fullPath = FILEUPLOAD_BASE_PATH + "/" + subPath + "/" + fid;
if(FileUtil.isNotValid(fullPath)) {
throw new Exception(MSG_NOT_VALID_FILE_PATH);
}
@ -243,7 +238,7 @@ public class FileUploadController {
mv.setViewName("downloadView"); // dispatcher-servlet.xml내 BeanNameViewResolver 정의
mv.addObject("downloadFile", file);
mv.addObject("fname", fname);
mv.addObject("fname", attachFileVO.getFileName());
return mv;
}

View File

@ -15,6 +15,7 @@ public class NotificationVO extends PagingVO {
private String recvUserId; /* 알림대상자 회원아이디 */
private String readYn; /* 알림확인여부 */
private int totCnt = 0; /* 알림건수(최근1개월) */
private int rno = 0; /* 행번호 */
public String getNotiId() {
return notiId;
@ -88,5 +89,11 @@ public class NotificationVO extends PagingVO {
public void setNotiTypeNm(String notiTypeNm) {
this.notiTypeNm = notiTypeNm;
}
public int getRno() {
return rno;
}
public void setRno(int rno) {
this.rno = rno;
}
}

View File

@ -2,8 +2,10 @@ package nlib.cmm.service;
public class PagingVO {
public final int DEFAULT_PAGE_SIZE = NlibProperty.getInt("list.paging.page.size", 10);
int pageIndex = 1; /* 페이지 번호 */
int pageSize = NlibProperty.getInt("list.paging.page.size", 10); /* 페이지 크기 (1페이지당 보여줄 자료건수) */
int pageSize = DEFAULT_PAGE_SIZE; /* 페이지 크기 (1페이지당 보여줄 자료건수) */
int totRecordCount; /* 총건수 */
public int getPageIndex() {
@ -11,7 +13,8 @@ public class PagingVO {
}
public void setPageIndex(int pageIndex) {
this.pageIndex = pageIndex;
if(pageIndex < 1) pageIndex = 1;
else this.pageIndex = pageIndex;
}
public void setPageIndex(String sPageIndex) {
@ -27,7 +30,8 @@ public class PagingVO {
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
if(pageSize < 1) pageSize = DEFAULT_PAGE_SIZE;
else this.pageSize = pageSize;
}
public void setPageSize(String sPageSize) {

View File

@ -5,7 +5,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;
import nlib.bbs.service.impl.BoardDAO;
import nlib.bbs.service.impl.BoardDAOApi;
import nlib.restful.DataApi;
import nlib.restful.service.DataApiReqVO;
import nlib.restful.service.DataApiResVO;

View File

@ -79,7 +79,6 @@ public class CollectionController extends NlibCommonController
// REQ VO 구성
//-------------------------------
DataApiReqVO reqVO = new DataApiReqVO();
reqVO.setAuthKey(createAuthKey(req, authentication));
reqVO.setPageIndex(pageIndex);
reqVO.setPageSize(pageSize);
reqVO.addInfoItem("searchKeyword", searchKeyword);
@ -143,7 +142,6 @@ public class CollectionController extends NlibCommonController
// REQ VO 구성
//-------------------------------
DataApiReqVO reqVO = new DataApiReqVO();
reqVO.setAuthKey(createAuthKey(req, authentication));
reqVO.setPageIndex(pageIndex);
reqVO.setPageSize(pageSize);
reqVO.addInfoItem("boardNo", "QNA"); // 게시판ID
@ -203,7 +201,6 @@ public class CollectionController extends NlibCommonController
// REQ VO 구성
//-------------------------------
DataApiReqVO reqVO = new DataApiReqVO();
reqVO.setAuthKey(createAuthKey(req, authentication));
reqVO.setPageIndex(pageIndex);
reqVO.setPageSize(pageSize);
reqVO.addInfoItem("searchKeyword", searchKeyword);

View File

@ -181,4 +181,14 @@ public class StringUtil extends StringUtils {
return url + delim + name + "=" + getString(value, "");
}
public static String getSqlSearchKeyword(String str) {
if(isNotEmpty(str)) {
String ret = str.replaceAll("\\%", "\\\\%");
return ret.replaceAll("_", "\\\\_");
}
return str;
}
}

View File

@ -18,6 +18,8 @@
<typeAlias alias="SecUserVO" type="nlib.security.SecUserVO" />
<typeAlias alias="NotificationVO" type="nlib.cmm.service.NotificationVO" />
<typeAlias alias="ArticleVO" type="nlib.bbs.service.ArticleVO" />
<typeAlias alias="AttachFileVO" type="nlib.bbs.service.AttachFileVO" />
</typeAliases>
</configuration>

View File

@ -3,12 +3,68 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="nlib.bbs.service.impl.AncmntDAO">
<sql id="search_condition">
<![CDATA[
FROM BD_NLIB_ANCMNT S
WHERE S.OPEN_YN = 'Y'
AND DATE_FORMAT(NOW(), '%Y%m%d') BETWEEN IFNULL(S.POST_START_DATE,'00010101') AND IFNULL(S.POST_END_DATE, '99991231')
]]>
<if test='searchType != null and searchType.equals("T")'>
<if test="searchKeyword != null and !searchKeyword.equals('')">
AND S.TITLE LIKE CONCAT('%', #{escapeSearchKeyword}, '%')
</if>
</if>
<if test='searchType != null and searchType.equals("C")'>
<if test="searchKeyword != null and !searchKeyword.equals('')">
AND S.CONTENT LIKE CONCAT('%', #{escapeSearchKeyword}, '%')
</if>
</if>
</sql>
<select id="listArticles" parameterType="ArticleVO" resultType="ArticleVO">
SELECT
A.ANCMNT_ID AS ARTICLE_ID
, A.MNG_ORG_CD
, B.DEPT_NM AS MNG_ORG_NM
, A.TITLE
, A.NOTI_YN
, A.OPEN_YN
, A.POST_START_DATE
, A.POST_END_DATE
, A.VIEW_CNT
, CASE WHEN A.BD_ATTACH_FILE_ID IS NOT NULL OR A.BD_ATTACH_FILE_ID != '' THEN 'N' ELSE 'Y' END AS ATTACH_YN
, DATE_FORMAT(A.REG_DD, '%Y-%m-%d') AS REG_DD
, A2.RNO
, C.USER_NM AS REG_NM
FROM BD_NLIB_ANCMNT A
INNER JOIN (
SELECT S.ANCMNT_ID
, ROW_NUMBER() OVER() AS RNO
<include refid="search_condition" />
ORDER BY S.REG_DD DESC
LIMIT #{pageStartRowNum}, #{pageSize}
) AS A2
USING(ANCMNT_ID)
JOIN SM_DEPT B
ON B.ORG_CD = A.MNG_ORG_CD
LEFT OUTER JOIN SM_USER C
ON A.REG_ID = C.USER_ID
ORDER BY A.REG_DD DESC
</select>
<select id="countArticles" parameterType="ArticleVO" resultType="Integer">
SELECT COUNT(1)
<include refid="search_condition" />
</select>
<select id="selectArticle" parameterType="ArticleVO" resultType="ArticleVO">
<![CDATA[
SELECT
A.ANCMNT_ID
A.ANCMNT_ID AS ARTICLE_ID
, A.MNG_ORG_CD
, B.DEPT_NM
, B.DEPT_NM AS MNG_ORG_NM
, A.TITLE
, A.CONTENT
, A.NOTI_YN
@ -16,40 +72,39 @@
, A.POST_START_DATE
, A.POST_END_DATE
, A.VIEW_CNT
, CASE WHEN A.BD_ATTACH_FILE_ID IS NOT NULL OR A.BD_ATTACH_FILE_ID != '' THEN 'N' ELSE 'Y' END AS ATTACH_YN
, A.BD_ATTACH_FILE_ID
, DATE_FORMAT(A.REG_DD, '%Y-%M-%D') AS REG_DD
, DATE_FORMAT(A.REG_DD, '%Y-%m-%d') AS REG_DD
, C.USER_NM AS REG_NM
FROM BD_NLIB_ANCMNT A
INNER JOIN (
SELECT S.ANCMNT_ID
FROM BD_NLIB_ANCMNT S
WHERE OPEN_YN = 'Y'
AND DATE_FORMAT(NOW(), '%Y%m%d') BETWEEN IFNULL(POST_START_DATE,'00010101') AND IFNULL(POST_END_DATE, '99991231')
ORDER BY S.ANCMNT_ID DESC
LIMIT #{pageStartRowNum}, #{pageSize}
) AS A2
USING(ANCMNT_ID)
JOIN SM_DEPT B
ON B.ORG_CD = A.MNG_ORG_CD
WHERE 1=1
ORDER BY A.ANCMNT_ID DESC
LEFT OUTER JOIN SM_USER C
ON A.REG_ID = C.USER_ID
WHERE A.ANCMNT_ID = #{articleId}
]]>
</select>
<select id="countArticles" parameterType="ArticleVO" resultType="Integer">
<![CDATA[
SELECT COUNT(1)
FROM BD_NLIB_ANCMNT A
WHERE OPEN_YN = 'Y'
AND DATE_FORMAT(NOW(), '%Y%m%d') BETWEEN IFNULL(POST_START_DATE,'00010101') AND IFNULL(POST_END_DATE, '99991231')
]]>
</select>
<select id="selectArticle" parameterType="ArticleVO" resultType="ArticleVO">
<![CDATA[
SELECT A.*
FROM BD_NLIB_ANCMNT A
WHERE ANCMNT_ID = #{articleId}
]]>
<select id="listAttachFiles" parameterType="String" resultType="AttachFileVO">
SELECT
A.FILE_MASK
, A.FILE_ID
, A.FILE_SEQ
, A.FILE_NAME
, A.FILE_SIZE
, A.FILE_TYPE_CD
, A.DOWNLOAD_COUNT
, A.DOWNLOAD_EXPIRE_DATE
, A.DOWNLOAD_LIMIT_COUNT
, DATE_FORMAT(A.REG_DATE, '%Y-%m-%d') AS REG_DD
, A.DELETE_YN
, A.STREAMING_URL
, A.CONTENT
, A.ATCH_TYPE_CD
FROM J_ATTACHFILE A
WHERE A.FILE_ID = #{attachFileId}
ORDER BY A.FILE_SEQ
</select>
<update id="updateRead" parameterType="ArticleVO">

View File

@ -40,9 +40,11 @@
, IF(A.READ_DD IS NULL, 'N', 'Y') AS READ_YN
, DATE_FORMAT(A.REG_DD, '%Y-%M-%D') AS REG_DD
, COUNT(A.NOTI_ID) OVER(PARTITION BY 1) AS TOT_CNT
, A2.RNO
FROM SM_NOTIFICATION A
INNER JOIN (
SELECT S.NOTI_ID
, ROW_NUMBER() OVER() AS RNO
FROM SM_NOTIFICATION S
WHERE S.RECV_USER_ID = #{recvUserId}
AND S.REG_DD > DATE_SUB(NOW(), INTERVAL 1 MONTH)

View File

@ -83,6 +83,7 @@ fileupload.temp.subpath = /temp
# \ubb3b\uace0\ub2f5\ud558\uae30 \uac8c\uc2dc\ud310 \uc11c\ube0c\uc704\uce58 : \ucca8\ubd80\ud30c\uc77c \ucd5c\uc0c1\uc704 \uc704\uce58 \uc774\ud558\uc758 \uc704\uce58 \uc815\ubcf4\ub97c \uc124\uc815
fileupload.bbs.qna.subpath = /bbs/qna
fileupload.bbs.ancmnt.subpath = /bbs/ancmnt
# \uba54\uc77c \uacbd\ub85c
mailing.sender.membership.template = C:/iams/workspace/nlib/src/main/webapp/mail/mail_template.html

View File

@ -63,11 +63,19 @@
var pageIndex = ( filter && filter.pageIndex ? filter.pageIndex : $("#pageIndex").val());
var pageSize = ( filter && filter.pageSize ? filter.pageSize : $("#pageSize").val());
var searchType = $("#searchType").val();
var searchKeyword = $("#searchKeyword").val();
$("#pageIndex").val(pageIndex);
var inputData = {
"pageIndex" : pageIndex
, "pageSize": pageSize};
, "pageSize" : pageSize
, "searchType" : searchType
, "searchKeyword" : searchKeyword
};
//--------------------------------------
@ -116,12 +124,11 @@
//======================================
fields: [
{ title:"ID", name: "articleId" , type: "text", width: 200, align: "left" },
{ title:"알림방법", name: "notiMethod" , type: "text", width: 100, align: "center"},
{ title:"구분코드", name: "notiTypeCd" , type: "text", width: 100, align: "center"},
{ title:"구분", name: "notiTypeNm" , type: "text", width: 100, align: "center"},
{ title:"번호", name: "rno" , type: "text", width: 200, align: "center" },
{ title:"제목", name: "title" , type: "text", width: 200, align: "left" },
{ title:"확인여부", name: "readYn" , type: "text", width: 100, align: "center"},
{ title:"날짜", name: "regDd" , type: "text", width: 100, align: "center"}
{ title:"등록자", name: "regNm" , type: "text", width: 100, align: "center"},
{ title:"등록일", name: "regDd" , type: "text", width: 100, align: "center"},
{ title:"첨부", name: "bdAttachFileId" , type: "text", width: 100, align: "center"}
]
});
@ -137,47 +144,17 @@
// 선택한 글 상세 보기로 이동
function fn_viewDetail(articleId, selectedRow) {
var $selectedRow = $(selectedRow);
var reqUrl = "${pageContext.request.contextPath}/bbs/selectAncmntAjax.do";
var inputData = { "articleId" : articleId };
//--------------------------------------
// 요청 처리
//--------------------------------------
$.ajax({
type: "post",
contentType: "application/json; charset=utf-8",
url: reqUrl,
dataType: "json",
data: JSON.stringify(inputData),
}).done(function(response){
var jsonObj = JSON.parse(response);
$("#jsGrid").find('table tr.answer').remove();
//alert("DDDDDDDD remove = " + $("#jsGrid")[0].scrollHeight);
$("#jsGrid").jsGrid("rowByItem", $selectedRow).data("JSGridItem")["readYn"] = jsonObj.data.readYn;
$selectedRow.find('td').eq(GRID_INDEX_OF_READYN).text(jsonObj.data.readYn);
$selectedRow.after("<tr class='answer'><td colspan='7'>" + jsonObj.data.content
+ "<br/>" + jsonObj.data.content
+ "<br/>" + jsonObj.data.content
+ "<br/>" + jsonObj.data.content
+ "<br/>알림확인여부=" + jsonObj.data.readYn
+ "<br/>알림일자=" + jsonObj.data.regDd
+ "</td></tr>");
});
$("#jsGrid").closest('.ui-jqgrid-bdiv').width($("#jsGrid").closest('.ui-jqgrid-bdiv').width() + 1);
function fn_viewDetail(articleId) {
$("#articleId").val(articleId);
$("#articleForm").submit();
}
// 그리드 데이터 조회 호출
function fn_searchArticle(pageSize, pageIndex) {
$("#jsGrid").jsGrid("search"
, {'pageSize' : (pageSize ? pageSize : fn_getIntValue("pageSize", ${pageSize}) ),
'pageIndex' : (pageIndex ? pageIndex : fn_getIntValue("pageIndex", ${pageIndex}))
, {'pageSize' : (pageSize ? pageSize : fn_getIntValue("pageSize", ${searchArticle.pageSize}) ),
'pageIndex' : (pageIndex ? pageIndex : fn_getIntValue("pageIndex", ${searchArticle.pageIndex}))
}
);
}
@ -193,15 +170,21 @@
&nbsp;<br/>
<form name="articleForm" id="articleForm" method="post">
<form name="articleForm" id="articleForm" method="post" action="${pageContext.request.contextPath}/bbs/selectAncmntArticle.do">
<!-- 검색조건 -->
<input type="text" name="pageSize" id="pageSize" value="${pageSize }" />
<input type="text" name="pageSize" id="pageSize" value="${searchArticle.pageSize }" />
<input type="text" name="itemsCount" id="itemsCount" value="0" />
<input type="text" name="pageIndex" id="pageIndex" title="페이지번호" value="${pageIndex }" size="5" maxlength="5" />
<input type="button" name="btnSearch" id="btnSearch" title="새로고침" value="새로고침" />
<input type="text" name="pageIndex" id="pageIndex" title="페이지번호" value="${searchArticle.pageIndex }" size="5" maxlength="5" />
<select name="searchType" id="searchType">
<option value="T" <c:if test='${searchArticle.searchType == "T" }'>selected</c:if> >제목</option>
<option value="C" <c:if test='${searchArticle.searchType == "C" }'>selected</c:if> >내용</option>
</select>
<input type="text" name="searchKeyword" id="searchKeyword" title="검색어" value="${searchArticle.searchKeyword }" maxlength="20" />
<input type="text" name="articleId" id="articleId" title="게시글번호" value="" readonly />
<input type="button" name="btnSearch" id="btnSearch" title="검색" value="검색" />
<br/>
<div id="jsGrid" name="jsGrid" style="height: 100%"></div>

View File

@ -6,7 +6,7 @@
<li><a href="#" onclick="javascript:location.href='${pageContext.request.contextPath}/inform/selectGreeting.do';">인사말</a></li>
<li><a href="#" onclick="javascript:location.href='${pageContext.request.contextPath}/inform/selectNCultureOperationInfo.do';">이용안내</a></li>
<li><a href="#" onclick="javascript:location.href='${pageContext.request.contextPath}/board/listNotices.do';">공지사항</a></li>
<li><a href="#" onclick="javascript:location.href='${pageContext.request.contextPath}/board/listAncmnts.do';">공지사항(DB)</a></li>
<li><a href="#" onclick="javascript:location.href='${pageContext.request.contextPath}/bbs/listAncmnts.do';">공지사항(DB)</a></li>
<li><a href="#" onclick="javascript:location.href='${pageContext.request.contextPath}/board/listFAQs.do';">자주하는질문</a></li>
<li><a href="#" onclick="javascript:location.href='${pageContext.request.contextPath}/bbs/listQnAs.do';">묻고답하기</a></li>
<li><a href="#" onclick="javascript:location.href='${pageContext.request.contextPath}/inform/selectNCultureLocationInfo.do';">찾아오시는길</a></li>

View File

@ -8,8 +8,10 @@
<script src="/nlib/js/jquery/jquery.min.js"></script>
<script src="/nlib/js/nlib.js"></script>
<script>
</script>
</head>
<body>