add paging for api selectPost
This commit is contained in:

parent
4249c32a08
commit
fc3110b63d
@ -82,6 +82,28 @@ public class NoticeMngCtr{
|
||||
result.add("postData", postList);
|
||||
return result;
|
||||
}
|
||||
|
||||
@RequestMapping(value="/selectPostPage", method=RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Object selectPostPage(@RequestBody BaseParam paramMap){
|
||||
BaseResponse result = new BaseResponse();
|
||||
List<HashMap<String, Object>> finalValue = new ArrayList<HashMap<String, Object>>();
|
||||
List<CamelHashMap> postList = noticeMngSvc.selectPostPage(paramMap.getParams());
|
||||
result.add("postPage", postList);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value="/selectPostPageTotal", method=RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Object selectPostPageTotal(@RequestBody BaseParam paramMap){
|
||||
BaseResponse result = new BaseResponse();
|
||||
List<HashMap<String, Object>> finalValue = new ArrayList<HashMap<String, Object>>();
|
||||
List<CamelHashMap> postList = noticeMngSvc.selectPostPageTotal(paramMap.getParams());
|
||||
result.add("postPageTotal", postList);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @methodName : selectPost
|
||||
|
@ -37,6 +37,14 @@ public class NoticeMngSvc extends BaseSvc {
|
||||
public List<CamelHashMap> selectPostList(HashMap<String, Object> param){
|
||||
return dao.selectList("comm.base.noticeMng.selectPostList", param);
|
||||
}
|
||||
|
||||
public List<CamelHashMap> selectPostPage(HashMap<String, Object> param){
|
||||
return dao.selectList("comm.base.noticeMng.selectPostPage", param);
|
||||
}
|
||||
|
||||
public List<CamelHashMap> selectPostPageTotal(HashMap<String, Object> param){
|
||||
return dao.selectList("comm.base.noticeMng.selectPostPageTotal", param);
|
||||
}
|
||||
|
||||
/**
|
||||
* @methodName : selectPost
|
||||
|
@ -19,7 +19,42 @@
|
||||
</if>
|
||||
ORDER BY P.POST_ORG_NO DESC, P.POST_GRP_ORD ASC
|
||||
</select>
|
||||
|
||||
<select id="selectPostPage" resultType="com.lsitc.core.base.CamelHashMap" >
|
||||
/* comm.noticeMng.selectPostPage : 게시판 리스트 조회 */
|
||||
SELECT B.COM_ID, B.BORD_NO, P.POST_NO, P.POST_ORG_NO, P.POST_GRP_ORD, P.POST_GRP_LAYER,
|
||||
P.POST_TITL, P.POST_TITL AS TITLE,
|
||||
P.NOTI_YN, P.RPLY_POSS_YN, P.STRT_DTTM, P.END_DTTM, P.VIEW_CNT, P.APND_FILE_UUID,
|
||||
P.REG_USER_NO, P.REG_DTTM
|
||||
FROM comm_bord B
|
||||
INNER JOIN comm_post P
|
||||
ON B.COM_ID = P.COM_ID
|
||||
AND B.BORD_NO = P.BORD_NO
|
||||
WHERE B.COM_ID = #{session.comId}
|
||||
AND B.USE_FG = '1'
|
||||
AND B.BORD_NO = #{bordNo}
|
||||
<if test="postOrgNo != null and postOrgNo != ''">
|
||||
AND P.POST_ORG_NO = #{postOrgNo}
|
||||
</if>
|
||||
ORDER BY P.POST_ORG_NO DESC, P.POST_GRP_ORD ASC
|
||||
OFFSET #{offset} ROWS FETCH NEXT #{limit} ROWS ONLY
|
||||
</select>
|
||||
|
||||
<select id="selectPostPageTotal" resultType="com.lsitc.core.base.CamelHashMap" >
|
||||
/* comm.noticeMng.selectPostPageTotal : 게시판 리스트 조회 */
|
||||
SELECT count(*) totalCount
|
||||
FROM comm_bord B
|
||||
INNER JOIN comm_post P
|
||||
ON B.COM_ID = P.COM_ID
|
||||
AND B.BORD_NO = P.BORD_NO
|
||||
WHERE B.COM_ID = #{session.comId}
|
||||
AND B.USE_FG = '1'
|
||||
AND B.BORD_NO = #{bordNo}
|
||||
<if test="postOrgNo != null and postOrgNo != ''">
|
||||
AND P.POST_ORG_NO = #{postOrgNo}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- resultMap 지정 -->
|
||||
<resultMap id="selectPostResult" type="com.lsitc.core.base.CamelHashMap" >
|
||||
<result property="POST_CNTN" column="POST_CNTN" jdbcType="CLOB" javaType="java.lang.String" />
|
||||
|
Reference in New Issue
Block a user