|
|
|
@ -121,6 +121,132 @@
|
|
|
|
|
)
|
|
|
|
|
</isEqual>
|
|
|
|
|
</isNotEmpty>
|
|
|
|
|
<isNotEmpty property="page" prepend="">
|
|
|
|
|
LIMIT (#page# - 1) * #pagesize# , #pagesize#
|
|
|
|
|
</isNotEmpty>
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="select_list_bf_board_count" resultClass="dataMap" parameterClass="dataMap">
|
|
|
|
|
SELECT
|
|
|
|
|
count(*) as count
|
|
|
|
|
FROM (
|
|
|
|
|
<isNotEqual property="bd_tp" compareValue="BF_CT_TP_5">
|
|
|
|
|
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'
|
|
|
|
|
<isNotEmpty property="who" prepend="">
|
|
|
|
|
AND member_id = #member_id#
|
|
|
|
|
</isNotEmpty>
|
|
|
|
|
<isNotEmpty property="bd_tp" prepend="">
|
|
|
|
|
AND x.bd_tp = #bd_tp#
|
|
|
|
|
</isNotEmpty>
|
|
|
|
|
</isNotEqual>
|
|
|
|
|
<isEqual property="bd_tp" compareValue="BF_CT_TP_5">
|
|
|
|
|
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'
|
|
|
|
|
<isNotEmpty property="who" prepend="">
|
|
|
|
|
AND member_id = #member_id#
|
|
|
|
|
</isNotEmpty>
|
|
|
|
|
LIMIT 8
|
|
|
|
|
</isEqual>
|
|
|
|
|
)x
|
|
|
|
|
|
|
|
|
|
WHERE 1 = 1
|
|
|
|
|
<isNotEmpty property="keyword" prepend="">
|
|
|
|
|
AND (x.title like concat('%', #keyword# ,'%') or x.name like concat('%', #keyword# ,'%'))
|
|
|
|
|
</isNotEmpty>
|
|
|
|
|
|
|
|
|
|
<isNotEmpty property="kind" prepend="">
|
|
|
|
|
<isEqual property="kind" compareValue="tab1">
|
|
|
|
|
AND x.member_id = #member_id#
|
|
|
|
|
</isEqual>
|
|
|
|
|
<isEqual property="kind" compareValue="tab2">
|
|
|
|
|
AND x.bd_no in(
|
|
|
|
|
select bd_no from tbl_bf_board_like
|
|
|
|
|
where member_id = #member_id#
|
|
|
|
|
)
|
|
|
|
|
</isEqual>
|
|
|
|
|
</isNotEmpty>
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|