a.parent_group_seq = a2.seq
and a2.parent_seq = a3.seq
and a.group_full_cd like #{listCode} || '%'
and a.group_nm like '%' || #{searchWrd} || '%'
and a.group_type = 'D'
and tdi.last_yn = 'Y'
select
count(*) over() as contentcount,
case
when a3.doc_level > 1 then a3.doc_code_name
else a2.doc_code_name
end as main_category,
case
when a3.doc_level > 1 then a2.doc_code_name
else a.group_nm
end as middle_category,
a.group_nm,
a.kcsc_cd,
tdi.doc_file_grp_id,
a.group_seq
from
tn_document_group a
left join tn_document_info tdi on
a.group_seq = tdi.group_seq
left join tn_document_content tdc on
tdi.doc_info_seq = tdc.doc_info_seq,
sp_get_tn_document_code_by_tree() a2,
sp_get_tn_document_code_by_tree() a3
group by main_category, middle_category, a.group_nm, a.kcsc_cd, tdi.doc_file_grp_id, a.group_seq
order by a.kcsc_cd
select
group_seq
from tn_document_group
where group_full_cd = #{groupFullCd}
select
group_seq,
group_full_cd,
kcsc_cd,
group_cur_cd,
group_nm,
parent_group_seq
from tn_document_group
where parent_group_seq = #{parentGroupSeq}
select tdi.aplcn_bgng_ymd,tdi.doc_file_grp_id,tdi.rvsn_file_grp_id from tn_document_info tdi, tn_document_group tdg
where 1 = 1
and tdi.group_seq = tdg.group_seq
and tdi.kcsc_cd like 'KDS%'
and tdi.group_seq =#{groupseq}
and tdi.use_yn = 'Y'
order by tdi.kcsc_cd;