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 4a4b844..23cdc1c 100644 --- a/src/main/java/cokr/xit/adds/nims/web/AddsNimsController.java +++ b/src/main/java/cokr/xit/adds/nims/web/AddsNimsController.java @@ -930,6 +930,7 @@ public class AddsNimsController extends ApplicationController { Format format = new Format(xlsx); CellStyle center = format.cellStyle(Style.CENTER); CellStyle right = format.cellStyle(Style.RIGHT); + CellStyle numeric = format.cellStyle(Style.N_NN0); List list = addsNimsService.getDsuseMgtNcrdAndPrtmStatistics(query); @@ -941,12 +942,11 @@ public class AddsNimsController extends ApplicationController { valueMap.put("향정", a_slash_b(format, "향정", "향정Qy").style(right)); valueMap.put("향정제외", a_slash_b(format, "향정제외", "향정제외Qy").style(right)); valueMap.put("기타", a_slash_b(format, "기타", "기타Qy").style(right)); - valueMap.put("마약향정계", a_slash_b(format, "마약향정계", "마약향정계Qy").style(right)); valueMap.put("비마약류", a_slash_b(format, "비마약류", "비마약류Qy").style(right)); valueMap.put("일반관리대상", a_slash_b(format, "일반관리대상", "일반관리대상Qy").style(right)); valueMap.put("중점관리대상", a_slash_b(format, "중점관리대상", "중점관리대상Qy").style(right)); - valueMap.put("중점일반계", a_slash_b(format, "중점일반계", "중점일반계Qy").style(right)); - + valueMap.put("폐기건수", format.of("dsuseCnt").style(numeric)); + valueMap.put("폐기수량", format.of("dsuseQy").style(numeric)); CellDef.setValues(cellDefs, valueMap); Style headerStyle = new Style().foregroundColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex()) @@ -965,10 +965,12 @@ public class AddsNimsController extends ApplicationController { xlsx.cell(0, 1).value("마약류 제품 구분별 현황").value(center).merge(1, cellDefs.size()-1); // 관할관청 - rowspan xlsx.cell(2, 0).value("관할관청").value(headerStyle).merge(2, 3, 0, 0); - xlsx.cell(2, 1).value("마약/향정 구분(폐기건수 / 폐기수량)").value(headerStyle2).merge(1, 7); - xlsx.cell(2, 8).value("중점/일반 구분(폐기건수 / 폐기수량)").value(headerStyle2).merge(8, 11); + xlsx.cell(2, 1).value("마약/향정 구분(폐기건수 / 폐기수량)").value(headerStyle2).merge(1, 6); + xlsx.cell(2, 7).value("중점/일반 구분(폐기건수 / 폐기수량)").value(headerStyle2).merge(7, 9); + xlsx.cell(2, 10).value("폐기건수").value(headerStyle).merge(2, 3, 10, 10); + xlsx.cell(2, 11).value("폐기수량").value(headerStyle).merge(2, 3, 11, 11); - List cellDefs2 = cellDefs.subList(1, cellDefs.size()); + List cellDefs2 = cellDefs.subList(1, cellDefs.size()-2); xlsx.cell(3, 1).rowValues(CellDef.header(cellDefs2, () -> StyleMaker.headerStyle(xlsx))); // data xlsx.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); diff --git a/src/main/resources/sql/mapper/adds/nims/dsuseMgtStatistics-mapper.xml b/src/main/resources/sql/mapper/adds/nims/dsuseMgtStatistics-mapper.xml index 7fcc5ae..f1b6767 100644 --- a/src/main/resources/sql/mapper/adds/nims/dsuseMgtStatistics-mapper.xml +++ b/src/main/resources/sql/mapper/adds/nims/dsuseMgtStatistics-mapper.xml @@ -6,6 +6,10 @@ /* 마약/항정 and 중점/일반 별 통계 */ WITH tgt AS ( SELECT tdm.dept_cd + , tdm.dscdmng_id + , tpi.nrcd_se_nm + , tpi.prtm_se_nm + , tdmd.dsuse_qy , IF(tpi.nrcd_se_nm = '대마', 1, '0') AS 대마 , IF(tpi.nrcd_se_nm = '마약', 1, '0') AS 마약 , IF(tpi.nrcd_se_nm = '한외마약', 1, '0') AS 한외마약 @@ -46,54 +50,50 @@ , IF(td.dept_nm IS NULL, T.dept_cd, dept_nm) AS dept_nm FROM ( SELECT tgt.dept_cd + , COUNT(tgt.dscdmng_id) AS dsuseCnt + , SUM(tgt.dsuse_qy) AS dsuseQy , SUM(tgt.대마) AS 대마 , SUM(tgt.마약) AS 마약 , SUM(tgt.한외마약) AS 한외마약 , SUM(tgt.향정) AS 향정 , SUM(tgt.향정제외) AS 향정제외 , SUM(tgt.기타) AS 기타 - , SUM(tgt.대마 + tgt.마약 + tgt.한외마약 + tgt.향정 + tgt.향정제외 + tgt.기타) AS 마약향정계 , SUM(tgt.비마약류) AS 비마약류 , SUM(tgt.일반관리대상) AS 일반관리대상 , SUM(tgt.중점관리대상) AS 중점관리대상 - , SUM(tgt.비마약류 + tgt.일반관리대상 + tgt.중점관리대상) AS 중점일반계 , SUM(tgt.대마qy) AS 대마qy , SUM(tgt.마약qy) AS 마약qy , SUM(tgt.한외마약qy) AS 한외마약qy , SUM(tgt.향정qy) AS 향정qy , SUM(tgt.향정제외qy) AS 향정제외qy , SUM(tgt.기타qy) AS 기타qy - , SUM(tgt.대마qy + tgt.마약qy + tgt.한외마약qy + tgt.향정qy + tgt.향정제외qy + tgt.기타qy) AS 마약향정계qy , SUM(tgt.비마약류qy) AS 비마약류qy , SUM(tgt.일반관리대상qy) AS 일반관리대상qy , SUM(tgt.중점관리대상qy) AS 중점관리대상qy - , SUM(tgt.비마약류qy + tgt.일반관리대상qy + tgt.중점관리대상qy) AS 중점일반계qy FROM tgt GROUP BY tgt.dept_cd UNION ALL SELECT 'TOTAL' AS dept_cd + , COUNT(tgt.dscdmng_id) AS dsuseCnt + , SUM(tgt.dsuse_qy) AS dsuseQy , SUM(tgt.대마) AS 대마 , SUM(tgt.마약) AS 마약 , SUM(tgt.한외마약) AS 한외마약 , SUM(tgt.향정) AS 향정 , SUM(tgt.향정제외) AS 향정제외 , SUM(tgt.기타) AS 기타 - , SUM(tgt.대마 + tgt.마약 + tgt.한외마약 + tgt.향정 + tgt.향정제외 + tgt.기타) AS 마약향정계 , SUM(tgt.비마약류) AS 비마약류 , SUM(tgt.일반관리대상) AS 일반관리대상 , SUM(tgt.중점관리대상) AS 중점관리대상 - , SUM(tgt.비마약류 + tgt.일반관리대상 + tgt.중점관리대상) AS 중점일반계 , SUM(tgt.대마qy) AS 대마qy , SUM(tgt.마약qy) AS 마약qy , SUM(tgt.한외마약qy) AS 한외마약qy , SUM(tgt.향정qy) AS 향정qy , SUM(tgt.향정제외qy) AS 향정제외qy , SUM(tgt.기타qy) AS 기타qy - , SUM(tgt.대마qy + tgt.마약qy + tgt.한외마약qy + tgt.향정qy + tgt.향정제외qy + tgt.기타qy) AS 마약향정계qy , SUM(tgt.비마약류qy) AS 비마약류qy , SUM(tgt.일반관리대상qy) AS 일반관리대상qy , SUM(tgt.중점관리대상qy) AS 중점관리대상qy - , SUM(tgt.비마약류qy + tgt.일반관리대상qy + tgt.중점관리대상qy) AS 중점일반계qy FROM tgt ) T LEFT JOIN tb_dept td diff --git a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtNcrdAndPrtmStatistics-main.jsp b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtNcrdAndPrtmStatistics-main.jsp index 6ac8c77..19c06f5 100644 --- a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtNcrdAndPrtmStatistics-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtNcrdAndPrtmStatistics-main.jsp @@ -87,8 +87,10 @@ 관할관청 - 마약 / 향정 구분 (폐기건수 / 폐기수량) - 중점 / 일반 구분 (폐기건수 / 폐기수량) + 마약 / 향정 구분 (폐기건수 / 폐기수량) + 중점 / 일반 구분 (폐기건수 / 폐기수량) + 폐기건수 + 폐기수량 @@ -98,11 +100,9 @@ 향정 향정제외 기타 - 마약향정계 비마약류 일반관리대상 중점관리대상 - 중점일반계 @@ -116,11 +116,11 @@ {향정} / {향정qy} {향정제외} / {향정제외qy} {기타} / {기타qy} - {마약향정계} / {마약향정계qy} {비마약류} / {비마약류qy} {일반관리대상} / {일반관리대상qy} {중점관리대상} / {중점관리대상qy} - {중점일반계} / {중점일반계qy} + {dsuseCnt} + {dsuseQy}