feat: code feat

main
minuk926 2 years ago
parent 1c772596bb
commit 668c7c8023

@ -1,49 +1,17 @@
package kr.xit.framework.biz.mng.code.mapper;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import egovframework.rte.psl.dataaccess.mapper.Mapper;
import kr.xit.framework.biz.mng.code.model.XitClCodeMngSearchVO;
import kr.xit.framework.biz.mng.code.model.XitClCodeMngVO;
/**
*
* @: Mapper
* @:
* @: 2020. 4. 16. 9:38:07
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@SuppressWarnings("MybatisXMapperMethodInspection")
@Mapper
public interface ICodeClassificationMgtMapper {
/**
* <pre> : </pre>
* @param searchVO
* @return List<XitClCodeMngVO>
* @author:
* @date: 2020. 4. 16.
*/
public List<XitClCodeMngVO> findList(XitClCodeMngSearchVO searchVO) throws SQLException;
/**
* <pre> : </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 4. 16.
*/
public int findListTotCnt(XitClCodeMngSearchVO searchVO) throws SQLException;
/**
* <pre> : </pre>
* @param vo
* @return XitClCodeMngVO
* @author:
* @date: 2020. 4. 16.
*/
public XitClCodeMngVO findView(XitClCodeMngVO vo) throws SQLException;
List<XitClCodeMngVO> selectCmmnClCodes(Map<String, Object> paraMap, RowBounds rowBounds);
}

@ -1,6 +1,12 @@
package kr.xit.framework.biz.mng.code.model;
import kr.xit.framework.core.model.BaseVO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
/**
*
@ -12,7 +18,14 @@ import kr.xit.framework.core.model.BaseVO;
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
public class XitClCodeMngVO extends BaseVO {
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode
@Builder
@ToString
public class XitClCodeMngVO {
/**
* serialVersionUID
@ -48,101 +61,4 @@ public class XitClCodeMngVO extends BaseVO {
* ID
*/
private String lastUpdusrId = "";
/**
* clCode attribute .
* @return String
*/
public String getClCode() {
return clCode;
}
/**
* clCode attribute .
* @param clCode String
*/
public void setClCode(String clCode) {
this.clCode = clCode;
}
/**
* clCodeNm attribute .
* @return String
*/
public String getClCodeNm() {
return clCodeNm;
}
/**
* clCodeNm attribute .
* @param clCodeNm String
*/
public void setClCodeNm(String clCodeNm) {
this.clCodeNm = clCodeNm;
}
/**
* clCodeDc attribute .
* @return String
*/
public String getClCodeDc() {
return clCodeDc;
}
/**
* clCodeDc attribute .
* @param clCodeDc String
*/
public void setClCodeDc(String clCodeDc) {
this.clCodeDc = clCodeDc;
}
/**
* useAt attribute .
* @return String
*/
public String getUseAt() {
return useAt;
}
/**
* useAt attribute .
* @param useAt String
*/
public void setUseAt(String useAt) {
this.useAt = useAt;
}
/**
* frstRegisterId attribute .
* @return String
*/
public String getFrstRegisterId() {
return frstRegisterId;
}
/**
* frstRegisterId attribute .
* @param frstRegisterId String
*/
public void setFrstRegisterId(String frstRegisterId) {
this.frstRegisterId = frstRegisterId;
}
/**
* lastUpdusrId attribute .
* @return String
*/
public String getLastUpdusrId() {
return lastUpdusrId;
}
/**
* lastUpdusrId attribute .
* @param lastUpdusrId String
*/
public void setLastUpdusrId(String lastUpdusrId) {
this.lastUpdusrId = lastUpdusrId;
}
}

