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 02369a9..7fcc5ae 100644 --- a/src/main/resources/sql/mapper/adds/nims/dsuseMgtStatistics-mapper.xml +++ b/src/main/resources/sql/mapper/adds/nims/dsuseMgtStatistics-mapper.xml @@ -6,16 +6,24 @@ /* 마약/항정 and 중점/일반 별 통계 */ WITH tgt AS ( SELECT tdm.dept_cd - , IF(tpi.nrcd_se_nm = '대마', '1', '0') AS 대마 - , IF(tpi.nrcd_se_nm = '마약', '1', '0') AS 마약 - , IF(tpi.nrcd_se_nm = '한외마약', '1', '0') AS 한외마약 - , IF(tpi.nrcd_se_nm = '향정', '1', '0') AS 향정 - , IF(tpi.nrcd_se_nm = '향정제외', '1', '0') AS 향정제외 - , IF(tpi.nrcd_se_nm IS NULL, '1', '0') AS 기타 + , IF(tpi.nrcd_se_nm = '대마', 1, '0') AS 대마 + , IF(tpi.nrcd_se_nm = '마약', 1, '0') AS 마약 + , IF(tpi.nrcd_se_nm = '한외마약', 1, '0') AS 한외마약 + , IF(tpi.nrcd_se_nm = '향정', 1, '0') AS 향정 + , IF(tpi.nrcd_se_nm = '향정제외', 1, '0') AS 향정제외 + , IF(tpi.nrcd_se_nm IS NULL, 1, '0') AS 기타 , IF(tpi.prtm_se_nm = '비마약류', 1, 0) AS 비마약류 , IF(tpi.prtm_se_nm = '일반관리대상', 1, 0) AS 일반관리대상 , IF(tpi.prtm_se_nm = '중점관리대상', 1, 0) AS 중점관리대상 - , COUNT(tpi.prduct_cd) OVER(PARTITION BY tdm.dept_cd) AS TOTAL + , IF(tpi.nrcd_se_nm = '대마', tdmd.dsuse_qy, '0') AS 대마qy + , IF(tpi.nrcd_se_nm = '마약', tdmd.dsuse_qy, '0') AS 마약qy + , IF(tpi.nrcd_se_nm = '한외마약', tdmd.dsuse_qy, '0') AS 한외마약qy + , IF(tpi.nrcd_se_nm = '향정', tdmd.dsuse_qy, '0') AS 향정qy + , IF(tpi.nrcd_se_nm = '향정제외', tdmd.dsuse_qy, '0') AS 향정제외qy + , IF(tpi.nrcd_se_nm IS NULL, tdmd.dsuse_qy, '0') AS 기타qy + , IF(tpi.prtm_se_nm = '비마약류', tdmd.dsuse_qy, 0) AS 비마약류qy + , IF(tpi.prtm_se_nm = '일반관리대상', tdmd.dsuse_qy, 0) AS 일반관리대상qy + , IF(tpi.prtm_se_nm = '중점관리대상', tdmd.dsuse_qy, 0) AS 중점관리대상qy FROM tb_dsuse_mgt tdm JOIN tb_dsuse_mgt_dtl tdmd ON tdm.dscdmng_id = tdmd.dscdmng_id JOIN tb_prduct_info tpi ON tdmd.prduct_cd = tpi.prduct_cd @@ -49,6 +57,17 @@ , 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 @@ -64,6 +83,17 @@ , 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 @@ -82,6 +112,10 @@ , IF(tdm.prgrs_stts_cd = '06', 1, 0) AS rslt , IF(tdm.prgrs_stts_cd = '21', 1, 0) AS mapping , IF(tdm.prgrs_stts_cd = '99', 1, 0) AS cplt + , IF(tdm.prgrs_stts_cd = '01', tdmd.dsuse_qy, 0) AS receiptQy + , IF(tdm.prgrs_stts_cd = '06', tdmd.dsuse_qy, 0) AS rsltQy + , IF(tdm.prgrs_stts_cd = '21', tdmd.dsuse_qy, 0) AS mappingQy + , IF(tdm.prgrs_stts_cd = '99', tdmd.dsuse_qy, 0) AS cpltQy FROM tb_dsuse_mgt tdm JOIN tb_dsuse_mgt_dtl tdmd ON tdm.dscdmng_id = tdmd.dscdmng_id @@ -102,7 +136,6 @@ ) SELECT T.* - -- , ROW_NUMBER() over (order by prduct_nm) AS ROW_NUM , ROW_NUMBER() OVER (ORDER BY T.dept_cd, T.prduct_nm, T.prduct_cd) AS ROW_NUM , IF(td.dept_nm IS NULL, T.dept_cd, dept_nm) AS dept_nm FROM ( @@ -113,6 +146,10 @@ , SUM(tgt.rslt) AS rsltCnt , SUM(tgt.mapping) AS mappingCnt , SUM(tgt.cplt) AS cpltCnt + , SUM(tgt.receiptQy) AS receiptQy + , SUM(tgt.rsltQy) AS rsltQy + , SUM(tgt.mappingQy) AS mappingQy + , SUM(tgt.cpltQy) AS cpltQy , COUNT(tgt.dscdmng_id) AS dsuseCnt , SUM(tgt.dsuse_qy) AS dsuseQy FROM tgt @@ -125,6 +162,10 @@ , SUM(tgt.rslt) AS rsltCnt , SUM(tgt.mapping) AS mappingCnt , SUM(tgt.cplt) AS cpltCnt + , SUM(tgt.receiptQy) AS receiptQy + , SUM(tgt.rsltQy) AS rsltQy + , SUM(tgt.mappingQy) AS mappingQy + , SUM(tgt.cpltQy) AS cpltQy , count(tgt.dscdmng_id) AS dsuseCnt , sum(tgt.dsuse_qy) AS dsuseQy FROM tgt @@ -149,6 +190,13 @@ , IF(tbi.induty_nm = '마약류제조업', 1, 0) AS 마약류제조업 , IF(tbi.induty_nm = '마약류취급의료업', 1, 0) AS 마약류취급의료업 , IF(tbi.induty_nm = '마약류취급학술연구', 1, 0) AS 마약류취급학술연구 + , IF(tbi.induty_nm = '마약류도매업', tdmd.dsuse_qy, 0) AS 마약류도매업Qy + , IF(tbi.induty_nm = '마약류소매업', tdmd.dsuse_qy, 0) AS 마약류소매업Qy + , IF(tbi.induty_nm = '마약류수출입업', tdmd.dsuse_qy, 0) AS 마약류수출입업Qy + , IF(tbi.induty_nm = '마약류원료사용', tdmd.dsuse_qy, 0) AS 마약류원료사용Qy + , IF(tbi.induty_nm = '마약류제조업', tdmd.dsuse_qy, 0) AS 마약류제조업Qy + , IF(tbi.induty_nm = '마약류취급의료업', tdmd.dsuse_qy, 0) AS 마약류취급의료업Qy + , IF(tbi.induty_nm = '마약류취급학술연구', tdmd.dsuse_qy, 0) AS 마약류취급학술연구Qy FROM tb_dsuse_mgt tdm JOIN tb_dsuse_mgt_dtl tdmd ON tdm.dscdmng_id = tdmd.dscdmng_id @@ -180,7 +228,13 @@ , SUM(tgt.마약류제조업) AS 마약류제조업 , SUM(tgt.마약류취급의료업) AS 마약류취급의료업 , SUM(tgt.마약류취급학술연구) AS 마약류취급학술연구 - -- , SUM(tgt.마약류도매업 + tgt.마약류소매업 + tgt.마약류수출입업 + tgt.마약류원료사용 + 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) AS 마약류취급학술연구Qy , COUNT(tgt.dscdmng_id) as dsuseCnt , SUM(tgt.dsuse_qy) as dsuseQy FROM tgt @@ -194,7 +248,13 @@ , SUM(tgt.마약류제조업) AS 마약류제조업 , SUM(tgt.마약류취급의료업) AS 마약류취급의료업 , SUM(tgt.마약류취급학술연구) AS 마약류취급학술연구 - -- , SUM(tgt.마약류도매업 + tgt.마약류소매업 + tgt.마약류수출입업 + tgt.마약류원료사용 + 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) AS 마약류취급학술연구Qy , COUNT(tgt.dscdmng_id) AS dsuseCnt , SUM(tgt.dsuse_qy) AS dsuseQy FROM tgt @@ -217,6 +277,10 @@ , IF(tdm.prgrs_stts_cd = '06', 1, 0) AS rslt , IF(tdm.prgrs_stts_cd = '21', 1, 0) AS mapping , IF(tdm.prgrs_stts_cd = '99', 1, 0) AS cplt + , IF(tdm.prgrs_stts_cd = '01', tdmd.dsuse_qy, 0) AS receiptQy + , IF(tdm.prgrs_stts_cd = '06', tdmd.dsuse_qy, 0) AS rsltQy + , IF(tdm.prgrs_stts_cd = '21', tdmd.dsuse_qy, 0) AS mappingQy + , IF(tdm.prgrs_stts_cd = '99', tdmd.dsuse_qy, 0) AS cpltQy FROM tb_dsuse_mgt tdm JOIN tb_dsuse_mgt_dtl tdmd ON tdm.dscdmng_id = tdmd.dscdmng_id @@ -248,6 +312,10 @@ , SUM(tgt.rslt) AS rsltCnt , SUM(tgt.mapping) AS mappingCnt , SUM(tgt.cplt) AS cpltCnt + , SUM(tgt.receiptQy) AS receiptQy + , SUM(tgt.rsltQy) AS rsltQy + , SUM(tgt.mappingQy) AS mappingQy + , SUM(tgt.cpltQy) AS cpltQy , COUNT(tgt.dscdmng_id) AS dsuseCnt , SUM(tgt.dsuse_qy) AS dsuseQy FROM tgt @@ -261,6 +329,10 @@ , SUM(tgt.rslt) AS rsltCnt , SUM(tgt.mapping) AS mappingCnt , SUM(tgt.cplt) AS cpltCnt + , SUM(tgt.receiptQy) AS receiptQy + , SUM(tgt.rsltQy) AS rsltQy + , SUM(tgt.mappingQy) AS mappingQy + , SUM(tgt.cpltQy) AS cpltQy , count(tgt.dscdmng_id) AS dsuseCnt , sum(tgt.dsuse_qy) AS dsuseQy FROM tgt diff --git a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtDsuseQyByBsshStatistics-main.jsp b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtDsuseQyByBsshStatistics-main.jsp index 81c1b0f..0c08f4b 100644 --- a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtDsuseQyByBsshStatistics-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtDsuseQyByBsshStatistics-main.jsp @@ -88,16 +88,16 @@
관할관청 | +업종별 구분 (폐기건수 / 폐기수량) | +폐기건수 | +폐기수량 | +|||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
관할관청 | 마약류취급의료업 | 마약류소매업 | 마약류도매업 | @@ -92,8 +97,6 @@마약류수출입업 | 마약류원료사용 | 마약류취급학술연구 | -폐기건수 | -폐기수량 | ||||||||||||||
{dept_nm} | -{마약류취급의료업} | -{마약류소매업} | -{마약류도매업} | -{마약류제조업} | -{마약류수출입업} | -{마약류원료사용} | -{마약류취급학술연구} | +{마약류취급의료업} / {마약류취급의료업Qy} | +{마약류소매업} / {마약류소매업Qy} | +{마약류도매업} / {마약류도매업Qy} | +{마약류제조업} / {마약류제조업Qy} | +{마약류수출입업} / {마약류수출입업Qy} | +{마약류원료사용} / {마약류원료사용Qy} | +{마약류취급학술연구} / {마약류취급학술연구Qy} | {dsuseCnt} | {dsuseQy} | ||||||
NO. | 관할관청 | -제품명 | 제품코드 | -처리상태별 건수 | +제품명 | +처리상태 별 (폐기건수 / 폐기수량) | 폐기건수 | 폐기수량 | ||||||||||||||
접수건수 | -결과처리건수 | -보고확인건수 | -완료건수 | +신청서접수 | +결과[통보]처리 | +폐기보고확인 | +보고완료 | |||||||||||||||
{ROW_NUM} | {dept_nm} | -{prduct_nm} | {prduct_cd} | -{receiptCnt} | -{rsltCnt} | -{mappingCnt} | -{cpltCnt} | +{prduct_nm} | +{receiptCnt} / {receiptQy} | +{rsltCnt} / {rsltQy} | +{mappingCnt} / {mappingQy} | +{cpltCnt} / {cpltQy} | {dsuseCnt} | {dsuseQy} | ||||||||
관할관청 | -마약 / 향정 구분 | -중점 / 일반 구분 | +마약 / 향정 구분 (폐기건수 / 폐기수량) | +중점 / 일반 구분 (폐기건수 / 폐기수량) | ||||||||||||||||||
{dept_nm} | -{대마} | -{마약} | -{한외마약} | -{향정} | -{향정제외} | -{기타} | -{마약향정계} | -{비마약류} | -{일반관리대상} | -{중점관리대상} | -{중점일반계} | +{대마} / {대마qy} | +{마약} / {마약qy} | +{한외마약} / {한외마약qy} | +{향정} / {향정qy} | +{향정제외} / {향정제외qy} | +{기타} / {기타qy} | +{마약향정계} / {마약향정계qy} | +{비마약류} / {비마약류qy} | +{일반관리대상} / {일반관리대상qy} | +{중점관리대상} / {중점관리대상qy} | +{중점일반계} / {중점일반계qy} |