diff --git a/src/main/java/cokr/xit/adds/AddsMapperSupport.java b/src/main/java/cokr/xit/adds/AddsMapperSupport.java index 3c665de..40e300b 100644 --- a/src/main/java/cokr/xit/adds/AddsMapperSupport.java +++ b/src/main/java/cokr/xit/adds/AddsMapperSupport.java @@ -7,16 +7,32 @@ import org.apache.ibatis.executor.Executor; import org.apache.ibatis.mapping.MappedStatement; import org.apache.ibatis.plugin.Intercepts; import org.apache.ibatis.plugin.Signature; +import org.apache.ibatis.session.ResultHandler; +import org.apache.ibatis.session.RowBounds; import cokr.xit.applib.ApplicationContextProvider; import cokr.xit.base.FileController; +import cokr.xit.base.file.service.FileQuery; import cokr.xit.foundation.data.paging.MapperSupport; @Intercepts({ + @Signature(type = Executor.class, method = "query", args = {MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class}), @Signature(type = Executor.class, method = "update", args = {MappedStatement.class, Object.class}) }) public class AddsMapperSupport extends MapperSupport { + @Override + protected Object query(Executor executor, MappedStatement mappedStatement, Object obj, RowBounds rowBounds, ResultHandler resultHandler) throws SQLException { + String id = mappedStatement.getId(); + + if(id.equals("cokr.xit.base.file.dao.FileMapper.getFileList") + || id.equals("cokr.xit.base.file.dao.FileMapper.getFilesOf")) { + FileController addsFileController = (FileController) ApplicationContextProvider.getApplicationContext().getBean("fileController"); + ((FileQuery)obj).setType(addsFileController.getFileRootPath()); + } + return super.query(executor, mappedStatement, obj, rowBounds, resultHandler); + } + @Override protected Object update(Executor executor, MappedStatement mappedStatement, Object obj) throws SQLException { String id = mappedStatement.getId(); diff --git a/src/main/java/cokr/xit/adds/nims/web/AddsNimsController.java b/src/main/java/cokr/xit/adds/nims/web/AddsNimsController.java index d0be8b0..0f7dea4 100644 --- a/src/main/java/cokr/xit/adds/nims/web/AddsNimsController.java +++ b/src/main/java/cokr/xit/adds/nims/web/AddsNimsController.java @@ -15,8 +15,11 @@ import cokr.xit.adds.nims.DsuseMgtDocQuery; import cokr.xit.adds.nims.DsuseMgtReceiptQuery; import cokr.xit.adds.nims.service.DsuseMgtDocService; import cokr.xit.adds.nims.service.DsuseMgtReceiptService; +import cokr.xit.applib.ogdp.OgdpQuery; +import cokr.xit.applib.ogdp.service.bean.DefaultOgdpBean; import cokr.xit.base.code.CommonCode; import cokr.xit.base.web.ApplicationController; +import cokr.xit.foundation.data.DataObject; @Controller @RequestMapping( @@ -27,6 +30,9 @@ public class AddsNimsController extends ApplicationController { @Value("${app.api.host:}") private String apiHost; + @Resource(name="defaultOgdpBean") + DefaultOgdpBean defaultOgdpBean; + @Resource(name="dsuseMgtReceiptService") private DsuseMgtReceiptService dsuseMgtReceiptService; @@ -134,9 +140,13 @@ public class AddsNimsController extends ApplicationController { //------------------------------------------------------------------------------------------------- @RequestMapping(value = "/dsuseMgtReceipt.do", name="신청서 접수 메인") public ModelAndView dsuseMgtReceiptMain() { + ModelAndView mav = new ModelAndView("adds/nims/dsuseMgtReceipt-main"); setCmmCode("ADDS11", mav); + List deptList = defaultOgdpBean.getDeptList(new OgdpQuery()); + mav.addObject("DEPTList", deptList); + return mav .addObject("pageName", "dsuseMgtReceipt") // View(jsp)에서 사용할 id 뒤에 붙일 suffix // .addObject("infoPrefix", "dsuseMgtReceipt") // prefix diff --git a/src/main/resources/sql/mapper/base/code-mapper.xml b/src/main/resources/sql/mapper/base/code-mapper.xml index be27d2b..3934e28 100644 --- a/src/main/resources/sql/mapper/base/code-mapper.xml +++ b/src/main/resources/sql/mapper/base/code-mapper.xml @@ -44,8 +44,8 @@ SELECT * FROM TB_CODE_CTGR - WHERE USE_YN = 'Y' - AND CTGR_ID IN (#{categoryID}) + AND USE_YN = 'Y' + AND CTGR_ID IN (#{categoryID}) @@ -94,9 +94,9 @@ UPDATE TB_CODE_CTGR SET SELECT * FROM TB_CODE_GRP - WHERE USE_YN = 'Y' -AND CTGR_ID IN (#{categoryID}) -AND GRP_ID IN (#{groupID}) + AND USE_YN = 'Y' + AND CTGR_ID IN (#{categoryID}) + AND GRP_ID IN (#{groupID}) @@ -151,9 +151,9 @@ UPDATE TB_CODE_GRP SET SELECT * FROM TB_CMN_CODE - WHERE USE_YN = 'Y' - AND GRP_ID IN (#{groupID}) - AND CODE IN (#{code}) + AND USE_YN = 'Y' + AND GRP_ID IN (#{groupID}) + AND CODE IN (#{code}) diff --git a/src/main/resources/sql/mapper/base/file-mapper.xml b/src/main/resources/sql/mapper/base/file-mapper.xml index dbaafde..9a571ab 100644 --- a/src/main/resources/sql/mapper/base/file-mapper.xml +++ b/src/main/resources/sql/mapper/base/file-mapper.xml @@ -33,12 +33,14 @@ -SELECT A.*, FILE_PATH URL +SELECT A.* + , REPLACE(FILE_PATH,#{type},'/files/') AS URL FROM TB_FILE A WHERE FILE_ID IN (#{fileID}) ORDER BY FILE_ID -SELECT A.*, FILE_PATH URL +SELECT A.* + , REPLACE(FILE_PATH,#{type},'/files/') AS URL FROM TB_FILE A AND A.INF_TYPE = #{infoType} diff --git a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtReceipt-main.jsp b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtReceipt-main.jsp index ad154a1..65f70ee 100644 --- a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtReceipt-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtReceipt-main.jsp @@ -16,9 +16,9 @@ diff --git a/src/main/webapp/WEB-INF/jsp/base/code/code-main.jsp b/src/main/webapp/WEB-INF/jsp/base/code/code-main.jsp index 8284c77..6ac3389 100644 --- a/src/main/webapp/WEB-INF/jsp/base/code/code-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/base/code/code-main.jsp @@ -35,7 +35,7 @@