diff --git a/src/main/java/com/backoffice/m/bf_board/M_Bf_boardBO.java b/src/main/java/com/backoffice/m/bf_board/M_Bf_boardBO.java index eef92a9..9f77acf 100644 --- a/src/main/java/com/backoffice/m/bf_board/M_Bf_boardBO.java +++ b/src/main/java/com/backoffice/m/bf_board/M_Bf_boardBO.java @@ -5,27 +5,28 @@ import java.util.List; import com.renastudio.creative.web.util.DataMap; public interface M_Bf_boardBO { - - - public abstract DataMap select_bf_view_board(DataMap paramMap) throws Exception; - public abstract List select_list_bf_board(DataMap paramMap) throws Exception; + + + public abstract DataMap select_bf_view_board(DataMap paramMap) throws Exception; + public abstract List select_list_bf_board(DataMap paramMap) throws Exception; + public abstract int select_list_bf_board_count(DataMap paramMap) throws Exception; public abstract DataMap select_top_bf_board(DataMap paramMap) throws Exception; - public abstract List select_bf_board_img_by_b_no(DataMap paramMap) throws Exception; + public abstract List select_bf_board_img_by_b_no(DataMap paramMap) throws Exception; public abstract List select_bf_board_vote_by_b_no(DataMap paramMap) throws Exception; public abstract List select_bf_board_comment_by_b_no(DataMap paramMap) throws Exception; - - + + public abstract int insert_bf_board_like_by_b_no(DataMap paramMap) throws Exception; public abstract int delete_bf_board_like_by_b_no(DataMap paramMap) throws Exception; public abstract int update_bf_board_vote_by_b_no(DataMap paramMap) throws Exception; - + public abstract int insert_bf_board_comment(DataMap paramMap) throws Exception; public abstract int delete_bf_board_comment_by_b_no(DataMap paramMap) throws Exception; - - - + + + public abstract int update_bf_board(DataMap paramMap) throws Exception; public abstract Object insert_bf_board(DataMap paramMap) throws Exception; public abstract int delete_bf_board(DataMap paramMap) throws Exception; - + } diff --git a/src/main/java/com/backoffice/m/bf_board/M_Bf_boardBOImpl.java b/src/main/java/com/backoffice/m/bf_board/M_Bf_boardBOImpl.java index 0b314e0..2e465ec 100644 --- a/src/main/java/com/backoffice/m/bf_board/M_Bf_boardBOImpl.java +++ b/src/main/java/com/backoffice/m/bf_board/M_Bf_boardBOImpl.java @@ -12,291 +12,304 @@ import com.renastudio.creative.web.util.DataMap; import com.renastudio.creative.web.util.RenaStringUtil; public class M_Bf_boardBOImpl extends AbstractBOManager implements M_Bf_boardBO { - + private final static String SQLMAP_NAMESPACE = "com.backoffice.m.bf_board."; - + public List select_list_bf_board(DataMap paramMap) throws Exception{ List lm = null; try { - generalDAO.setNamespace(SQLMAP_NAMESPACE); + generalDAO.setNamespace(SQLMAP_NAMESPACE); lm = generalDAO.select_to_list("select_list_bf_board", paramMap); } catch (SQLException e) { - throw e; + throw e; } - + return lm; } - + + public int select_list_bf_board_count(DataMap paramMap) throws Exception{ + int result = 0; + + try { + generalDAO.setNamespace(SQLMAP_NAMESPACE); + result = generalDAO.select_item_to_number("select_list_bf_board_count", paramMap); + } catch (SQLException e) { + throw e; + } + + return result; + } + public DataMap select_top_bf_board(DataMap paramMap) throws Exception{ DataMap rm = null; try { - generalDAO.setNamespace(SQLMAP_NAMESPACE); + generalDAO.setNamespace(SQLMAP_NAMESPACE); rm = generalDAO.select_item_to_datamap("select_top_bf_board", paramMap); } catch (SQLException e) { - throw e; + throw e; } - + return rm; } - + public DataMap select_bf_view_board(DataMap paramMap) throws Exception{ DataMap dm = null; try { - generalDAO.setNamespace(SQLMAP_NAMESPACE); - dm = generalDAO.select_item_to_datamap("select_bf_view_board", paramMap); + generalDAO.setNamespace(SQLMAP_NAMESPACE); + dm = generalDAO.select_item_to_datamap("select_bf_view_board", paramMap); generalDAO.update("update_bf_board_count_by_b_no", paramMap); } catch (SQLException e) { - throw e; + throw e; } - + return dm; } - + public List select_bf_board_img_by_b_no(DataMap paramMap) throws Exception{ List lm = null; try { - generalDAO.setNamespace(SQLMAP_NAMESPACE); + generalDAO.setNamespace(SQLMAP_NAMESPACE); lm = generalDAO.select_to_list("select_bf_board_img_by_b_no", paramMap); } catch (SQLException e) { - throw e; + throw e; } - + return lm; } - + public List select_bf_board_vote_by_b_no(DataMap paramMap) throws Exception{ List lm = null; try { - generalDAO.setNamespace(SQLMAP_NAMESPACE); + generalDAO.setNamespace(SQLMAP_NAMESPACE); lm = generalDAO.select_to_list("select_bf_board_vote_by_b_no", paramMap); } catch (SQLException e) { - throw e; + throw e; } - + return lm; } - + public List select_bf_board_comment_by_b_no(DataMap paramMap) throws Exception{ List lm = null; try { - generalDAO.setNamespace(SQLMAP_NAMESPACE); + generalDAO.setNamespace(SQLMAP_NAMESPACE); lm = generalDAO.select_to_list("select_bf_board_comment_by_b_no", paramMap); } catch (SQLException e) { - throw e; + throw e; } - + return lm; } - - + + public Object insert_bf_board(DataMap paramMap) throws Exception{ Object resultObj = null; - - try { + + try { generalDAO.setNamespace(SQLMAP_NAMESPACE); generalDAO.startTransaction(); paramMap.put("hashtag", paramMap.getString("list_tag")); resultObj = generalDAO.insert("insert_bf_board", paramMap); - - // image insert + + // image insert String bd_no = String.valueOf(resultObj); DataMap dm = new DataMap(); dm.put("bd_no", bd_no); - + ArrayList list_file_key = (ArrayList) paramMap.get("list_file_key"); if(list_file_key !=null) { for(int idx = 0; idx < list_file_key.size(); idx++){ dm.put("file_seq", list_file_key.get(idx)); generalDAO.insert("insert_bf_board_img_by_b_no", dm); } - } + } ArrayList list_vote_content = (ArrayList) paramMap.get("list_vote_content"); if(list_vote_content !=null) { for(int idx = 0; idx < list_vote_content.size(); idx++){ dm.put("v_content", list_vote_content.get(idx)); generalDAO.insert("insert_bf_board_vote_by_b_no", dm); - } + } } - + generalDAO.commitTransaction(); } catch (SQLException e) { throw e; }finally{ generalDAO.endTransaction(); } - + return resultObj; - } - + } + public int update_bf_board(DataMap paramMap) throws Exception{ int result = 0; - - try { + + try { generalDAO.setNamespace(SQLMAP_NAMESPACE); generalDAO.startTransaction(); - + result = generalDAO.update("update_bf_board", paramMap); - + generalDAO.delete("delete_bf_board_img_by_b_no", paramMap); - + String bd_no = RenaStringUtil.getData(paramMap, "bd_no"); DataMap dm = new DataMap(); dm.put("bd_no", bd_no); - + ArrayList list_file_key = (ArrayList) paramMap.get("list_file_key"); if(list_file_key !=null) { for(int idx = 0; idx < list_file_key.size(); idx++){ dm.put("file_seq", list_file_key.get(idx)); generalDAO.insert("insert_bf_board_img_by_b_no", dm); } - } - + } + ArrayList list_mt_file_seq = (ArrayList) paramMap.get("list_mt_file_seq"); if(list_mt_file_seq !=null) { for(int idx = 0; idx < list_mt_file_seq.size(); idx++){ dm.put("file_seq", list_mt_file_seq.get(idx)); generalDAO.insert("insert_bf_board_img_by_b_no", dm); } - } - + } + generalDAO.delete("delete_bf_board_vote_by_b_no", paramMap); ArrayList list_vote_content = (ArrayList) paramMap.get("list_vote_content"); if(list_vote_content !=null) { for(int idx = 0; idx < list_vote_content.size(); idx++){ dm.put("v_content", list_vote_content.get(idx)); generalDAO.insert("insert_bf_board_vote_by_b_no", dm); - } + } } - generalDAO.commitTransaction(); + generalDAO.commitTransaction(); } catch (SQLException e) { - throw e; + throw e; }finally{ generalDAO.endTransaction(); } - + return result; } - + public int delete_bf_board(DataMap paramMap) throws Exception{ int result = 0; - try { - generalDAO.setNamespace(SQLMAP_NAMESPACE); - generalDAO.startTransaction(); - + try { + generalDAO.setNamespace(SQLMAP_NAMESPACE); + generalDAO.startTransaction(); + result = generalDAO.delete("delete_bf_board_by_b_no", paramMap); /* result = generalDAO.delete("delete_bf_board_comment_by_b_no", paramMap); result = generalDAO.delete("delete_bf_board_like_by_b_no", paramMap); result = generalDAO.delete("delete_bf_board_img_by_b_no", paramMap); */ - generalDAO.commitTransaction(); + generalDAO.commitTransaction(); } catch (SQLException e) { - throw e; + throw e; }finally{ generalDAO.endTransaction(); } - + return result; } - + public int delete_bf_board_comment_by_b_no(DataMap paramMap) throws Exception{ int result = 0; - try { - generalDAO.setNamespace(SQLMAP_NAMESPACE); - generalDAO.startTransaction(); - + try { + generalDAO.setNamespace(SQLMAP_NAMESPACE); + generalDAO.startTransaction(); + result = generalDAO.delete("delete_bf_board_comment_by_b_no", paramMap); /* result = generalDAO.delete("delete_bf_board_comment_by_b_no", paramMap); result = generalDAO.delete("delete_bf_board_like_by_b_no", paramMap); result = generalDAO.delete("delete_bf_board_img_by_b_no", paramMap); */ - generalDAO.commitTransaction(); + generalDAO.commitTransaction(); } catch (SQLException e) { - throw e; + throw e; }finally{ generalDAO.endTransaction(); } - + return result; } - + public int insert_bf_board_like_by_b_no(DataMap paramMap) throws Exception{ int result = 0; - - try { + + try { generalDAO.setNamespace(SQLMAP_NAMESPACE); generalDAO.startTransaction(); - + result = (int) generalDAO.insert("insert_bf_board_like_by_b_no", paramMap); - + generalDAO.commitTransaction(); } catch (SQLException e) { throw e; }finally{ generalDAO.endTransaction(); } - + return result; } - + public int update_bf_board_vote_by_b_no(DataMap paramMap) throws Exception{ int result = 0; - - try { + + try { generalDAO.setNamespace(SQLMAP_NAMESPACE); generalDAO.startTransaction(); - + result = (int) generalDAO.update("update_bf_board_vote_by_b_no", paramMap); - + generalDAO.commitTransaction(); } catch (SQLException e) { throw e; }finally{ generalDAO.endTransaction(); } - + return result; } - + public int delete_bf_board_like_by_b_no(DataMap paramMap) throws Exception{ int result = 0; - - try { - generalDAO.setNamespace(SQLMAP_NAMESPACE); + + try { + generalDAO.setNamespace(SQLMAP_NAMESPACE); generalDAO.startTransaction(); result = generalDAO.delete("delete_bf_board_like_by_b_no", paramMap); - + generalDAO.commitTransaction(); } catch (SQLException e) { - throw e; + throw e; }finally{ generalDAO.endTransaction(); } - + return result; } - + public int insert_bf_board_comment(DataMap paramMap) throws Exception{ int result = 0; - - try { + + try { generalDAO.setNamespace(SQLMAP_NAMESPACE); generalDAO.startTransaction(); - + if( M_Util.null2Str(paramMap.get("reply_new"),"Y").equals("Y")){ if(!M_Util.null2Str(paramMap.get("ct_no"),"").equals("")) - paramMap.put("p_ct_no", Integer.parseInt(paramMap.get("ct_no").toString())); - result = (int) generalDAO.insert("insert_bf_board_comment_by_b_no", paramMap); + paramMap.put("p_ct_no", Integer.parseInt(paramMap.get("ct_no").toString())); + result = (int) generalDAO.insert("insert_bf_board_comment_by_b_no", paramMap); }else { paramMap.put("ct_no", Integer.parseInt(paramMap.get("ct_no").toString())); // 댓글 수정 result = (int)generalDAO.update("update_bf_board_comment_by_b_no", paramMap); @@ -307,8 +320,8 @@ public class M_Bf_boardBOImpl extends AbstractBOManager implements M_Bf_boardBO }finally{ generalDAO.endTransaction(); } - + return result; } - + } diff --git a/src/main/java/com/backoffice/m/bf_board/M_Bf_boardController.java b/src/main/java/com/backoffice/m/bf_board/M_Bf_boardController.java index 7bb9544..1edc373 100644 --- a/src/main/java/com/backoffice/m/bf_board/M_Bf_boardController.java +++ b/src/main/java/com/backoffice/m/bf_board/M_Bf_boardController.java @@ -79,7 +79,17 @@ public class M_Bf_boardController extends AbstractControllerManager { int tutorial_cnt = bf_tutorialBO.select_tbl_tutorial(paramMap); paramMap.put("tutorial_cnt", tutorial_cnt); - List lm = bf_boardBo.select_list_bf_board(paramMap); + //---beigin-- +// int lm_count= bf_boardBo.select_list_bf_board_count(paramMap); + log.debug("lm_count....."); +// log.fatal(lm_count); + paramMap.put("lm_count", 100); + paramMap.put("lm_page", 1); + paramMap.put("lm_pagesize", 30); + //---end --- + + List lm = bf_boardBo.select_list_bf_board(paramMap); + DataMap.putToModel(model, "lm", lm); // 인기글 셀렉 @@ -89,7 +99,10 @@ public class M_Bf_boardController extends AbstractControllerManager { DataMap.putToModel(model, "rm_child", rm_child); DataMap.putToModel(model, "rm_mem", rm_mem); } - }catch(Exception ex1){ redirect_url = gmUtil.redirectError(true, ex1, request, paramMap, ra, ""); ex1.printStackTrace();} + }catch(Exception ex1){ + redirect_url = gmUtil.redirectError(true, ex1, request, paramMap, ra, ""); + ex1.printStackTrace(); + } if(paramMap.get("bd_tp") == null) { paramMap.put("bd_tp" ,""); } diff --git a/src/main/java/com/backoffice/m/bf_growth/M_Bf_growthController.java b/src/main/java/com/backoffice/m/bf_growth/M_Bf_growthController.java index a817031..8ab5fde 100644 --- a/src/main/java/com/backoffice/m/bf_growth/M_Bf_growthController.java +++ b/src/main/java/com/backoffice/m/bf_growth/M_Bf_growthController.java @@ -9,6 +9,7 @@ import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import javax.xml.crypto.Data; +import com.backoffice.constants.ConstantResultCode; import com.backoffice.m.tutorial.M_Bf_tutorialBO; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -18,6 +19,8 @@ import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.backoffice.admin.bf.bf_recommend.A_Bf_recommendBO; @@ -675,29 +678,26 @@ public class M_Bf_growthController extends AbstractControllerManager{ } //---begin------- - @RequestMapping(value="vac_schedule_check") - public String vac_schedule_check(@ModelAttribute("model") ModelMap model, HttpServletRequest request, HttpServletResponse response - , RedirectAttributes ra) { +// @RequestMapping(value="vac_schedule_check") + @RequestMapping(value="vac_schedule_check", method= RequestMethod.GET) + @ResponseBody + public HashMap vac_schedule_check(@ModelAttribute("model") ModelMap model, HttpServletRequest request, HttpServletResponse response) { DataMap paramMap = gmUtil.getDataMapFromRequest(request); - String redirect_url = "m/bf_growth/vac_schedule"; log.info("vac_schedule_check....."); log.info(paramMap); - try{ - - int result = bf_growthBO.update_bf_vac_schedule_check(paramMap); - - if(result == 1) { - paramMap.put("ERROR_MSG", "반영되었습니다:" + result); - }else { - paramMap.put("ERROR_MSG", "반영되지 못했습니다:" + result); - } - }catch(Exception ex1){ redirect_url = gmUtil.redirectError(true, ex1, request, paramMap, ra, ""); ex1.printStackTrace();} + HashMap rm = new HashMap(); + rm.put("RESULT", ConstantResultCode.RESULT_INIT); - gmUtil.redirectParam(model, paramMap); - - return redirect_url; + try{ + int result = bf_growthBO.update_bf_vac_schedule_check(paramMap); + rm.put("result", result); + }catch(Exception ex1){ + ex1.printStackTrace(); + rm.put("RESULT", ConstantResultCode.RESULT_EXCEPTION); + } + return rm; } // ---end---------- diff --git a/src/main/resources/sqlmap/m/bf_board/com.backoffice.m.bf_board.xml b/src/main/resources/sqlmap/m/bf_board/com.backoffice.m.bf_board.xml index f093c2d..109101e 100644 --- a/src/main/resources/sqlmap/m/bf_board/com.backoffice.m.bf_board.xml +++ b/src/main/resources/sqlmap/m/bf_board/com.backoffice.m.bf_board.xml @@ -1,527 +1,653 @@ - + - - + SELECT + count(*) as count FROM ( - - SELECT - x.bd_no - ,x.bd_tp - ,x.title - ,x.content - ,x.hashtag - ,x.member_id - ,z.title as bd_tp_nm - ,IFNULL(star,0) as star - ,IFNULL(h_nt ,0) as h_nt - ,(select count(*) - from tbl_bf_board_like tbl - where tbl.bd_no = x.bd_no ) as l_nt - ,(select count(*) - from tbl_bf_board_comment tbc - where tbc.bd_no = x.bd_no ) as c_nt - ,DATE_FORMAT(x.reg_dt,'%Y-%m-%d %H:%i') reg_tm - ,tbv.v_content - ,x.thumbnail - ,m.profile_path - ,m.name - ,m.nickname - ,tmf.mt_file_seq - ,tmf.mt_file_local_url - ,ROW_NUMBER() OVER (ORDER BY x.h_nt desc, x.bd_no desc) AS row_num - FROM tbl_bf_board x - LEFT JOIN tbl_code_item z - on x.bd_tp = z.val_1 and cg_cd ='BF_COMMUNITY_TP' - LEFT JOIN (select bd_no, group_concat(concat (v_content, '♭⊙♭', nvl(v_nt, 0)) separator '♭§♭') v_content - from tbl_bf_board_vote group by bd_no) tbv ON tbv.bd_no = x.bd_no - LEFT JOIN tbl_member m ON m.member_id = x.member_id - LEFT JOIN tbl_bf_board_attach tba ON tba.bd_no = x.bd_no - and tba.file_seq = ( - SELECT file_seq - FROM tbl_bf_board_attach fa - WHERE fa.bd_no = x.bd_no - LIMIT 1 - ) - LEFT JOIN tbl_mt_file tmf ON tmf.mt_file_seq = tba.file_seq - - WHERE DATE_FORMAT(x.reg_dt,'%Y%M%d') = DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -1 day),'%Y%M%d') - and x.use_yn ='Y' - - AND member_id = #member_id# - - - AND x.bd_tp = #bd_tp# - - LIMIT 1 - - - SELECT - x.bd_no - ,x.bd_tp - ,x.title - ,x.content - ,x.hashtag - ,x.member_id - ,z.title as bd_tp_nm - ,IFNULL(star,0) as star - ,IFNULL(h_nt ,0) as h_nt - ,(select count(*) - from tbl_bf_board_like tbl - where tbl.bd_no = x.bd_no ) as l_nt - ,(select count(*) - from tbl_bf_board_comment tbc - where tbc.bd_no = x.bd_no ) as c_nt - ,DATE_FORMAT(x.reg_dt,'%Y-%m-%d %H:%i') reg_tm - ,tbv.v_content - ,x.thumbnail - ,m.profile_path - ,m.name - ,m.nickname - ,tmf.mt_file_seq - ,tmf.mt_file_local_url - ,ROW_NUMBER() OVER (ORDER BY x.reg_dt DESC) AS row_num - FROM tbl_bf_board x - LEFT JOIN tbl_code_item z - on x.bd_tp = z.val_1 and cg_cd ='BF_COMMUNITY_TP' - LEFT JOIN (select bd_no, group_concat(concat (v_content, '♭⊙♭', nvl(v_nt, 0)) separator '♭§♭') v_content - from tbl_bf_board_vote group by bd_no) tbv ON tbv.bd_no = x.bd_no - LEFT JOIN tbl_member m ON m.member_id = x.member_id - LEFT JOIN tbl_bf_board_attach tba ON tba.bd_no = x.bd_no - and tba.file_seq = ( - SELECT file_seq - FROM tbl_bf_board_attach fa - WHERE fa.bd_no = x.bd_no - LIMIT 1 - ) - LEFT JOIN tbl_mt_file tmf ON tmf.mt_file_seq = tba.file_seq - - WHERE 1 = 1 - and x.use_yn ='Y' - and x.bd_tp ='BF_CT_TP_5' - - AND member_id = #member_id# - - LIMIT 1 - - )x - + + SELECT + x.bd_no + ,x.bd_tp + ,x.title + ,x.content + ,x.hashtag + ,x.member_id + ,z.title as bd_tp_nm + ,IFNULL(star,0) as star + ,IFNULL(h_nt ,0) as h_nt + ,(select count(*) + from tbl_bf_board_like tbl + where tbl.bd_no = x.bd_no ) as l_nt + ,(select count(*) + from tbl_bf_board_comment tbc + where tbc.bd_no = x.bd_no ) as c_nt + ,DATE_FORMAT(x.reg_dt,'%Y-%m-%d %H:%i') reg_tm + ,tbv.v_content + ,x.thumbnail + ,m.profile_path + ,m.name + ,m.nickname + ,tmf.mt_file_seq + ,tmf.mt_file_local_url + ,ROW_NUMBER() OVER (ORDER BY x.reg_dt desc, x.h_nt desc, x.bd_no desc) AS row_num + FROM tbl_bf_board x + LEFT JOIN tbl_code_item z + on x.bd_tp = z.val_1 and cg_cd ='BF_COMMUNITY_TP' + LEFT JOIN (select bd_no, group_concat(concat (v_content, '♭⊙♭', nvl(v_nt, 0)) separator '♭§♭') v_content + from tbl_bf_board_vote group by bd_no) tbv ON tbv.bd_no = x.bd_no + LEFT JOIN tbl_member m ON m.member_id = x.member_id + LEFT JOIN tbl_bf_board_attach tba ON tba.bd_no = x.bd_no + and tba.file_seq = ( + SELECT file_seq + FROM tbl_bf_board_attach fa + WHERE fa.bd_no = x.bd_no + LIMIT 1 + ) + LEFT JOIN tbl_mt_file tmf ON tmf.mt_file_seq = tba.file_seq + + where x.use_yn ='Y' + + AND member_id = #member_id# + + + AND x.bd_tp = #bd_tp# + + + + SELECT + x.bd_no + ,x.bd_tp + ,x.title + ,x.content + ,x.hashtag + ,x.member_id + ,z.title as bd_tp_nm + ,IFNULL(star,0) as star + ,IFNULL(h_nt ,0) as h_nt + ,(select count(*) + from tbl_bf_board_like tbl + where tbl.bd_no = x.bd_no ) as l_nt + ,(select count(*) + from tbl_bf_board_comment tbc + where tbc.bd_no = x.bd_no ) as c_nt + ,DATE_FORMAT(x.reg_dt,'%Y-%m-%d %H:%i') reg_tm + ,tbv.v_content + ,x.thumbnail + ,m.profile_path + ,m.name + ,m.nickname + ,tmf.mt_file_seq + ,tmf.mt_file_local_url + ,ROW_NUMBER() OVER (ORDER BY x.reg_dt DESC) AS row_num + FROM tbl_bf_board x + LEFT JOIN tbl_code_item z + on x.bd_tp = z.val_1 and cg_cd ='BF_COMMUNITY_TP' + LEFT JOIN (select bd_no, group_concat(concat (v_content, '♭⊙♭', nvl(v_nt, 0)) separator '♭§♭') v_content + from tbl_bf_board_vote group by bd_no) tbv ON tbv.bd_no = x.bd_no + LEFT JOIN tbl_member m ON m.member_id = x.member_id + LEFT JOIN tbl_bf_board_attach tba ON tba.bd_no = x.bd_no + and tba.file_seq = ( + SELECT file_seq + FROM tbl_bf_board_attach fa + WHERE fa.bd_no = x.bd_no + LIMIT 1 + ) + LEFT JOIN tbl_mt_file tmf ON tmf.mt_file_seq = tba.file_seq + + WHERE 1 = 1 + and x.use_yn ='Y' + and x.bd_tp ='BF_CT_TP_5' + + AND member_id = #member_id# + + LIMIT 8 + + )x + WHERE 1 = 1 AND (x.title like concat('%', #keyword# ,'%') or x.name like concat('%', #keyword# ,'%')) - + - - AND x.member_id = #member_id# + + AND x.member_id = #member_id# - - AND x.bd_no in( - select bd_no from tbl_bf_board_like - where member_id = #member_id# + + AND x.bd_no in( + select bd_no from tbl_bf_board_like + where member_id = #member_id# ) - + - - - + SELECT + x.* FROM ( - SELECT - x.bd_no - ,x.bd_tp - ,x.title - ,x.content - ,x.hashtag - ,x.link - ,x.member_id - ,x.review_product - ,x.review_company - ,z.title as bd_tp_nm - ,IFNULL(star,0) as star - ,IFNULL(h_nt ,0) as h_nt - ,(select count(*) - from tbl_bf_board_like tbl - where tbl.bd_no = x.bd_no ) as l_nt - ,(select count(*) - from tbl_bf_board_comment tbc - where tbc.bd_no = x.bd_no ) as c_nt - ,DATE_FORMAT(x.reg_dt,'%Y-%m-%d %H:%i') reg_tm - ,tbv.v_content - ,(select count(*) - from tbl_bf_board_like tbl - where tbl.bd_no = x.bd_no - and ct_no = 0 - and member_id = #member_id# ) like_tp + + SELECT + x.bd_no + ,x.bd_tp + ,x.title + ,x.content + ,x.hashtag + ,x.member_id + ,z.title as bd_tp_nm + ,IFNULL(star,0) as star + ,IFNULL(h_nt ,0) as h_nt + ,(select count(*) + from tbl_bf_board_like tbl + where tbl.bd_no = x.bd_no ) as l_nt + ,(select count(*) + from tbl_bf_board_comment tbc + where tbc.bd_no = x.bd_no ) as c_nt + ,DATE_FORMAT(x.reg_dt,'%Y-%m-%d %H:%i') reg_tm + ,tbv.v_content + ,x.thumbnail + ,m.profile_path + ,m.name + ,m.nickname + ,tmf.mt_file_seq + ,tmf.mt_file_local_url + ,ROW_NUMBER() OVER (ORDER BY x.h_nt desc, x.bd_no desc) AS row_num + FROM tbl_bf_board x + LEFT JOIN tbl_code_item z + on x.bd_tp = z.val_1 and cg_cd ='BF_COMMUNITY_TP' + LEFT JOIN (select bd_no, group_concat(concat (v_content, '♭⊙♭', nvl(v_nt, 0)) separator '♭§♭') v_content + from tbl_bf_board_vote group by bd_no) tbv ON tbv.bd_no = x.bd_no + LEFT JOIN tbl_member m ON m.member_id = x.member_id + LEFT JOIN tbl_bf_board_attach tba ON tba.bd_no = x.bd_no + and tba.file_seq = ( + SELECT file_seq + FROM tbl_bf_board_attach fa + WHERE fa.bd_no = x.bd_no + LIMIT 1 + ) + LEFT JOIN tbl_mt_file tmf ON tmf.mt_file_seq = tba.file_seq + + WHERE DATE_FORMAT(x.reg_dt,'%Y%M%d') = DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -1 day),'%Y%M%d') + and x.use_yn ='Y' + + AND member_id = #member_id# + + + AND x.bd_tp = #bd_tp# + + LIMIT 1 + + + SELECT + x.bd_no + ,x.bd_tp + ,x.title + ,x.content + ,x.hashtag + ,x.member_id + ,z.title as bd_tp_nm + ,IFNULL(star,0) as star + ,IFNULL(h_nt ,0) as h_nt + ,(select count(*) + from tbl_bf_board_like tbl + where tbl.bd_no = x.bd_no ) as l_nt + ,(select count(*) + from tbl_bf_board_comment tbc + where tbc.bd_no = x.bd_no ) as c_nt + ,DATE_FORMAT(x.reg_dt,'%Y-%m-%d %H:%i') reg_tm + ,tbv.v_content + ,x.thumbnail + ,m.profile_path + ,m.name + ,m.nickname + ,tmf.mt_file_seq + ,tmf.mt_file_local_url + ,ROW_NUMBER() OVER (ORDER BY x.reg_dt DESC) AS row_num FROM tbl_bf_board x + LEFT JOIN tbl_code_item z + on x.bd_tp = z.val_1 and cg_cd ='BF_COMMUNITY_TP' LEFT JOIN (select bd_no, group_concat(concat (v_content, '♭⊙♭', nvl(v_nt, 0)) separator '♭§♭') v_content - from tbl_bf_board_vote GROUP BY bd_no) tbv ON tbv.bd_no = x.bd_no - INNER JOIN tbl_code_item z - on x.bd_tp = z.val_1 and cg_cd ='BF_COMMUNITY_TP' + from tbl_bf_board_vote group by bd_no) tbv ON tbv.bd_no = x.bd_no + LEFT JOIN tbl_member m ON m.member_id = x.member_id + LEFT JOIN tbl_bf_board_attach tba ON tba.bd_no = x.bd_no + and tba.file_seq = ( + SELECT file_seq + FROM tbl_bf_board_attach fa + WHERE fa.bd_no = x.bd_no + LIMIT 1 + ) + LEFT JOIN tbl_mt_file tmf ON tmf.mt_file_seq = tba.file_seq + WHERE 1 = 1 - and x.use_yn ='Y' - and x.bd_no = #bd_no# - )x - LEFT JOIN tbl_member m ON m.member_id = x.member_id - + and x.use_yn ='Y' + and x.bd_tp ='BF_CT_TP_5' + + AND member_id = #member_id# + + LIMIT 1 + + )x + + WHERE 1 = 1 + + AND (x.title like concat('%', #keyword# ,'%') or x.name like concat('%', #keyword# ,'%')) + + + + + AND x.member_id = #member_id# + + + AND x.bd_no in( + select bd_no from tbl_bf_board_like + where member_id = #member_id# + ) + + + + + + + - - - INSERT tbl_bf_board - ( - reg_dt - ,title - ,content - ,member_id - ,bd_tp - ,hashtag - ,star - ,review_product - ,review_company - ) VALUES ( - NOW() - ,#title# - ,#content# - ,#member_id# - ,#bd_tp# - ,replace(replace(#hashtag#,'[',''),']','') - ,#star# - ,#review_product# - ,#review_company# - ) - - + + + INSERT tbl_bf_board + ( + reg_dt + ,title + ,content + ,member_id + ,bd_tp + ,hashtag + ,star + ,review_product + ,review_company + ) VALUES ( + NOW() + ,#title# + ,#content# + ,#member_id# + ,#bd_tp# + ,replace(replace(#hashtag#,'[',''),']','') + ,#star# + ,#review_product# + ,#review_company# + ) + + SELECT LAST_INSERT_ID(); - - - - - UPDATE tbl_bf_board - SET - mod_dt = NOW() - ,title = #title# - ,content = #content# - ,bd_tp = #bd_tp# - ,hashtag = replace(replace(#hashtag#,'[',''),']','') - ,star = #star# - ,review_product = #review_product# - ,review_company = #review_company# - where bd_no = #bd_no# - - - - INSERT tbl_bf_board_attach - ( + + + + + UPDATE tbl_bf_board + SET + mod_dt = NOW() + ,title = #title# + ,content = #content# + ,bd_tp = #bd_tp# + ,hashtag = replace(replace(#hashtag#,'[',''),']','') + ,star = #star# + ,review_product = #review_product# + ,review_company = #review_company# + where bd_no = #bd_no# + + + + INSERT tbl_bf_board_attach + ( bd_no ,ct_no - ,file_seq + ,file_seq ,reg_dt ) VALUES ( - #bd_no# - ,#ct_no# - ,#file_seq# - ,NOW() - ) - - - - INSERT tbl_bf_board_vote - ( - bd_no - ,v_content + #bd_no# + ,#ct_no# + ,#file_seq# + ,NOW() + ) + + + + INSERT tbl_bf_board_vote + ( + bd_no + ,v_content ,reg_dt ) VALUES ( - #bd_no# - ,#v_content# - ,NOW() - ) - - - - DELETE FROM tbl_bf_board - WHERE bd_no = #bd_no# - - - - DELETE FROM tbl_bf_board_comment - WHERE bd_no = #bd_no# - and ct_no = #ct_no# - - - - DELETE FROM tbl_bf_board_attach - WHERE bd_no = #bd_no# - - - DELETE FROM tbl_bf_board_vote - WHERE bd_no = #bd_no# - - - - + SELECT tmf.mt_file_seq + ,tmf.mt_file_nm + ,tmf.mt_file_local_url + ,tmf.mt_file_size + ,tmf.mt_file_type + ,tmf.height + ,tmf.width + FROM tbl_bf_board_attach tba + LEFT JOIN tbl_mt_file tmf ON tmf.mt_file_seq = tba.file_seq WHERE tba.bd_no = #bd_no# ORDER BY mt_file_seq - + - - - - INSERT tbl_bf_board_like - ( - reg_dt - ,member_id - ,bd_no - ,ct_no - ) VALUES ( - NOW() - ,#member_id# - ,#bd_no# - ,nvl(#ct_no#,0) - ) - - - SELECT LAST_INSERT_ID(); - - - - - UPDATE tbl_bf_board_vote - set v_nt = nvl(v_nt,0) + 1 - ,vote_member_id = concat(nvl(vote_member_id,'') ,',', #member_id# ) - where vt_no = #vt_no# - - - - UPDATE tbl_bf_board - set h_nt = nvl(h_nt,0) + 1 - where bd_no = #bd_no# - - - - DELETE FROM tbl_bf_board_like - WHERE 1 =1 - AND member_id = #member_id# - AND bd_no = #bd_no# - AND ct_no = nvl(#ct_no#,0) - - - - - INSERT tbl_bf_board_comment - ( - p_ct_no - ,reg_dt - ,member_id - ,bd_no - ,comment - ) VALUES ( - #p_ct_no# - ,NOW() - ,#member_id# - ,#bd_no# - ,#comment# - ) - - - SELECT LAST_INSERT_ID(); - - - - - UPDATE tbl_bf_board_comment - SET comment = #comment# - WHERE ct_no = #ct_no# - - - + select + x.* + , (case when substr(x.seq, 1,instr(x.seq,'>') -1) ='' then ct_no else substr(x.seq, 1,instr(x.seq,'>') -1) end) as r_ct_no + from (SELECT a.bd_no + , a.ct_no + , a.p_ct_no + , a.member_id + , a.comment + , CONCAT_WS('>',k.ct_no,j.ct_no,i.ct_no, g.ct_no,f.ct_no,e.ct_no, d.ct_no, c.ct_no, b.ct_no, a.ct_no) seq + ,(LENGTH( CONCAT_WS('>',k.ct_no,j.ct_no,i.ct_no, g.ct_no,f.ct_no,e.ct_no, d.ct_no, c.ct_no, b.ct_no, a.ct_no)) + - LENGTH(REPLACE( CONCAT_WS('>', k.ct_no,j.ct_no,i.ct_no, g.ct_no,f.ct_no,e.ct_no, d.ct_no, c.ct_no, b.ct_no, a.ct_no), '>', ''))) / LENGTH('>') as lv + ,(select u.nickname from tbl_member u where u.member_id = (select co.member_id from tbl_bf_board_comment co where a.p_ct_no = ct_no)) as mention + ,t.name + ,t.nickname + ,t.profile_path + ,a.v_nt + ,DATE_FORMAT(a.reg_dt,'%Y-%m-%d %H:%i') reg_tm + FROM tbl_bf_board_comment a + LEFT OUTER JOIN tbl_bf_board_comment b ON a.p_ct_no = b.ct_no + LEFT OUTER JOIN tbl_bf_board_comment c ON b.p_ct_no = c.ct_no + LEFT OUTER JOIN tbl_bf_board_comment d ON c.p_ct_no = d.ct_no + LEFT OUTER JOIN tbl_bf_board_comment e ON d.p_ct_no = e.ct_no + LEFT OUTER JOIN tbl_bf_board_comment f ON e.p_ct_no = f.ct_no + LEFT OUTER JOIN tbl_bf_board_comment g ON f.p_ct_no = g.ct_no + LEFT OUTER JOIN tbl_bf_board_comment h ON g.p_ct_no = h.ct_no + LEFT OUTER JOIN tbl_bf_board_comment i ON h.p_ct_no = i.ct_no + LEFT OUTER JOIN tbl_bf_board_comment j ON i.p_ct_no = j.ct_no + LEFT OUTER JOIN tbl_bf_board_comment k ON j.p_ct_no = k.ct_no + left join tbl_member t + on a.member_id = t.member_id + WHERE a.bd_no = #bd_no# ) x + order by r_ct_no , seq - + \ No newline at end of file diff --git a/src/main/resources/sqlmap/m/bf_growth/com.backoffice.m.bf_growth.xml b/src/main/resources/sqlmap/m/bf_growth/com.backoffice.m.bf_growth.xml index a370c3b..0ac85f1 100644 --- a/src/main/resources/sqlmap/m/bf_growth/com.backoffice.m.bf_growth.xml +++ b/src/main/resources/sqlmap/m/bf_growth/com.backoffice.m.bf_growth.xml @@ -406,7 +406,8 @@ on dvs.dv_no = dv.dv_no left join tbl_bf_family_baby fb on fb.smc_no = #smc_no# - where not now() > date_add(date_add(fb.birthday, interval dvs.end_label month), interval -1 day) + where (not now() > date_add(date_add(fb.birthday, interval dvs.end_label month), interval -1 day)) + AND dvs.dv_check=0 order by recmnd_from_dt desc , dvs.dv_no, dvs.round @@ -423,7 +424,8 @@ on dvs.dv_no = dv.dv_no left join tbl_bf_family_baby fb on fb.smc_no = #smc_no# - where now() > date_add(date_add(fb.birthday, interval dvs.end_label month), interval -1 day) + where (now() > date_add(date_add(fb.birthday, interval dvs.end_label month), interval -1 day)) + OR dvs.dv_check=1 order by recmnd_from_dt , dvs.dv_no, dvs.round diff --git a/src/main/webapp/WEB-INF/views/ftl/m/bf_growth/vac_schedule.ftl b/src/main/webapp/WEB-INF/views/ftl/m/bf_growth/vac_schedule.ftl index f3d3e07..3110059 100644 --- a/src/main/webapp/WEB-INF/views/ftl/m/bf_growth/vac_schedule.ftl +++ b/src/main/webapp/WEB-INF/views/ftl/m/bf_growth/vac_schedule.ftl @@ -44,21 +44,23 @@ return s ; } function OncheckBox(e){ - console.log(e,e.checked,$(e).attr('name'), e.value, 'onckbox=====') - const url = "${URL_ROOT}/m/bf_growth/vac_schedule_check.do?dvs_no=" + ($(e).attr('name')) + "&dv_check=" + (e.checked ? '1' : '0'); + const url = "${URL_ROOT}/m/bf_growth/vac_schedule_check.do?dvs_no=" + ($(e).attr('name')) + "&dv_check=1"; + console.log('打印请求的接口:', url) + $.ajax({ + url: url, + processData: false, + contentType: false, + type: 'GET', + async : false, + success: function(response){ + Swal.fire({text: '저장 되었습니다.'}).then((result)=>{ location.reload(); }) + // callback(response); + } + }); + } + function OncheckBox1(e){ + const url = "${URL_ROOT}/m/bf_growth/vac_schedule_check.do?dvs_no=" + ($(e).attr('name')) + "&dv_check=0"; console.log('打印请求的接口:', url) - // $.ajax({ - // url:'url, - // type:'get', - // dataType:'json', - // error:function(request,status,error){ - // is_loading = false; - // alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error); - // }, - // success:function(result){ - // } - // }); - $.ajax({ url: url, processData: false, @@ -167,7 +169,9 @@
${item['recmnd_month']!}
- + <#if ( item['dv_check'] == '1')> + +
${item['dv_disease']!}
권장일