강석 최 2023-11-17 11:57:24 +09:00
commit 36eb847b15
6 changed files with 50 additions and 111 deletions

View File

@ -188,7 +188,7 @@ function StandardCodeList(props) {
</li> </li>
<li className="third_2 R"> <li className="third_2 R">
<span className="f_search w_500"> <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 => { onChange={e => {
wrdRef.current.value = e.target.value; 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.LoginVO;
import com.dbnt.kcscbackend.config.common.ResponseCode; import com.dbnt.kcscbackend.config.common.ResponseCode;
import com.dbnt.kcscbackend.config.common.ResultVO; 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.entity.TnDocumentInfo;
import com.dbnt.kcscbackend.standardCode.service.StandardCodeService; import com.dbnt.kcscbackend.standardCode.service.StandardCodeService;
import com.dbnt.kcscbackend.standardCode.service.StandardCodeVO; 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) public ResultVO selectStandardCodeList(@RequestBody TnDocumentInfo tnDocumentInfo, @AuthenticationPrincipal LoginVO user)
throws Exception { throws Exception {
ResultVO resultVO = new ResultVO(); ResultVO resultVO = new ResultVO();
Map<String, Object> resultMap = new HashMap<>();
PaginationInfo paginationInfo = new PaginationInfo(); PaginationInfo paginationInfo = new PaginationInfo();
paginationInfo.setCurrentPageNo(tnDocumentInfo.getPageIndex()); paginationInfo.setCurrentPageNo(tnDocumentInfo.getPageIndex());
paginationInfo.setRecordCountPerPage(propertyService.getInt("Globals.pageUnit")); paginationInfo.setRecordCountPerPage(propertyService.getInt("Globals.pageUnit"));
paginationInfo.setPageSize(propertyService.getInt("Globals.pageSize")); 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); 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); resultMap.put("user", user);
resultVO.setResultCode(ResponseCode.SUCCESS.getCode()); resultVO.setResultCode(ResponseCode.SUCCESS.getCode());

View File

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

View File

@ -10,11 +10,10 @@ import java.util.List;
@Mapper @Mapper
public interface StandardCodeMapper { public interface StandardCodeMapper {
List<TnDocumentInfo> selectStandardCodeList(TnDocumentInfo tnDocumentInfo); List<TnDocumentCodeList> selectStandardCodeList(TnDocumentInfo tnDocumentInfo);
Integer selectStandardCodeListCnt(TnDocumentInfo tnDocumentInfo); Integer selectStandardCodeListCnt(TnDocumentInfo tnDocumentInfo);
List<TnDocumentInfo> selectStandardCodeRevisionhistoryList(Integer groupseq); 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()); return tnDocumentContentRepository.getRecentFullContextByContent(param.getDocCode(), param.getDocPart());
} }
public List<TnDocumentCodeList> selectStandardCodeList(TnDocumentInfo tnDocumentInfo){ return standardCodeMapper.selectStandardCodeList(tnDocumentInfo); }
public Integer selectStandardCodeListCnt(TnDocumentInfo tnDocumentInfo) { public Integer selectStandardCodeListCnt(TnDocumentInfo tnDocumentInfo) {
return standardCodeMapper.selectStandardCodeListCnt(tnDocumentInfo); return standardCodeMapper.selectStandardCodeListCnt(tnDocumentInfo);
} }
@ -37,7 +39,4 @@ public class StandardCodeService extends EgovAbstractServiceImpl {
return standardCodeMapper.selectStandardCodeRevisionhistoryList(groupseq); return standardCodeMapper.selectStandardCodeRevisionhistoryList(groupseq);
} }
public List<TnDocumentCodeList> selectStandardcodelist(String code){
return standardCodeMapper.selectStandardcodelist(code);
}
} }

View File

@ -3,75 +3,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dbnt.kcscbackend.standardCode.mapper.StandardCodeMapper"> <mapper namespace="com.dbnt.kcscbackend.standardCode.mapper.StandardCodeMapper">
<select id="selectStandardCodeList" parameterType="TnDocumentInfo" resultType="TnDocumentInfo"> <select id="selectStandardCodeList" parameterType="TnDocumentInfo" resultType="TnDocumentCodeList">
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>
<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'
<if test="listCode != null and listCode != ''">
and tdg.group_full_cd like #{listCode} || '%'
</if>
</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
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;
</select>
<select id="selectStandardcodelist" resultType="TnDocumentCodeList">
select select
case case
when a3.doc_level > 1 then a3.doc_code_name when a3.doc_level > 1 then a3.doc_code_name
@ -94,20 +26,34 @@
tdi.doc_info_seq = tdc.doc_info_seq, tdi.doc_info_seq = tdc.doc_info_seq,
sp_get_tn_document_code_by_tree() a2, sp_get_tn_document_code_by_tree() a2,
sp_get_tn_document_code_by_tree() a3 sp_get_tn_document_code_by_tree() a3
where <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>
<sql id="selectStandardCodeListWhere">
<where>
a.parent_group_seq = a2.seq a.parent_group_seq = a2.seq
and a2.parent_seq = a3.seq and a2.parent_seq = a3.seq
and a.group_full_cd like #{code} || '%' <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 a.group_type = 'D'
and tdi.last_yn = 'Y' and tdi.last_yn = 'Y'
group by </where>
main_category, </sql>
middle_category,
a.group_nm, <select id="selectStandardCodeRevisionhistoryList" resultType="TnDocumentInfo">
a.kcsc_cd, select tdi.aplcn_bgng_ymd,tdi.doc_file_grp_id,tdi.rvsn_file_grp_id from tn_document_info tdi, tn_document_group tdg
tdi.doc_file_grp_id, where 1 = 1
a.group_seq and tdi.group_seq = tdg.group_seq
order by and tdi.kcsc_cd like 'KDS%'
a.kcsc_cd; and tdi.group_seq =#{groupseq}
and tdi.use_yn = 'Y'
order by tdi.kcsc_cd;
</select> </select>
</mapper> </mapper>