<?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="StandardCodeListDAO">

	<resultMap id="TnDocumentInfo" type="egovframework.dbnt.kcsc.standardCode.entity.TnDocumentInfoVO">
		<result property="docInfoSeq" column="doc_info_seq" />
		<result property="useYn" column="use_yn" />
		<result property="rvsnYmd" column="rvsn_ymd" />
		<result property="rvsnFileGrpId" column="rvsn_file_grp_id" />
		<result property="oldSeq" column="old_seq" />
		<result property="oldKcscCd" column="old_kcsc_cd" />
		<result property="lastYn" column="last_yn" />
		<result property="lastChgId" column="last_chg_id" />
		<result property="lastChgDt" column="last_chg_dt" />
		<result property="kcscCd" column="kcsc_cd" />
		<result property="groupSeq" column="group_seq" />
		<result property="frstCrtId" column="frst_crt_id" />
		<result property="frstCrtDt" column="frst_crt_dt" />
		<result property="estbYmd" column="estb_ymd" />
		<result property="docYr" column="doc_yr" />
		<result property="docRvsnRemark" column="doc_rvsn_remark" />
		<result property="docRevHistSeq" column="doc_rev_hist_seq" />
		<result property="docRelation" column="doc_relation" />
		<result property="docPublish" column="doc_publish" />
		<result property="docOrder" column="doc_order" />
		<result property="docNm" column="doc_nm" />
		<result property="docFileGrpId" column="doc_file_grp_id" />
		<result property="docEr" column="doc_er" />
		<result property="docDept" column="doc_dept" />
		<result property="docCycl" column="doc_cycl" />
		<result property="docConsider" column="doc_consider" />
		<result property="docBrief" column="doc_brief" />
		<result property="docAdvice" column="doc_advice" />
		<result property="aplcnEndYmd" column="aplcn_end_ymd" />
		<result property="aplcnBgngYmd" column="aplcn_bgng_ymd" />
	</resultMap>

 	<select id="selectStandardCodeList" parameterType="egovframework.dbnt.kcsc.standardCode.entity.TnDocumentInfoVO" resultMap="TnDocumentInfo">
			SELECT
				doc_info_seq,
				use_yn,
				rvsn_ymd,
				rvsn_file_grp_id,
				old_seq,
				old_kcsc_cd,
				last_yn,
				last_chg_id,
				last_chg_dt,
				kcsc_cd,
				group_seq,
				frst_crt_id,
				frst_crt_dt,
				estb_ymd,
				doc_yr,
				doc_rvsn_remark,
				doc_rev_hist_seq,
				doc_relation,
				doc_publish,
				doc_order,
				doc_nm,
				doc_file_grp_id,
				doc_er,
				doc_dept,
				doc_cycl,
				doc_consider,
				doc_brief,
				doc_advice,
				aplcn_end_ymd,
				aplcn_bgng_ymd
			FROM
				tn_document_info
			WHERE 1 = 1
			ORDER BY doc_info_seq desc
			LIMIT #{recordCountPerPage} OFFSET #{firstIndex}
 	</select>

	<select id="selectStandardCodeListCnt" parameterType="egovframework.dbnt.kcsc.standardCode.entity.TnDocumentInfoVO" resultType="int">
			SELECT count(*)
			FROM
				tn_document_info
			WHERE 1 = 1
	</select>

</mapper>