기준코드리스트 where절추가

cks
유민형 2023-11-03 11:24:34 +09:00
parent 5db2e775bd
commit eb7e6ad202
4 changed files with 51 additions and 36 deletions

View File

@ -25,7 +25,7 @@ function StandardCodeList(props) {
const bbsId = location.state?.bbsId || NOTICE_BBS_ID;
// eslint-disable-next-line no-unused-vars
const [searchCondition, setSearchCondition] = useState(location.state?.searchCondition || { bbsId: bbsId, pageIndex: 1, searchCnd: '0', searchWrd: '' });// ||
const [searchCondition, setSearchCondition] = useState(location.state?.searchCondition || { listCode: listCode, pageIndex: 1, searchCnd: '0', searchWrd: '' });// ||
const [masterBoard, setMasterBoard] = useState({});
const [paginationInfo, setPaginationInfo] = useState({});

View File

@ -110,6 +110,7 @@ public class StandardCodeController extends BaseController {
paginationInfo.setPageSize(propertyService.getInt("Globals.pageSize"));
System.out.println("@@@ pageIndex : " + tnDocumentInfo.getPageIndex());
System.out.println("@@@ listCode : " + tnDocumentInfo.getListCode());
tnDocumentInfo.setFirstIndex(paginationInfo.getFirstRecordIndex());
tnDocumentInfo.setLastIndex(paginationInfo.getLastRecordIndex());

View File

@ -101,4 +101,6 @@ public class TnDocumentInfo {
private int recordCountPerPage = 10;
@Schema(description = "레코드 번호")
private int rowNo = 0;
@Schema(description = "")
private String listCode;
}

View File

@ -5,48 +5,60 @@
<select id="selectStandardCodeList" parameterType="TnDocumentInfo" resultType="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
tdi.doc_info_seq,
tdi.use_yn,
tdi.rvsn_ymd,
tdi.rvsn_file_grp_id,
tdi.old_seq,
tdi.old_kcsc_cd,
tdi.last_yn,
tdi.last_chg_id,
tdi.last_chg_dt,
tdi.kcsc_cd,
tdi.group_seq,
tdi.frst_crt_id,
tdi.frst_crt_dt,
tdi.estb_ymd,
tdi.doc_yr,
tdi.doc_rvsn_remark,
tdi.doc_rev_hist_seq,
tdi.doc_relation,
tdi.doc_publish,
tdi.doc_order,
tdi.doc_nm,
tdi.doc_file_grp_id,
tdi.doc_er,
tdi.doc_dept,
tdi.doc_cycl,
tdi.doc_consider,
tdi.doc_brief,
tdi.doc_advice,
tdi.aplcn_end_ymd,
tdi.aplcn_bgng_ymd
FROM
tn_document_info
WHERE 1 = 1
ORDER BY doc_info_seq desc
tn_document_info tdi, tn_document_group tdg
<include refid="selectStandardCodeListWhere"></include>
ORDER BY tdi.kcsc_cd
LIMIT #{recordCountPerPage} OFFSET #{firstIndex}
</select>
<select id="selectStandardCodeListCnt" parameterType="TnDocumentInfo" resultType="int">
SELECT count(*)
FROM
tn_document_info
WHERE 1 = 1
tn_document_info tdi, tn_document_group tdg
<include refid="selectStandardCodeListWhere"></include>
</select>
<sql id="selectStandardCodeListWhere">
<where>
and tdi.group_seq = tdg.group_seq
and tdi.kcsc_cd like 'KDS%'
and tdi.last_yn = 'Y'
and tdi.use_yn = 'Y'
<if test="listCode != null and listCode != ''">
and tdg.group_full_cd like #{listCode} || '%'
</if>
</where>
</sql>
</mapper>