add paging for api selectPost
This commit is contained in:

parent
4249c32a08
commit
fc3110b63d
@ -83,6 +83,28 @@ public class NoticeMngCtr{
|
|||||||
return result;
|
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
|
* @methodName : selectPost
|
||||||
* @date : 2021.07.28
|
* @date : 2021.07.28
|
||||||
|
@ -38,6 +38,14 @@ public class NoticeMngSvc extends BaseSvc {
|
|||||||
return dao.selectList("comm.base.noticeMng.selectPostList", 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
|
* @methodName : selectPost
|
||||||
* @date : 2021.07.28
|
* @date : 2021.07.28
|
||||||
|
@ -20,6 +20,41 @@
|
|||||||
ORDER BY P.POST_ORG_NO DESC, P.POST_GRP_ORD ASC
|
ORDER BY P.POST_ORG_NO DESC, P.POST_GRP_ORD ASC
|
||||||
</select>
|
</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 지정 -->
|
||||||
<resultMap id="selectPostResult" type="com.lsitc.core.base.CamelHashMap" >
|
<resultMap id="selectPostResult" type="com.lsitc.core.base.CamelHashMap" >
|
||||||
<result property="POST_CNTN" column="POST_CNTN" jdbcType="CLOB" javaType="java.lang.String" />
|
<result property="POST_CNTN" column="POST_CNTN" jdbcType="CLOB" javaType="java.lang.String" />
|
||||||
|
Reference in New Issue
Block a user