업무 정보 테이블 관련 java 추가.

main
jjh 1 year ago
parent ebeb4d0b63
commit 2bb66a11b3

@ -0,0 +1,65 @@
package cokr.xit.fims.cmmn;
import cokr.xit.foundation.AbstractEntity;
import lombok.Getter;
import lombok.Setter;
/**
*
* @author JoJH
*/
@Getter
@Setter
public class TaskInfo extends AbstractEntity {
/**
*
*/
private String sggCd;
/**
*
*/
private String taskSeCd;
/**
*
*/
private String taskSeNm;
/**
*
*/
private Integer advntceDaycnt;
/**
*
*/
private String advntceRductRt;
/**
*
*/
private String wksnRductRt;
/**
*
*/
private String ffnlgAdtnYmd;
/**
*
*/
private String ffnlgAdtnRt;
/**
*
*/
private String ffnlgInadtnRt;
/**
*
*/
private Integer ffnlgInadtnMxmmCnt;
}

@ -0,0 +1,19 @@
package cokr.xit.fims.cmmn;
import cokr.xit.foundation.component.QueryRequest;
/**
*
* <p> :
*
* <pre>
* ============ ============
* 2023-10-24 JoJH
* ================================
* </pre>
*/
public class TaskInfoQuery extends QueryRequest {
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,99 @@
package cokr.xit.fims.cmmn.dao;
import java.util.List;
import java.util.Map;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import cokr.xit.foundation.component.AbstractMapper;
import cokr.xit.foundation.data.DataObject;
import cokr.xit.fims.cmmn.TaskInfo;
import cokr.xit.fims.cmmn.TaskInfoQuery;
/** DAO
*
* <p> :
*
* <pre>
* ============ ============
* 2023-10-24 JoJH
* ================================
* </pre>
*/
@Mapper("taskInfoMapper")
public interface TaskInfoMapper extends AbstractMapper {
/** .<br />
* @param req
* @return
*/
List<DataObject> selectTaskInfoList(TaskInfoQuery req);
/** .
* @param req
* @return
*/
List<TaskInfo> selectTaskInfos(TaskInfoQuery req);
/** .
* @param params
* <ul><li>"taskInfo" - </li>
* <li>"currentUser" - </li>
* </ul>
* @return
*/
int insertTaskInfo(Map<String, Object> params);
/** .
* @param taskInfo
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
default boolean insert(TaskInfo taskInfo) {
return taskInfo != null && insertTaskInfo(params().set("taskInfo", taskInfo)) == 1;
}
/** .
* @param params
* <ul><li>"taskInfo" - </li>
* <li>"currentUser" - </li>
* </ul>
* @return
*/
int updateTaskInfo(Map<String, Object> params);
/** .
* @param taskInfo
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
default boolean update(TaskInfo taskInfo) {
return taskInfo != null && updateTaskInfo(params().set("taskInfo", taskInfo)) == 1;
}
/** .
* @param params
* <ul><li>"taskInfo" - </li>
* <li>"currentUser" - </li>
* </ul>
* @return
*/
int deleteTaskInfo(Map<String, ?> params);
/** .
* @param taskInfo
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
default boolean delete(TaskInfo taskInfo) {
return taskInfo != null && deleteTaskInfo(params().set("taskInfo", taskInfo)) == 1;
}
}

@ -0,0 +1,61 @@
package cokr.xit.fims.cmmn.service;
import java.util.List;
import cokr.xit.foundation.data.DataObject;
import cokr.xit.fims.cmmn.TaskInfo;
import cokr.xit.fims.cmmn.TaskInfoQuery;
/** .
*
* <p> :
*
* <pre>
* ============ ============
* 2023-10-24 mjkhan
* ================================
* </pre>
*/
public interface TaskInfoService {
/** .
* @param req
* @return
*/
List<DataObject> getTaskInfoList(TaskInfoQuery req);
/** .
* @param req
* @return
*/
List<TaskInfo> getTaskInfos(TaskInfoQuery req);
/** .
* @param taskInfo
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
boolean create(TaskInfo taskInfo);
/** .
* @param taskInfo
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
boolean update(TaskInfo taskInfo);
/** .
* @param taskInfo
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
boolean remove(TaskInfo taskInfo);
}

@ -0,0 +1,82 @@
package cokr.xit.fims.cmmn.service.bean;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
import cokr.xit.foundation.AbstractComponent;
import cokr.xit.foundation.data.DataObject;
import cokr.xit.fims.cmmn.TaskInfo;
import cokr.xit.fims.cmmn.TaskInfoQuery;
import cokr.xit.fims.cmmn.dao.TaskInfoMapper;
/** Bean
*
* <p> :
*
* <pre>
* ============ ============
* 2023-10-24 JoJH
* ================================
* </pre>
*/
@Component("taskInfoBean")
public class TaskInfoBean extends AbstractComponent {
/** 업무 정보 정보 DAO */
@Resource(name = "taskInfoMapper")
private TaskInfoMapper taskInfoMapper;
/** .
* @param req
* @return
*/
public List<DataObject> getTaskInfoList(TaskInfoQuery req) {
return taskInfoMapper.selectTaskInfoList(req);
}
/** .
* @param req
* @return
*/
public List<TaskInfo> getTaskInfos(TaskInfoQuery req) {
return taskInfoMapper.selectTaskInfos(req);
}
/** .
* @param taskInfo
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
public boolean create(TaskInfo taskInfo) {
return taskInfoMapper.insert(taskInfo);
}
/** .
* @param taskInfo
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
public boolean update(TaskInfo taskInfo) {
return taskInfoMapper.update(taskInfo);
}
/** .
* @param taskInfo
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
public boolean remove(TaskInfo taskInfo) {
return taskInfoMapper.delete(taskInfo);
}
}

@ -0,0 +1,58 @@
package cokr.xit.fims.cmmn.service.bean;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.foundation.data.DataObject;
import cokr.xit.fims.cmmn.TaskInfo;
import cokr.xit.fims.cmmn.TaskInfoQuery;
import cokr.xit.fims.cmmn.service.TaskInfoService;
/** .
*
* <p> :
*
* <pre>
* ============ ============
* 2023-10-24 JoJH
* ================================
* </pre>
*/
@Service("taskInfoService")
public class TaskInfoServiceBean extends AbstractServiceBean implements TaskInfoService {
/** 업무 정보 정보 Bean */
@Resource(name = "taskInfoBean")
private TaskInfoBean taskInfoBean;
@Override
public List<DataObject> getTaskInfoList(TaskInfoQuery req) {
return taskInfoBean.getTaskInfoList(req);
}
@Override
public List<TaskInfo> getTaskInfos(TaskInfoQuery req) {
return taskInfoBean.getTaskInfos(req);
}
@Override
public boolean create(TaskInfo taskInfo) {
return taskInfoBean.create(taskInfo);
}
@Override
public boolean update(TaskInfo taskInfo) {
return taskInfoBean.update(taskInfo);
}
@Override
public boolean remove(TaskInfo taskInfo) {
return taskInfoBean.remove(taskInfo);
}
}

@ -0,0 +1,105 @@
package cokr.xit.fims.cmmn.web;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import cokr.xit.foundation.web.AbstractController;
import cokr.xit.fims.cmmn.TaskInfo;
import cokr.xit.fims.cmmn.TaskInfoQuery;
import cokr.xit.fims.cmmn.service.TaskInfoService;
/**
*
* <p> :
*
* <pre>
* ============ ============
* 2023-10-24 mjkhan
* ================================
* </pre>
*/
@RequestMapping(name = "업무 정보", value = "/taskInfo")
public class TaskInfoController extends AbstractController {
/**업무 정보 서비스*/
@Resource(name = "taskInfoService")
private TaskInfoService taskInfoService;
/** (taskInfo/taskInfo-main) .
* {@link #getTaskInfoList(TaskInfoQuery) } .
* @return /taskInfo/taskInfo-main
*/
@RequestMapping(name = "업무 정보 메인", value = "/main.do")
public ModelAndView main() {
ModelAndView mav = getTaskInfoList(new TaskInfoQuery().setPageNum(1));
mav.setViewName("/taskInfo/taskInfo-main");
return mav.addObject("taskInfoList", toJson(mav.getModel().get("taskInfoList")));
}
/** .<br />
* {@link TaskInfoService#getTaskInfoList(TaskInfoQuery)}
* @param req
* @return jsonView
* <pre><code> {
* "taskInfoList": [ ]
* "taskInfoStart":
* "taskInfoFetch":
* "taskInfoTotal":
* }</code></pre>
*/
@RequestMapping(name = "업무 정보 조회", value = "/list.do")
public ModelAndView getTaskInfoList(TaskInfoQuery req) {
List<?> result = taskInfoService.getTaskInfoList(setFetchSize(req));
return setCollectionInfo(new ModelAndView("jsonView"), result, "taskInfo");
}
/** .
* @param taskInfo
* @return jsonView
* <pre><code> {
* "saved": true, false
* }</code></pre>
*/
@PostMapping(name = "업무 정보 등록", value = "/create.do")
public ModelAndView create(TaskInfo taskInfo) {
boolean saved = taskInfoService.create(taskInfo);
return new ModelAndView("jsonView")
.addObject("saved", saved);
}
/** .
* @param taskInfo
* @return jsonView
* <pre><code> {
* "saved": true, false
* }</code></pre>
*/
@PostMapping(name = "업무 정보 수정", value = "/update.do")
public ModelAndView update(TaskInfo taskInfo) {
boolean saved = taskInfoService.update(taskInfo);
return new ModelAndView("jsonView")
.addObject("saved", saved);
}
/** .
* @param taskInfoIDs
* @return jsonView
* <pre><code> {
* "affected":
* "saved": true, false
* }</code></pre>
*/
@PostMapping(name = "업무 정보 제거", value = "/remove.do")
public ModelAndView remove(TaskInfo taskInfo) {
boolean saved = taskInfoService.remove(taskInfo);
return new ModelAndView("jsonView")
.addObject("saved", saved);
}
}

@ -0,0 +1,125 @@
<?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="cokr.xit.fims.cmmn.dao.TaskInfoMapper">
<!-- 업무 정보 정보 매퍼
========== 변경 이력 ==========
2023-10-24 JoJH 최초 작성
============================ -->
<resultMap id="taskInfoRow" type="cokr.xit.fims.cmmn.TaskInfo">
<result property="sggCd" column="SGG_CD" /> <!-- 시군구 코드 -->
<result property="taskSeCd" column="TASK_SE_CD" /> <!-- 업무 구분 코드 -->
<result property="taskSeNm" column="TASK_SE_NM" /> <!-- 업무 구분 명 -->
<result property="advntceDaycnt" column="ADVNTCE_DAYCNT" /> <!-- 사전통지 일수 -->
<result property="advntceRductRt" column="ADVNTCE_RDUCT_RT" /> <!-- 사전통지 감경 율 -->
<result property="wksnRductRt" column="WKSN_RDUCT_RT" /> <!-- 사회적약자 감경 율 -->
<result property="ffnlgAdtnYmd" column="FFNLG_ADTN_YMD" /> <!-- 과태료 가산 일자 -->
<result property="ffnlgAdtnRt" column="FFNLG_ADTN_RT" /> <!-- 과태료 가산 율 -->
<result property="ffnlgInadtnRt" column="FFNLG_INADTN_RT" /> <!-- 과태료 중가산 율 -->
<result property="ffnlgInadtnMxmmCnt" column="FFNLG_INADTN_MXMM_CNT" /> <!-- 과태료 중가산 최대 수 -->
<result property="useYN" column="USE_YN" /> <!-- 사용 여부 -->
<result property="createdAt" column="REG_DT" /> <!-- 등록 일시 -->
<result property="createdBy" column="RGTR" /> <!-- 등록자 -->
<result property="lastModified" column="MDFCN_DT" /> <!-- 수정 일시 -->
<result property="modifiedBy" column="MDFR" /> <!-- 수정자 -->
</resultMap>
<sql id="select">
SELECT SGG_CD <!-- 시군구 코드 -->
, TASK_SE_CD <!-- 업무 구분 코드 -->
, TASK_SE_NM <!-- 업무 구분 명 -->
, ADVNTCE_DAYCNT <!-- 사전통지 일수 -->
, ADVNTCE_RDUCT_RT <!-- 사전통지 감경 율 -->
, WKSN_RDUCT_RT <!-- 사회적약자 감경 율 -->
, FFNLG_ADTN_YMD <!-- 과태료 가산 일자 -->
, FFNLG_ADTN_RT <!-- 과태료 가산 율 -->
, FFNLG_INADTN_RT <!-- 과태료 중가산 율 -->
, FFNLG_INADTN_MXMM_CNT <!-- 과태료 중가산 최대 수 -->
, USE_YN <!-- 사용 여부 -->
, REG_DT <!-- 등록 일시 -->
, RGTR <!-- 등록자 -->
, MDFCN_DT <!-- 수정 일시 -->
, MDFR <!-- 수정자 -->
FROM TB_TASK_INFO
</sql>
<select id="selectTaskInfoList" parameterType="map" resultType="dataobject">/* 업무 정보 목록 조회(taskInfoMapper.selectTaskInfoList) */
<include refid="utility.paging-prefix" />
<include refid="select" />
<where></where>
<include refid="utility.orderBy" />
<include refid="utility.paging-suffix" />
</select>
<select id="selectTaskInfos" parameterType="map" resultMap="taskInfoRow">/* 업무 정보 객체 가져오기(taskInfoMapper.selectTaskInfos) */
<include refid="select" />
<where></where>
<include refid="utility.orderBy" />
</select>
<insert id="insertTaskInfo" parameterType="map">/* 업무 정보 등록(taskInfoMapper.insertTaskInfo) */
INSERT
INTO TB_TASK_INFO (
SGG_CD <!-- 시군구 코드 -->
, TASK_SE_CD <!-- 업무 구분 코드 -->
, TASK_SE_NM <!-- 업무 구분 명 -->
, ADVNTCE_DAYCNT <!-- 사전통지 일수 -->
, ADVNTCE_RDUCT_RT <!-- 사전통지 감경 율 -->
, WKSN_RDUCT_RT <!-- 사회적약자 감경 율 -->
, FFNLG_ADTN_YMD <!-- 과태료 가산 일자 -->
, FFNLG_ADTN_RT <!-- 과태료 가산 율 -->
, FFNLG_INADTN_RT <!-- 과태료 중가산 율 -->
, FFNLG_INADTN_MXMM_CNT <!-- 과태료 중가산 최대 수 -->
, USE_YN <!-- 사용 여부 -->
, REG_DT <!-- 등록 일시 -->
, RGTR <!-- 등록자 -->
, MDFCN_DT <!-- 수정 일시 -->
, MDFR <!-- 수정자 -->
)
VALUES (
#{taskInfo.sggCd} <!-- 시군구 코드 -->
, #{taskInfo.taskSeCd} <!-- 업무 구분 코드 -->
, #{taskInfo.taskSeNm} <!-- 업무 구분 명 -->
, #{taskInfo.advntceDaycnt} <!-- 사전통지 일수 -->
, #{taskInfo.advntceRductRt} <!-- 사전통지 감경 율 -->
, #{taskInfo.wksnRductRt} <!-- 사회적약자 감경 율 -->
, #{taskInfo.ffnlgAdtnYmd} <!-- 과태료 가산 일자 -->
, #{taskInfo.ffnlgAdtnRt} <!-- 과태료 가산 율 -->
, #{taskInfo.ffnlgInadtnRt} <!-- 과태료 중가산 율 -->
, #{taskInfo.ffnlgInadtnMxmmCnt} <!-- 과태료 중가산 최대 수 -->
, #{taskInfo.useYN} <!-- 사용 여부 -->
, <include refid="utility.now" /> <!-- 등록 일시 -->
, #{currentUser.id} <!-- 등록자 -->
, <include refid="utility.now" /> <!-- 수정 일시 -->
, #{currentUser.id} <!-- 수정자 -->
)
</insert>
<update id="updateTaskInfo" parameterType="map">/* 업무 정보 수정(taskInfoMapper.updateTaskInfo) */
UPDATE TB_TASK_INFO
SET TASK_SE_NM = #{taskInfo.taskSeNm} <!-- 업무 구분 명 -->
, ADVNTCE_DAYCNT = #{taskInfo.advntceDaycnt} <!-- 사전통지 일수 -->
, ADVNTCE_RDUCT_RT = #{taskInfo.advntceRductRt} <!-- 사전통지 감경 율 -->
, WKSN_RDUCT_RT = #{taskInfo.wksnRductRt} <!-- 사회적약자 감경 율 -->
, FFNLG_ADTN_YMD = #{taskInfo.ffnlgAdtnYmd} <!-- 과태료 가산 일자 -->
, FFNLG_ADTN_RT = #{taskInfo.ffnlgAdtnRt} <!-- 과태료 가산 율 -->
, FFNLG_INADTN_RT = #{taskInfo.ffnlgInadtnRt} <!-- 과태료 중가산 율 -->
, FFNLG_INADTN_MXMM_CNT = #{taskInfo.ffnlgInadtnMxmmCnt} <!-- 과태료 중가산 최대 수 -->
, USE_YN = #{taskInfo.useYN} <!-- 사용 여부 -->
, MDFCN_DT = <include refid="utility.now" /> <!-- 수정 일시 -->
, MDFR = #{currentUser.id} <!-- 수정자 -->
WHERE SGG_CD = #{taskInfo.sggCd}
AND TASK_SE_CD = #{taskInfo.taskSeCd}
</update>
<update id="deleteTaskInfo" parameterType="map">/* 업무 정보 삭제(taskInfoMapper.deleteTaskInfo) */
UPDATE TB_TASK_INFO SET
USE_YN = 'N'
, MDFCN_DT =<include refid="utility.now" />
, MDFR = #{currentUser.id}
WHERE SGG_CD = #{taskInfo.sggCd}
AND TASK_SE_CD = #{taskInfo.taskSeCd}
</update>
</mapper>
Loading…
Cancel
Save