2023-10-31 05:59:10 +00:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
|
<mapper namespace="com.dbnt.kcscbackend.standardCode.mapper.StandardCodeMapper">
|
|
|
|
|
|
2023-12-01 08:58:36 +00:00
|
|
|
<sql id="selectStandardCodeListWhere">
|
|
|
|
|
<where>
|
|
|
|
|
a.parent_group_seq = a2.seq
|
|
|
|
|
and a2.parent_seq = a3.seq
|
|
|
|
|
<if test="listCode != null and listCode != ''">
|
|
|
|
|
and a.group_full_cd like #{listCode} || '%'
|
|
|
|
|
</if>
|
|
|
|
|
<if test="searchWrd != null and searchWrd != ''">
|
|
|
|
|
and a.group_nm like '%' || #{searchWrd} || '%'
|
|
|
|
|
</if>
|
|
|
|
|
and a.group_type = 'D'
|
|
|
|
|
and tdi.last_yn = 'Y'
|
|
|
|
|
</where>
|
|
|
|
|
</sql>
|
|
|
|
|
|
2023-11-16 02:58:02 +00:00
|
|
|
<select id="selectStandardCodeList" parameterType="TnDocumentInfo" resultType="TnDocumentCodeList">
|
2023-11-08 02:29:27 +00:00
|
|
|
select
|
2023-12-11 04:15:39 +00:00
|
|
|
count(*) over() as contentcount,
|
2023-11-08 02:29:27 +00:00
|
|
|
case
|
|
|
|
|
when a3.doc_level > 1 then a3.doc_code_name
|
|
|
|
|
else a2.doc_code_name
|
2023-11-16 02:58:02 +00:00
|
|
|
end as main_category,
|
2023-11-08 02:29:27 +00:00
|
|
|
case
|
|
|
|
|
when a3.doc_level > 1 then a2.doc_code_name
|
|
|
|
|
else a.group_nm
|
2023-11-16 02:58:02 +00:00
|
|
|
end as middle_category,
|
2023-11-08 02:29:27 +00:00
|
|
|
a.group_nm,
|
|
|
|
|
a.kcsc_cd,
|
|
|
|
|
tdi.doc_file_grp_id,
|
2023-12-11 04:15:39 +00:00
|
|
|
a.group_seq
|
2023-11-08 02:29:27 +00:00
|
|
|
from
|
|
|
|
|
tn_document_group a
|
2023-11-16 02:58:02 +00:00
|
|
|
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,
|
2023-11-08 02:29:27 +00:00
|
|
|
sp_get_tn_document_code_by_tree() a2,
|
|
|
|
|
sp_get_tn_document_code_by_tree() a3
|
2023-11-16 02:58:02 +00:00
|
|
|
<include refid="selectStandardCodeListWhere"></include>
|
|
|
|
|
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>
|
|
|
|
|
|
2023-12-01 08:58:36 +00:00
|
|
|
<select id="selectStandardCodeGroupSeq" parameterType="String" resultType="Integer">
|
|
|
|
|
select
|
|
|
|
|
group_seq
|
|
|
|
|
from tn_document_group
|
|
|
|
|
where group_full_cd = #{groupFullCd}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectStandardCodeCategoryList" parameterType="Integer" resultType="TnDocumentCodeList">
|
|
|
|
|
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>
|
2023-11-16 02:58:02 +00:00
|
|
|
|
|
|
|
|
<select id="selectStandardCodeRevisionhistoryList" resultType="TnDocumentInfo">
|
|
|
|
|
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;
|
2023-11-08 02:29:27 +00:00
|
|
|
</select>
|
2023-11-16 02:58:02 +00:00
|
|
|
|
2023-10-31 05:59:10 +00:00
|
|
|
</mapper>
|