@ -1,17 +1,16 @@
package kr.xit.framework.biz.mng.code.service;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
import kr.xit.framework.biz.cmm.model.XitCmmnClCodeVO;
import kr.xit.framework.biz.cmm.service.XitFrameCrudService;
import kr.xit.framework.biz.mng.code.mapper.ICodeClassificationMgtMapper;
import kr.xit.framework.biz.mng.code.model.XitClCodeMngSearchVO;
import kr.xit.framework.biz.mng.code.model.XitClCodeMngVO;
import kr.xit.framework.core.message.XitMessageSource;
@ -28,113 +27,7 @@ public class CodeClassificationMgtService implements ICodeClassificationMgtServi
private XitMessageSource xitMessageSource;
@Override
public List<XitClCodeMngVO> findList(XitClCodeMngSearchVO searchVO) {
List<XitClCodeMngVO> result = null;
try {
result = mapper.findList(searchVO);
} catch (SQLException e) {
throw new RuntimeException("분류코드관리 목록 조회 FAIL::", e);
}
return result;
}
@Override
public int findListTotCnt(XitClCodeMngSearchVO searchVO) {
int result = 0;
try {
result = mapper.findListTotCnt(searchVO);
} catch (SQLException e) {
throw new RuntimeException("분류코드관리 목록 총건수 조회 FAIL::", e);
}
return result;
}
@Override
public XitClCodeMngVO findView(XitClCodeMngVO vo) {
XitClCodeMngVO result = null;
try {
result = mapper.findView(vo);
} catch (SQLException e) {
throw new RuntimeException("분류코드관리 상세정보 조회 FAIL::", e);
}
return result;
}
@Override
public void addProc(XitClCodeMngVO vo) {
/**
*
*/
XitCmmnClCodeVO cmmnClCodeVO = convertToCrudVO(vo);
cmmnClCodeVO.setFrst_register_id(vo.getFrstRegisterId());
/**
*
*/
xitFrameCrudService.addXitCmmnClCode(cmmnClCodeVO);
}
@Override
public void modifyProc(XitClCodeMngVO vo) {
/**
*
*/
XitCmmnClCodeVO cmmnClCodeVO = convertToCrudVO(vo);
cmmnClCodeVO.setLast_updusr_id(vo.getLastUpdusrId());
/**
*
*/
xitFrameCrudService.modifyXitCmmnClCode(cmmnClCodeVO);
}
@Override
public void removeProc(XitClCodeMngVO vo) {
/**
*
*/
XitCmmnClCodeVO cmmnClCodeVO = new XitCmmnClCodeVO();
cmmnClCodeVO.setCl_code(vo.getClCode());
cmmnClCodeVO.setLast_updusr_id(vo.getLastUpdusrId());
cmmnClCodeVO.setUse_at("N");
/**
*
*/
xitFrameCrudService.modifyXitCmmnClCode(cmmnClCodeVO);
}
@Override
public void removesProc(String ids, String userId) {
/**
*
*/
String [] clCodes = ids.split(";");
for(int i=0; i<clCodes.length;i++) {
XitClCodeMngVO vo = new XitClCodeMngVO();
vo.setClCode(clCodes[i]);
vo.setLastUpdusrId(userId);
this.removeProc(vo);
}
}
/**
* <pre>
* : VO CRUD Service VO .
* </pre>
*
* @return XitCmmnClCodeVO
* @author:
* @date: 2020. 4. 16.
*/
private XitCmmnClCodeVO convertToCrudVO(XitClCodeMngVO vo) {
XitCmmnClCodeVO crudVO = new XitCmmnClCodeVO();
crudVO.setCl_code (vo.getClCode()); //분류 코드
crudVO.setCl_code_nm (vo.getClCodeNm()); //분류 코드 명
crudVO.setCl_code_dc (vo.getClCodeDc()); //분류 코드 설명
crudVO.setUse_at (vo.getUseAt()); //사용 여부
return crudVO;
public List<XitClCodeMngVO> findCodeClassifications(Map<String, Object> paraMap, RowBounds rowBounds) {
return mapper.selectCmmnClCodes(paraMap, rowBounds);
}
}

