소스정리

main
이범준 5 months ago
parent b49f69d66a
commit aa4d1b7f59

@ -3,7 +3,6 @@ package cokr.xit.applib.ogdp.dao;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider; import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update; import org.apache.ibatis.annotations.Update;
@ -140,17 +139,7 @@ public interface OgdpMapper extends AbstractMapper {
"""+SQLUtil.SCRIPT_END) """+SQLUtil.SCRIPT_END)
List<DataObject> selectAllSggList(); List<DataObject> selectAllSggList();
/** .<br />
* @param deptCd
* @return
*/
@Select(SQLUtil.SCRIPT_START+"""
/* 부서에 따른 시군구코드 조회(ogdpMapper.selectSggCdByDeptCd) */
SELECT SGG_CD
FROM TB_DEPT
WHERE DEPT_CD = #{deptCd}
"""+SQLUtil.SCRIPT_END)
String selectSggCdByDeptCd(String deptCd);
/** . /** .
* @param sgg * @param sgg
@ -178,9 +167,6 @@ public interface OgdpMapper extends AbstractMapper {
+SQLUtil.now +SQLUtil.now
+""" +"""
, MDFR = #{sgg.modifiedBy} , MDFR = #{sgg.modifiedBy}
, INST_ZIP = #{sgg.instZipCode} <!-- -->
, INST_ADDR = #{sgg.instAddress} <!-- -->
, INST_DADDR = #{sgg.instDetailAddress} <!-- -->
<if test="sgg.symbolFilepath != null"> <if test="sgg.symbolFilepath != null">
, SYMBOL_FILE_PATH = #{sgg.symbolFilepath} <!-- --> , SYMBOL_FILE_PATH = #{sgg.symbolFilepath} <!-- -->
, SYMBOL_FILE_NM = #{sgg.symbolFilename} <!-- --> , SYMBOL_FILE_NM = #{sgg.symbolFilename} <!-- -->
@ -262,99 +248,6 @@ public interface OgdpMapper extends AbstractMapper {
} }
/** .
* @param deptCds
* @return
*/
default int setStatus(String useYn, String... deptCds) {
DataObject params = params();
params.set("useYn", useYn);
params.set("deptCds", deptCds);
int effected = setStatus(params);
return effected;
}
/** .
* @param params
* <ul><li>"deptCds" - </li>
* <li>"currentUser" - </li>
* </ul>
* @return
*/
@Update(SQLUtil.SCRIPT_START+"""
/* 부서 사용 여부 변경(ogdpMapper.setStatus) */
UPDATE TB_DEPT
SET USE_YN = #{useYn} <!-- -->
, MDFCN_DT =
"""
+SQLUtil.now
+"""
<!-- -->
, MDFR = #{currentUser.id} <!-- -->
WHERE DEPT_CD IN ( <foreach collection="deptCds" item="deptCd" separator=","> #{deptCd} </foreach> )<!-- -->
"""+SQLUtil.SCRIPT_END)
int setStatus(Map<String, ?> params);
@InsertProvider(type=OgdpMapper.class, method="insertDeptProvider")
int insertDept(Map<String, Object> params);
/** .
* @param params
* <ul><li>"dept" - </li>
* <li>"currentUser" - </li>
* </ul>
* @return
*/
public static String insertDeptProvider(Map<String, Object> params) {
String comment = "/* 부서 등록(ogdpMapper.insertDept) */ ";
String insertInto = """
INSERT
INTO TB_DEPT (
DEPT_CD <!-- -->
, SGG_CD <!-- -->
, INST_CD <!-- -->
, DEPT_NM <!-- -->
, DEPT_TELNO <!-- -->
, DEPT_FXNO <!-- -->
, USE_YN <!-- -->
, REG_DT <!-- -->
, RGTR <!-- -->
, MDFCN_DT <!-- -->
, MDFR <!-- -->
""";
String values = """
) VALUES (
#{dept.deptID} <!-- -->
, #{dept.sggID} <!-- -->
, #{dept.instCode} <!-- -->
, #{dept.name} <!-- -->
, #{dept.telno} <!-- -->
, #{dept.faxno} <!-- -->
, 'Y' <!-- -->
,
"""
+SQLUtil.now
+"""
, #{dept.createdBy} <!-- -->
,
"""
+SQLUtil.now
+"""
, #{dept.modifiedBy} <!-- -->
""";
String close = ")";
String insertIntoAdd = params.get("insertIntoAdd") == null ? "" : (String)params.get("insertIntoAdd");
String valuesAdd = params.get("valuesAdd") == null ? "" : (String)params.get("valuesAdd");
return SQLUtil.SCRIPT_START
+ comment
+ insertInto + insertIntoAdd + values + valuesAdd + close
+ SQLUtil.SCRIPT_END;
}
@UpdateProvider(type=OgdpMapper.class, method="updateDeptProvider") @UpdateProvider(type=OgdpMapper.class, method="updateDeptProvider")
@ -368,12 +261,7 @@ public interface OgdpMapper extends AbstractMapper {
String updateSet = """ String updateSet = """
UPDATE TB_DEPT UPDATE TB_DEPT
SET SGG_CD = #{dept.sggID} <!-- --> SET MDFCN_DT =
, INST_CD = #{dept.instCode} <!-- -->
, DEPT_NM = #{dept.name} <!-- -->
, DEPT_TELNO = #{dept.telno} <!-- -->
, DEPT_FXNO = #{dept.faxno} <!-- -->
, MDFCN_DT =
""" """
+SQLUtil.now +SQLUtil.now
+""" +"""

@ -38,9 +38,6 @@ public abstract class AbstractOgdpBean extends AbstractBean {
return ogdpMapper.selectOgdpInfoOfUser(userId); return ogdpMapper.selectOgdpInfoOfUser(userId);
} }
public String selectSggCdByDeptCd(String deptCd) {
return ogdpMapper.selectSggCdByDeptCd(deptCd);
}
/**userInfo ,, . /**userInfo ,, .
* @param userInfo * @param userInfo
@ -89,16 +86,6 @@ public abstract class AbstractOgdpBean extends AbstractBean {
return ogdpMapper.selectSggInfo(req); return ogdpMapper.selectSggInfo(req);
} }
/** .
* @param deptCds
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
public boolean remove(String... deptCds) {
return ogdpMapper.setStatus("N", deptCds) > 0 ? true : false;
}
/** . /** .
@ -113,14 +100,6 @@ public abstract class AbstractOgdpBean extends AbstractBean {
*/ */
public abstract DataObject getDeptInfo(OgdpQuery req); public abstract DataObject getDeptInfo(OgdpQuery req);
/** .
* @param dept
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
public abstract boolean createDept(Department dept);
/** . /** .
* @param dept * @param dept

@ -38,16 +38,7 @@ public class DefaultOgdpBean extends AbstractOgdpBean {
return ogdpMapper.selectDeptInfo(query); return ogdpMapper.selectDeptInfo(query);
} }
@Override
public boolean createDept(Department dept) {
boolean result = dept != null && ogdpMapper.insertDept(
new DataObject()
.set("currentUser", currentUser())
.set("dept", dept)) == 1;
return result;
}
@Override @Override
public boolean updateDept(Department dept) { public boolean updateDept(Department dept) {

Loading…
Cancel
Save