리스트 수정 1차

cks
유민형 2023-11-16 11:58:02 +09:00
parent 3ec8119c01
commit 648ecec66d
6 changed files with 50 additions and 111 deletions

View File

@ -188,7 +188,7 @@ function StandardCodeList(props) {
</li>
<li className="third_2 R">
<span className="f_search w_500">
<input type="text" name="" defaultValue={searchCondition.searchWrd} placeholder="" ref={wrdRef}
<input type="text" name="" defaultValue={searchCondition.searchWrd} placeholder="코드명" ref={wrdRef}
onChange={e => {
wrdRef.current.value = e.target.value;
}}

View File

@ -4,6 +4,7 @@ import com.dbnt.kcscbackend.config.common.BaseController;
import com.dbnt.kcscbackend.config.common.LoginVO;
import com.dbnt.kcscbackend.config.common.ResponseCode;
import com.dbnt.kcscbackend.config.common.ResultVO;
import com.dbnt.kcscbackend.standardCode.entity.TnDocumentCodeList;
import com.dbnt.kcscbackend.standardCode.entity.TnDocumentInfo;
import com.dbnt.kcscbackend.standardCode.service.StandardCodeService;
import com.dbnt.kcscbackend.standardCode.service.StandardCodeVO;
@ -100,26 +101,18 @@ public class StandardCodeController extends BaseController {
public ResultVO selectStandardCodeList(@RequestBody TnDocumentInfo tnDocumentInfo, @AuthenticationPrincipal LoginVO user)
throws Exception {
ResultVO resultVO = new ResultVO();
Map<String, Object> resultMap = new HashMap<>();
PaginationInfo paginationInfo = new PaginationInfo();
paginationInfo.setCurrentPageNo(tnDocumentInfo.getPageIndex());
paginationInfo.setRecordCountPerPage(propertyService.getInt("Globals.pageUnit"));
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());
tnDocumentInfo.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("resultList", standardCodeService.selectStandardcodelist(tnDocumentInfo.getListCode()));
resultMap.put("resultCnt", standardCodeService.selectStandardCodeListCnt(tnDocumentInfo));
Integer totCnt = (Integer) resultMap.get("resultCnt");
paginationInfo.setTotalRecordCount(totCnt);
resultMap.put("paginationInfo", paginationInfo);
List<TnDocumentCodeList> tnDocumentCodeList = standardCodeService.selectStandardCodeList(tnDocumentInfo);
resultMap.put("resultList", tnDocumentCodeList);
Integer totCnt = tnDocumentCodeList.get(0).getContentcount();
resultMap.put("resultCnt", totCnt);
resultMap.put("user", user);
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());

View File

@ -100,9 +100,11 @@ public class TnDocumentInfo {
@Schema(description = "마지막페이지 인덱스")
private int lastIndex = 1;
@Schema(description = "페이지당 레코드 개수")
private int recordCountPerPage = 10;
private int recordCountPerPage = 100;
@Schema(description = "레코드 번호")
private int rowNo = 0;
@Schema(description = "")
@Transient
private String listCode;
@Transient
private String searchWrd;
}

View File

@ -10,11 +10,10 @@ import java.util.List;
@Mapper
public interface StandardCodeMapper {
List<TnDocumentInfo> selectStandardCodeList(TnDocumentInfo tnDocumentInfo);
List<TnDocumentCodeList> selectStandardCodeList(TnDocumentInfo tnDocumentInfo);
Integer selectStandardCodeListCnt(TnDocumentInfo tnDocumentInfo);
List<TnDocumentInfo> selectStandardCodeRevisionhistoryList(Integer groupseq);
List<TnDocumentCodeList> selectStandardcodelist(String code);
}

View File

@ -29,6 +29,8 @@ public class StandardCodeService extends EgovAbstractServiceImpl {
return tnDocumentContentRepository.getRecentFullContextByContent(param.getDocCode(), param.getDocPart());
}
public List<TnDocumentCodeList> selectStandardCodeList(TnDocumentInfo tnDocumentInfo){ return standardCodeMapper.selectStandardCodeList(tnDocumentInfo); }
public Integer selectStandardCodeListCnt(TnDocumentInfo tnDocumentInfo) {
return standardCodeMapper.selectStandardCodeListCnt(tnDocumentInfo);
}
@ -37,7 +39,4 @@ public class StandardCodeService extends EgovAbstractServiceImpl {
return standardCodeMapper.selectStandardCodeRevisionhistoryList(groupseq);
}
public List<TnDocumentCodeList> selectStandardcodelist(String code){
return standardCodeMapper.selectStandardcodelist(code);
}
}

View File

@ -3,65 +3,49 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dbnt.kcscbackend.standardCode.mapper.StandardCodeMapper">
<select id="selectStandardCodeList" parameterType="TnDocumentInfo" resultType="TnDocumentInfo">
SELECT
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 tdi, tn_document_group tdg
<include refid="selectStandardCodeListWhere"></include>
ORDER BY tdi.kcsc_cd
LIMIT #{recordCountPerPage} OFFSET #{firstIndex}
<select id="selectStandardCodeList" parameterType="TnDocumentInfo" resultType="TnDocumentCodeList">
select
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,
count(tdc.full_content) as contentcount
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
<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>
<select id="selectStandardCodeListCnt" parameterType="TnDocumentInfo" resultType="int">
SELECT count(*)
FROM
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'
a.parent_group_seq = a2.seq
and a2.parent_seq = a3.seq
<if test="listCode != null and listCode != ''">
and tdg.group_full_cd like #{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>
<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
@ -71,43 +55,5 @@
and tdi.use_yn = 'Y'
order by tdi.kcsc_cd;
</select>
<select id="selectStandardcodelist" resultType="TnDocumentCodeList">
select
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,
count(tdc.full_content) as contentcount
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
where
a.parent_group_seq = a2.seq
and a2.parent_seq = a3.seq
and a.group_full_cd like #{code} || '%'
and a.group_type = 'D'
and tdi.last_yn = 'Y'
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>
</mapper>