@ -1,8 +1,10 @@
package kr.xit.framework.biz.mng.code.service;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import kr.xit.framework.biz.mng.code.model.XitClCodeMngSearchVO;
import kr.xit.framework.biz.mng.code.model.XitClCodeMngVO;
/**
@ -18,62 +20,5 @@ import kr.xit.framework.biz.mng.code.model.XitClCodeMngVO;
public interface ICodeClassificationMgtService {
/**
* <pre> : </pre>
* @param searchVO
* @return List<XitClCodeMngVO>
* @author:
* @date: 2020. 4. 16.
*/
public List<XitClCodeMngVO> findList(XitClCodeMngSearchVO searchVO);
/**
* <pre> : </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 4. 16.
*/
public int findListTotCnt(XitClCodeMngSearchVO searchVO);
/**
* <pre> : </pre>
* @param vo
* @return XitClCodeMngVO
* @author:
* @date: 2020. 4. 16.
*/
public XitClCodeMngVO findView(XitClCodeMngVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
public void addProc(XitClCodeMngVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
public void modifyProc(XitClCodeMngVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
public void removeProc(XitClCodeMngVO vo);
/**
* <pre> : </pre>
* @param ids void
* @author:
* @date: 2020. 4. 16.
*/
public void removesProc(String ids, String userId);
List<XitClCodeMngVO> findCodeClassifications(Map<String, Object> paraMap, RowBounds pagingInfo);
}

@ -1,39 +1,21 @@
package kr.xit.framework.biz.mng.code.web;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.support.SessionStatus;
import org.springframework.web.servlet.ModelAndView;
import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
import kr.xit.framework.biz.cmm.model.XitLoginVO;
import kr.xit.framework.biz.mng.code.model.XitClCodeMngSearchVO;
import kr.xit.framework.biz.mng.code.model.XitClCodeMngVO;
import kr.xit.framework.biz.mng.code.service.ICodeClassificationMgtService;
import kr.xit.framework.core.constants.FrameworkConstants;
import kr.xit.framework.core.constants.FrameworkConstants.TILES_TYPE;
import kr.xit.framework.core.message.XitMessageSource;
import kr.xit.framework.core.utils.XitCmmnUtil;
import kr.xit.framework.core.model.ResultResponse;
import kr.xit.framework.core.validation.XitBeanValidator;
import kr.xit.framework.support.util.AjaxUtils;
import kr.xit.framework.support.mybatis.MybatisUtils;
/**
*
@ -60,284 +42,9 @@ public class CodeClassificationMgtController {
public void mngCodeClassificationMgtForm() {
}
/**
* <pre> : </pre>
* @return String
* @author:
* @date: 2020. 7. 31.
*/
@RequestMapping(value = "ClCodeMng_list.ajax", method={RequestMethod.GET, RequestMethod.POST})
@ResponseBody
public Map<String, Object> ClCodeMng_listAjax(@ModelAttribute("searchVO") XitClCodeMngSearchVO searchVO, ModelMap model) {
/** paging */
PaginationInfo paginationInfo = new PaginationInfo();
paginationInfo.setCurrentPageNo(searchVO.getPage()>-1?searchVO.getPage():searchVO.getPageIndex());
paginationInfo.setRecordCountPerPage(searchVO.getPerPage()>-1?searchVO.getPerPage():searchVO.getPageUnit());
paginationInfo.setPageSize(searchVO.getPageSize());
searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
searchVO.setLastIndex(paginationInfo.getLastRecordIndex());
searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
Map<String, Object> resultMap = new HashMap<String, Object>();
try {
/**
*
*/
int totCnt = service.findListTotCnt(searchVO);
paginationInfo.setTotalRecordCount(totCnt);
/**
*
*/
/* ***************************
* tui Grid Response Set
*************************** */
resultMap.put("result", true); //[tui Grid] result
resultMap.put("message", xitMessageSource.getMessage("success.common.select")); //[tui Grid] result message
Map<String, Object> data = new HashMap<String, Object>();
data.put("contents", service.findList(searchVO)); //[tui Grid] data-contents
Map<String, Integer> pagination = new HashMap<String, Integer>();
pagination.put("page", searchVO.getPage());
pagination.put("totalCount", totCnt);
data.put("pagination", pagination); //[tui Grid] data-paging
resultMap.put("data", data); //[tui Grid] data
/* ***************************
* //tui Grid Response Set
*************************** */
} catch (Exception e) {
/**
*
*/
//tui Grid Response Set
resultMap.put("result", false); //[tui Grid] result
resultMap.put("message", xitMessageSource.getMessage("fail.common.select")); //[tui Grid] result message
}
return resultMap;
@GetMapping(value = "/findCodeClassifications")
public ModelAndView findCodeClassifications(@RequestParam final Map<String, Object> paraMap){
return ResultResponse.of(service.findCodeClassifications(paraMap, MybatisUtils.getPagingInfo(paraMap)));
}
/**
* <pre> : .</pre>
* @param page
* @param tilesDef Type(none: tiles )
* @param model
* @return String
* @author:
* @date: 2020. 4. 16.
*/
@RequestMapping(value = "ClCodeMng_{cmd}", method={RequestMethod.GET, RequestMethod.POST})
public String ClCodeMng_page(@PathVariable String cmd
, @RequestParam(value="tilesDef", required=false, defaultValue="") String tilesDef
, @ModelAttribute("cmmnClCode") XitClCodeMngVO vo
, @ModelAttribute XitClCodeMngSearchVO searchVO
, ModelMap model) {
switch (cmd) {
case "input": //등록 페이지
break;
case "edit": //수정 페이지
case "view": //상세 페이지
model.addAttribute("cmmnClCode", service.findView(vo));
model.addAttribute("message", xitMessageSource.getMessage("success.common.select"));
break;
default:
throw new RuntimeException("유효하지 않은 요청 입니다.");
}
if(!"".equals(tilesDef))
tilesDef = "."+tilesDef;
return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/code/XitClCodeMng_"+cmd+tilesDef;
}
/**
* <pre> : .</pre>
* @param page
* @param model
* @return String
* @author:
* @date: 2020. 4. 16.
*/
@RequestMapping(value = "ClCodeMng_{cmd}_popup", method={RequestMethod.GET, RequestMethod.POST})
public String ClCodeMng_page_popup(@PathVariable String cmd
, @ModelAttribute("cmmnClCode") XitClCodeMngVO vo
, @ModelAttribute XitClCodeMngSearchVO searchVO
, ModelMap model) {
switch (cmd) {
case "": //
break;
default:
throw new RuntimeException("유효하지 않은 요청 입니다.");
}
return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/code/XitClCodeMng_"+cmd+"_popup"+TILES_TYPE.POPUP.getVal();
}
/**
* <pre> : CUD </pre>
* @return String
* @author:
* @throws IOException
* @throws ServletException
* @date: 2020. 4. 16.
*/
@RequestMapping(value = "ClCodeMng_{cmd}_proc", method=RequestMethod.POST)
public void ClCodeMng_cmd_proc(@PathVariable String cmd
,@ModelAttribute("vo") XitClCodeMngVO vo
,@ModelAttribute("searchVO") XitClCodeMngSearchVO searchVO
,@RequestParam(value="clCodes", required=false, defaultValue="") String clCodes
,BindingResult bindingResult
,SessionStatus status
,Model model
,HttpServletRequest request
,HttpServletResponse response
) throws ServletException, IOException {
/**
*
*/
XitLoginVO loginVO = (XitLoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
String sLocationUrl = "forward:/framework/biz/mng/code/ClCodeMng_list";
String message = null;
switch (cmd) {
case "insert": //등록
//유효성 확인
//2020.11.24. 주석처리
beanValidator.validate(vo, bindingResult);
// beanValidator.validate("cmmnClCode", vo, bindingResult);
if (bindingResult.hasErrors()) {
message = xitMessageSource.getMessage("fail.common.insert");
sLocationUrl = "forward:/framework/biz/mng/code/ClCodeMng_input";
break;
}
//처리
try {
vo.setFrstRegisterId(loginVO.getUniqId());
service.addProc(vo);
status.setComplete();
message = xitMessageSource.getMessage("success.common.insert");
} catch (RuntimeException e) {
message = e.getMessage();
sLocationUrl = "forward:/framework/biz/mng/code/ClCodeMng_input";
} catch (Exception e) {
message = xitMessageSource.getMessage("fail.common.insert");
sLocationUrl = "forward:/framework/biz/mng/code/ClCodeMng_input";
}
break;
// case "inserts": //다건 등록
// break;
case "update": //수정
//유효성 확인
//2020.11.24. 주석처리
beanValidator.validate(vo, bindingResult);
// beanValidator.validate("cmmnClCode", vo, bindingResult);
if (bindingResult.hasErrors()) {
message = xitMessageSource.getMessage("fail.common.update");
sLocationUrl = "forward:/framework/biz/mng/code/ClCodeMng_edit";
break;
}
//처리
try {
vo.setLastUpdusrId(loginVO.getUniqId());
service.modifyProc(vo);
status.setComplete();
message = xitMessageSource.getMessage("success.common.update");
} catch (RuntimeException e) {
message = e.getMessage();
sLocationUrl = "forward:/framework/biz/mng/code/ClCodeMng_edit";
} catch (Exception e) {
message = xitMessageSource.getMessage("fail.common.update");
sLocationUrl = "forward:/framework/biz/mng/code/ClCodeMng_edit";
}
break;
case "delete": //삭제
//처리
try {
vo.setLastUpdusrId(loginVO.getUniqId());
service.removeProc(vo);
status.setComplete();
message = xitMessageSource.getMessage("success.common.delete");
break;
} catch (RuntimeException e) {
message = e.getMessage();
sLocationUrl = "forward:/framework/biz/mng/code/ClCodeMng_edit";
} catch (Exception e) {
message = xitMessageSource.getMessage("fail.common.delete");
sLocationUrl = "forward:/framework/biz/mng/code/ClCodeMng_edit";
}
break;
case "deletes": //다건 삭제
//처리
try {
service.removesProc(clCodes, loginVO.getUniqId());
status.setComplete();
message = xitMessageSource.getMessage("success.common.delete");
} catch (RuntimeException e) {
message = e.getMessage();
} catch (Exception e) {
message = xitMessageSource.getMessage("fail.common.delete");
}
break;
default:
new RuntimeException("유효하지 않은 요청 입니다.");
}
/**
*
*/
/* ============================
* 2020.09.10
*
* - ajax json
* [AS-IS] String, return url "forward"
* [TO-BE] void, DispatchServlet forward , ajax json forward
============================ */
//2020.09.10 주석처리
// model.addAttribute("message", message);
// return sLocationUrl;
model.addAttribute("message", message);
if(AjaxUtils.isAjaxRequest(request)){ //ajax 요청시
//반환 데이터 설정
Map<String, Object> resultMap = new HashMap<String, Object>();
resultMap.put("message", message);
XitCmmnUtil.forwardForAjaxRequest(request, response, resultMap);
}else { //submit 요청 시
XitCmmnUtil.forwardForSubmitRequest(request, response, sLocationUrl, model.asMap());
}
}
}

@ -1,77 +1,130 @@
<?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="kr.xit.framework.biz.mng.code.mapper.IXitClCodeMngMapper">
<!-- SQL 페이징 코드 -->
<sql id="pageBefore">
SELECT LIST.* FROM(
</sql>
<sql id="pageAfter">
) LIST LIMIT #{firstIndex}, #{recordCountPerPage}
</sql>
<sql id="findList_SELECT">
SELECT A.CL_CODE AS "clCode"
, A.CL_CODE_NM AS "clCodeNm"
, A.CL_CODE_DC AS "clCodeDc"
, A.USE_AT AS "useAt"
</sql>
<sql id="findList_FROM">
FROM XIT_CMMN_CL_CODE A
</sql>
<sql id="findList_WHERE">
<if test="'1'.toString() == searchCondition">
AND A.CL_CODE = #{searchKeyword}
</if>
<if test="'2'.toString() == searchCondition">
AND A.CL_CODE_NM LIKE CONCAT('%',#{searchKeyword},'%')
</if>
<if test="'CodeList' == searchCondition">
AND A.USE_AT = 'Y'
</if>
</sql>
<select id="findList" resultType="kr.xit.framework.biz.mng.code.model.XitClCodeMngVO">
/** XitClCodeMngMapper.findList */
/** 분류코드관리 목록 조회 */
<if test="searchGubun == 'list'">
<include refid="pageBefore" />
</if>
<include refid="findList_SELECT"/>
<include refid="findList_FROM"/>
WHERE 1=1
<include refid="findList_WHERE"/>
<if test="searchGubun == 'list'">
<include refid="pageAfter" />
</if>
<mapper namespace="kr.xit.framework.biz.mng.code.mapper.ICodeClassificationMgtMapper">
<!-- *************************************************************************************************************
* xit_author_info : 권한 정보
************************************************************************************************************** -->
<select id="selectCmmnClCodes">
/* code-classification-mysql-mapper|selectCmmnClCodes-분류코드 목록 조회|julim */
</select>
<select id="findListTotCnt" resultType="int">
/** XitClCodeMngMapper.findListTotCnt */
/** 분류코드관리 목록 총건수 조회 */
SELECT COUNT(1) AS "CNT"
<include refid="findList_FROM"/>
<select id="findXitCmmnClCodes" resultType="kr.xit.framework.biz.cmm.model.XitCmmnClCodeVO">
/** findXitCmmnClCodes */
/** 공통분류코드 다건 조회 */
SELECT CL_CODE
,CL_CODE_NM
,CL_CODE_DC
,USE_AT
,FRST_REGIST_PNTTM
,FRST_REGISTER_ID
,LAST_UPDT_PNTTM
,LAST_UPDUSR_ID
FROM XIT_CMMN_CL_CODE
WHERE 1=1
<include refid="findList_WHERE"/>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(cl_code )">AND CL_CODE = #{cl_code }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(cl_code_nm )">AND CL_CODE_NM = #{cl_code_nm }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(cl_code_dc )">AND CL_CODE_DC = #{cl_code_dc }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(use_at )">AND USE_AT = #{use_at }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(frst_regist_pnttm)">AND FRST_REGIST_PNTTM = #{frst_regist_pnttm}</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(frst_register_id )">AND FRST_REGISTER_ID = #{frst_register_id }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(last_updt_pnttm )">AND LAST_UPDT_PNTTM = #{last_updt_pnttm }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(last_updusr_id )">AND LAST_UPDUSR_ID = #{last_updusr_id }</if>
</select>
<select id="findView" resultType="kr.xit.framework.biz.mng.code.model.XitClCodeMngVO">
/** XitClCodeMngMapper.findView */
/** 분류코드관리 상세정보 조회 */
<include refid="findList_SELECT"/>
<include refid="findList_FROM"/>
WHERE A.CL_CODE = #{clCode}
<select id="findXitCmmnClCode" resultType="kr.xit.framework.biz.cmm.model.XitCmmnClCodeVO">
/** findXitCmmnClCode */
/** 공통분류코드 조회 */
SELECT CL_CODE
,CL_CODE_NM
,CL_CODE_DC
,USE_AT
,FRST_REGIST_PNTTM
,FRST_REGISTER_ID
,LAST_UPDT_PNTTM
,LAST_UPDUSR_ID
FROM XIT_CMMN_CL_CODE
WHERE 1=1
AND CL_CODE = #{cl_code}
</select>
<insert id="addXitCmmnClCode">
/** addXitCmmnClCode */
/** 공통분류코드 등록 */
INSERT INTO XIT_CMMN_CL_CODE(
CL_CODE
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(cl_code_nm )">,CL_CODE_NM </if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(cl_code_dc )">,CL_CODE_DC </if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(use_at )">,USE_AT </if>
,FRST_REGIST_PNTTM
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(frst_register_id )">,FRST_REGISTER_ID </if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(last_updt_pnttm )">,LAST_UPDT_PNTTM </if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(last_updusr_id )">,LAST_UPDUSR_ID </if>
)VALUES(
#{cl_code }
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(cl_code_nm )">,#{cl_code_nm }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(cl_code_dc )">,#{cl_code_dc }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(use_at )">,#{use_at }</if>
,NOW()
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(frst_register_id )">,#{frst_register_id }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(last_updt_pnttm )">,#{last_updt_pnttm }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(last_updusr_id )">,#{last_updusr_id }</if>
)
</insert>
<update id="modifyXitCmmnClCode">
/** modifyXitCmmnClCode */
/** 공통분류코드 수정 */
UPDATE XIT_CMMN_CL_CODE
SET
LAST_UPDT_PNTTM = NOW()
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(cl_code_nm )">,CL_CODE_NM = #{cl_code_nm }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(cl_code_dc )">,CL_CODE_DC = #{cl_code_dc }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(use_at )">,USE_AT = #{use_at }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(frst_regist_pnttm)">,FRST_REGIST_PNTTM = #{frst_regist_pnttm}</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(frst_register_id )">,FRST_REGISTER_ID = #{frst_register_id }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(last_updusr_id )">,LAST_UPDUSR_ID = #{last_updusr_id }</if>
WHERE 1=1
AND CL_CODE = #{cl_code}
</update>
<delete id="removeXitCmmnClCode">
/** removeXitCmmnClCode */
/** 공통분류코드 삭제 */
DELETE FROM XIT_CMMN_CL_CODE
WHERE 1=1
AND CL_CODE = #{cl_code}
</delete>
</mapper>

@ -0,0 +1,136 @@
<?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="kr.xit.framework.biz.mng.code.mapper.">
<!-- *************************************************************************************************************
* xit_author_info : 권한 정보
************************************************************************************************************** -->
<select id="selectCmmnClCodes">
/* code-classification-mysql-mapper|selectCmmnClCodes-분류코드 목록 조회|julim */
</select>
<select id="findXitCmmnCodes" resultType="kr.xit.framework.biz.cmm.model.XitCmmnCodeVO">
/** findXitCmmnCodes */
/** 공통코드 다건 조회 */
SELECT CODE_ID
,CODE_ID_NM
,CODE_ID_DC
,USE_AT
,CL_CODE
,FRST_REGIST_PNTTM
,FRST_REGISTER_ID
,LAST_UPDT_PNTTM
,LAST_UPDUSR_ID
FROM XIT_CMMN_CODE
WHERE 1=1
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(code_id )">AND CODE_ID = #{code_id }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(code_id_nm )">AND CODE_ID_NM = #{code_id_nm }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(code_id_dc )">AND CODE_ID_DC = #{code_id_dc }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(use_at )">AND USE_AT = #{use_at }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(cl_code )">AND CL_CODE = #{cl_code }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(frst_regist_pnttm)">AND FRST_REGIST_PNTTM = #{frst_regist_pnttm}</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(frst_register_id )">AND FRST_REGISTER_ID = #{frst_register_id }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(last_updt_pnttm )">AND LAST_UPDT_PNTTM = #{last_updt_pnttm }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(last_updusr_id )">AND LAST_UPDUSR_ID = #{last_updusr_id }</if>
</select>
<select id="findXitCmmnCode" resultType="kr.xit.framework.biz.cmm.model.XitCmmnCodeVO">
/** findXitCmmnCode */
/** 공통코드 조회 */
SELECT CODE_ID
,CODE_ID_NM
,CODE_ID_DC
,USE_AT
,CL_CODE
,FRST_REGIST_PNTTM
,FRST_REGISTER_ID
,LAST_UPDT_PNTTM
,LAST_UPDUSR_ID
FROM XIT_CMMN_CODE
WHERE 1=1
AND CODE_ID = #{code_id}
</select>
<insert id="addXitCmmnCode">
/** addXitCmmnCode */
/** 공통코드 등록 */
INSERT INTO XIT_CMMN_CODE(
CODE_ID
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(code_id_nm )">,CODE_ID_NM </if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(code_id_dc )">,CODE_ID_DC </if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(use_at )">,USE_AT </if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(cl_code )">,CL_CODE </if>
,FRST_REGIST_PNTTM
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(frst_register_id )">,FRST_REGISTER_ID </if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(last_updt_pnttm )">,LAST_UPDT_PNTTM </if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(last_updusr_id )">,LAST_UPDUSR_ID </if>
)VALUES(
#{code_id }
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(code_id_nm )">,#{code_id_nm }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(code_id_dc )">,#{code_id_dc }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(use_at )">,#{use_at }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(cl_code )">,#{cl_code }</if>
,NOW()
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(frst_register_id )">,#{frst_register_id }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(last_updt_pnttm )">,#{last_updt_pnttm }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(last_updusr_id )">,#{last_updusr_id }</if>
)
</insert>
<update id="modifyXitCmmnCode">
/** modifyXitCmmnCode */
/** 공통코드 수정 */
UPDATE XIT_CMMN_CODE
SET
LAST_UPDT_PNTTM = NOW()
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(code_id_nm )">,CODE_ID_NM = #{code_id_nm }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(code_id_dc )">,CODE_ID_DC = #{code_id_dc }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(use_at )">,USE_AT = #{use_at }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(cl_code )">,CL_CODE = #{cl_code }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(frst_regist_pnttm)">,FRST_REGIST_PNTTM = #{frst_regist_pnttm}</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(frst_register_id )">,FRST_REGISTER_ID = #{frst_register_id }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(last_updusr_id )">,LAST_UPDUSR_ID = #{last_updusr_id }</if>
WHERE 1=1
AND CODE_ID = #{code_id}
</update>
<delete id="removeXitCmmnCode">
/** removeXitCmmnCode */
/** 공통코드 삭제 */
DELETE FROM XIT_CMMN_CODE
WHERE 1=1
AND CODE_ID = #{code_id}
</delete>
</mapper>

@ -0,0 +1,164 @@
<?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="kr.xit.framework.biz.mng.code.mapper.">
<!-- *************************************************************************************************************
* xit_author_info : 권한 정보
************************************************************************************************************** -->
<select id="selectCmmnClCodes">
/* code-classification-mysql-mapper|selectCmmnClCodes-분류코드 목록 조회|julim */
</select>
<select id="findXitCmmnDetailCodes" resultType="kr.xit.framework.biz.cmm.model.XitCmmnDetailCodeVO">
/** findXitCmmnDetailCodes */
/** 공통상세코드 다건 조회 */
SELECT CODE_ID
,CODE
,CODE_NM
,CODE_DC
,USE_AT
,ETC_1
,ETC_2
,ETC_3
,ORDR
,FRST_REGIST_PNTTM
,FRST_REGISTER_ID
,LAST_UPDT_PNTTM
,LAST_UPDUSR_ID
FROM XIT_CMMN_DETAIL_CODE
WHERE 1=1
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(code_id )">AND CODE_ID = #{code_id }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(code )">AND CODE = #{code }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(code_nm )">AND CODE_NM = #{code_nm }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(code_dc )">AND CODE_DC = #{code_dc }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(use_at )">AND USE_AT = #{use_at }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(frst_regist_pnttm)">AND FRST_REGIST_PNTTM = #{frst_regist_pnttm}</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(frst_register_id )">AND FRST_REGISTER_ID = #{frst_register_id }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(last_updt_pnttm )">AND LAST_UPDT_PNTTM = #{last_updt_pnttm }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(last_updusr_id )">AND LAST_UPDUSR_ID = #{last_updusr_id }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(etc_1 )">AND ETC_1 = #{etc_1 }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(etc_2 )">AND ETC_2 = #{etc_2 }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(etc_3 )">AND ETC_3 = #{etc_3 }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(ordr )">AND ORDR = #{ordr }</if>
</select>
<select id="findXitCmmnDetailCode" resultType="kr.xit.framework.biz.cmm.model.XitCmmnDetailCodeVO">
/** findXitCmmnDetailCode */
/** 공통상세코드 조회 */
SELECT CODE_ID
,CODE
,CODE_NM
,CODE_DC
,USE_AT
,ETC_1
,ETC_2
,ETC_3
,ORDR
,FRST_REGIST_PNTTM
,FRST_REGISTER_ID
,LAST_UPDT_PNTTM
,LAST_UPDUSR_ID
FROM XIT_CMMN_DETAIL_CODE
WHERE 1=1
AND CODE_ID = #{code_id}
AND CODE = #{code }
</select>
<insert id="addXitCmmnDetailCode">
/** addXitCmmnDetailCode */
/** 공통상세코드 등록 */
INSERT INTO XIT_CMMN_DETAIL_CODE(
CODE_ID
,CODE
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(code_nm )">,CODE_NM </if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(code_dc )">,CODE_DC </if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(use_at )">,USE_AT </if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(etc_1 )">,ETC_1 </if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(etc_2 )">,ETC_2 </if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(etc_3 )">,ETC_3 </if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(ordr )">,ORDR </if>
,FRST_REGIST_PNTTM
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(frst_register_id )">,FRST_REGISTER_ID </if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(last_updt_pnttm )">,LAST_UPDT_PNTTM </if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(last_updusr_id )">,LAST_UPDUSR_ID </if>
)VALUES(
#{code_id }
,#{code }
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(code_nm )">,#{code_nm }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(code_dc )">,#{code_dc }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(use_at )">,#{use_at }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(etc_1 )">,#{etc_1 }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(etc_2 )">,#{etc_2 }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(etc_3 )">,#{etc_3 }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(ordr )">,#{ordr }</if>
,NOW()
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(frst_register_id )">,#{frst_register_id }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(last_updt_pnttm )">,#{last_updt_pnttm }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(last_updusr_id )">,#{last_updusr_id }</if>
)
</insert>
<update id="modifyXitCmmnDetailCode">
/** modifyXitCmmnDetailCode */
/** 공통상세코드 수정 */
UPDATE XIT_CMMN_DETAIL_CODE
SET
LAST_UPDT_PNTTM = NOW()
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(code_nm )">,CODE_NM = #{code_nm }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(code_dc )">,CODE_DC = #{code_dc }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(use_at )">,USE_AT = #{use_at }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(etc_1 )">,ETC_1 = #{etc_1 }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(etc_2 )">,ETC_2 = #{etc_2 }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(etc_3 )">,ETC_3 = #{etc_3 }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(ordr )">,ORDR = #{ordr }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(frst_regist_pnttm)">,FRST_REGIST_PNTTM = #{frst_regist_pnttm}</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(frst_register_id )">,FRST_REGISTER_ID = #{frst_register_id }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(last_updusr_id )">,LAST_UPDUSR_ID = #{last_updusr_id }</if>
WHERE 1=1
AND CODE_ID = #{code_id}
AND CODE = #{code }
</update>
<delete id="removeXitCmmnDetailCode">
/** removeXitCmmnDetailCode */
/** 공통상세코드 삭제 */
DELETE
FROM XIT_CMMN_DETAIL_CODE
WHERE 1=1
AND CODE_ID = #{code_id}
AND CODE = #{code }
</delete>
</mapper>

@ -50,212 +50,126 @@
</form>
<script type="text/javaScript">
$(document).ready(function(){
XitClCodeMng_list.init();
});
/* *******************************
* 분류코드 관리 Functions
******************************* */
var XitClCodeMng_list = {
init : function(){
/**
* Grid Config Settings
*/
//Grid Style Set
Grid.applyTheme('striped'); // Call API of static method
//Grid 체크박스 checked EventListner
instance.on('check', function(ev) {
// console.log('check!', ev);
});
//Grid 체크박스 unchecked EventListner
instance.on('uncheck', function(ev) {
// console.log('uncheck!', ev);
});
//Grid 체크박스 focus이동 EventListner
instance.on('focusChange', function(ev) {
// console.log('change focused cell!', ev);
});
/**
* Elements EventListener Settings
*/
//검색 Event 설정
$('#btnSearch').on({
click: function(){
XitClCodeMng_list.findData();
}
});
//등록 Event 설정
$("#btnRegist").click(function(){
XitClCodeMng_list.pagePopup('detail', "<c:url value='/_mng_/code/cl/ClCodeMng_input.do'/>");
});
},
/* ========================
* 데이터 조회
======================== */
findData : function(){
instance.reloadData();
},
/* ========================
* 데이터 등록
======================== */
addData : function(){
},
/* ========================
* 데이터 수정
======================== */
modifyData : function(){
},
/* ========================
* 데이터 삭제
======================== */
removeData : function(){
}
/* ========================
* 상세 팝업 오픈 버튼 클릭
-상세 팝업을 OPEN 한다.
======================== */
,fnClickClBtn : function(props){
var rowData = props.grid.getRow(props.rowKey);
var params = "";
params += "clCode=" + rowData.clCode;
XitClCodeMng_list.pagePopup('detail', "<c:url value='/_mng_/code/cl/ClCodeMng_edit.do'/>", params);
/**************************************************************************
* Global Variable
**************************************************************************/
var callbackSearch = () => fnBiz.search(); // 데이터 조회 : popup에서 사용
let GRID = null;
/* *******************************
* Biz function
******************************* */
const fnBiz = {
search: () => {
GRID.reloadData();
}
/* ========================
* 페이지 Open
-팝업페이지를 Open 한다.
======================== */
,pagePopup: function(flag, url, params){
var popUrl = url;
popUrl += "?tilesDef=popup";
if(!(params == undefined || params == null)){
popUrl += "&";
popUrl += params;
}
var popTitle = '';
,pagePopup: function(flag, params){
let url = '<c:url value="/framework/biz/mng/menu/mngProgramMgtPopup.do"/>';
let popTitle;
let popOption = {width: 700, height:660}
switch (flag) {
case "detail": //상세
popTitle = "분류코드 관리 상세";
popOption = "scrollbars = yes, top=100px, left=100px, height=550px, width=700px;";
case "add": //등록
popTitle = "프로그램 등록";
break;
case "input": //입력
popTitle = "분류코드 관리 입력";
popOption = "scrollbars = yes, top=100px, left=100px, height=550px, width=700px;";
case "detail": //상세
popTitle = "프로그램 상세";
break;
default:
break;
}
window.open(popUrl, popTitle ,popOption);
},
}
CmmPopup.open(url, params, popOption, popTitle);
}
,onClickGrid: function(props){
const rowData = props.grid.getRow(props.rowKey);
fnBiz.pagePopup('detail', rowData);
}
}
/**************************************************************************
* event
**************************************************************************/
$(() => {
$('#btnSearch').on('click', () => {
fnBiz.search();
});
$('#btnRegist').on('click', () => {
fnBiz.pagePopup('add', null);
});
});
/* *******************************
* Grid
******************************* */
const initGrid = () => {
/* ******************************
* Grid 환경 설정
****************************** */
var GridConfig = new XitTuiGridConfig();
GridConfig.setOptGridId('grid'); //Grid를 출력할 Element ID(해당 Element에 Grid가 출력 됨)
GridConfig.setOptGridHeight(270); //Grid 높이(단위: px)
GridConfig.setOptRowHeight(20); //Grid row 높이(단위: px)
GridConfig.setOptRowHeaderType('rowNum'); //Row 첫번째 Cell 타입(rowNum: 순번, checkbox: 체크박스, '': 아무것도 출력 안함)
GridConfig.setOptPageOptions({ //페이징(Pagination) 옵션
useClient: true //Client Paging 여부(true 설정 시 클라이언트 자체 페이징 처리. 서버호출 X)
,perPage: 10 //페이지당 표시 건수
});
GridConfig.setOptColumnOptions({ //컬럼고정 옵션
});
GridConfig.setOptDataSource({ //DataSource
/* -----------------------
* DataSource Config Setting
* -설정항목은 Global 적용 되며
* -API별 적용을 원할 경우 각 API 안에 작성 가능(우선순위: 개별->글로벌)
----------------------- */
//contentType: 'application/json',
//headers: { 'x-custom-header': 'custom-header' },
initialRequest: true, //디폴트 값은 true(false: 인스턴스 생성 시 요청은 보내지 않음. 이런 경우 "instance.reloadData()"를 사용하여 요청 가능)
//serializer: function(params) {
//return $(document.listForm).serialize();
// },
/* -----------------------
* DataSource API Setting
----------------------- */
api: {
readData : {
url: '<c:url value="/_mng_/code/cl/ClCodeMng_list.ajax"/>', method: 'GET'
,initParams: {}
,serializer: function(params) {
var form = document.listForm;
var serializeParam = $(form).serialize();
for(var key in params){
if(key=='perPage'){
if(params[key]==undefined)
serializeParam +='&'+key+'=-1';
else
serializeParam +='&'+key+'='+params[key];
}else
serializeParam +='&'+key+'='+params[key];
/* ******************************
* Grid start
****************************** */
const gridColumns = [ //Grid 컬럼 정보(명칭,매핑 field, 기타옵션 등)
{
header: '분류코드',
name: 'clCode',
width: 100,
sortable: true,
sortingType: 'desc',
align: 'center',
renderer: {
type: CustomButtonRenderer,
options: {
formatter : function(props){
var rowData = props.grid.getRow(props.rowKey);
var obj = {
formatter : rowData.clCode
,element : "text"
}
return obj;
}
,eventFunction: XitClCodeMng_list.fnClickClBtn//function(props){XitClCodeMng_list.fnClickDetail(props)} //function(){alert("1234")}
,eventType : "click"
}
}
return serializeParam;
},
{
header: '분류코드명',
name: 'clCodeNm',
minWidth: 400,
sortable: false,
align: 'center'
},
{
header: '사용여부',
name: 'useAt',
width: 80,
sortable: false,
align: 'center'
}
}
,createData: { url: '', method: 'POST'}
,updateData: { url: '', method: 'PUT'}
,modifyData: { url: '', method: 'PUT'}
,deleteData: { url: '', method: 'DELETE'}
}
});
GridConfig.setOptHeader({
}); //Grid 헤더 정보(헤더 셀 병합 필요 시 설정)
GridConfig.setOptColumns([ //Grid 컬럼 정보(명칭,매핑 field, 기타옵션 등)
{
header: '분류코드',
name: 'clCode',
width: 100,
sortable: true,
sortingType: 'desc',
align: 'center',
renderer: {
type: CustomButtonRenderer,
options: {
formatter : function(props){
var rowData = props.grid.getRow(props.rowKey);
var obj = {
formatter : rowData.clCode
,element : "text"
}
return obj;
];
const gridDatasource = {
initialRequest: true,
api: {
readData: {
url: '<c:url value="/framework/biz/mng/code/findCodeClassifications.do"/>'
,serializer: (params) => fnAddPageInfo(document.frmSearch, params)
}
,eventFunction: XitClCodeMng_list.fnClickClBtn//function(props){XitClCodeMng_list.fnClickDetail(props)} //function(){alert("1234")}
,eventType : "click"
}
}
},
{
header: '분류코드명',
name: 'clCodeNm',
minWidth: 400,
sortable: false,
align: 'center'
},
{
header: '사용여부',
name: 'useAt',
width: 80,
sortable: false,
align: 'center'
}
]);
var Grid = tui.Grid;
var instance = GridConfig.instance(Grid); //Grid 인스턴스
/* ********************************************************
* 처리결과메시지 출력
******************************************************** */
<c:if test="${!empty message}">alert("${message}");</c:if>
const gridOptions = {
el: 'grid',
rowHeaders: ['rowNum'],
columns: gridColumns,
};
GRID = TuiGrid.of(gridOptions, gridDatasource, (res) => {
});
};
/**************************************************************************
* initialize
**************************************************************************/
$(document).ready(function(){
initGrid();
});
</script>

@ -146,11 +146,8 @@
align: 'left'
}
];
const gridDatasource = { //DataSource
/* -----------------------
* DataSource API Setting
----------------------- */
initialRequest: true, // 화면 load시 조회 안함 - default
const gridDatasource = {
initialRequest: true,
api: {
readData: {
url: '<c:url value="/framework/biz/mng/menu/findPrograms.do"/>'

Loading…
Cancel
Save