From 8a033d8d8627b76ba225428e9dc9362d0ed03560 Mon Sep 17 00:00:00 2001 From: TaehunPark Date: Fri, 21 Oct 2022 17:53:51 +0900 Subject: [PATCH] =?UTF-8?q?fix:=EA=B2=AC=EB=AC=B8=ED=86=B5=EA=B3=84=20?= =?UTF-8?q?=EC=A4=91=EA=B0=84=EC=A0=80=EC=9E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../faisp/fpiMgt/affair/AffairController.java | 18 +- .../resources/mybatisMapper/AffairMapper.xml | 167 +++++++++++++----- .../fpiMgt/affair/affairStatistics.html | 16 ++ 3 files changed, 145 insertions(+), 56 deletions(-) diff --git a/src/main/java/com/dbnt/faisp/fpiMgt/affair/AffairController.java b/src/main/java/com/dbnt/faisp/fpiMgt/affair/AffairController.java index e0c04f76..ed6b6157 100644 --- a/src/main/java/com/dbnt/faisp/fpiMgt/affair/AffairController.java +++ b/src/main/java/com/dbnt/faisp/fpiMgt/affair/AffairController.java @@ -238,19 +238,21 @@ public class AffairController { // 첩보수집활동 > 외사경찰 견문관 List type2 = affairService.selectType2List(typeStatistics); List type3 = affairService.selectType3List(typeStatistics); List type4 = affairService.selectType4List(typeStatistics); + List totalList = affairService.selectStatusTotal(typeStatistics); List type1List = affairService.selecType1ListCnt(typeStatistics); List type2List = affairService.selecType2ListCnt(typeStatistics); List type3List = affairService.selecType3ListCnt(typeStatistics); List type4List = affairService.selecType4ListCnt(typeStatistics); - List totalList = affairService.selectStatusTotal(typeStatistics); - TypeStatistics total = new TypeStatistics(); - total.setItemValue("누계"); - total.setWrtOrgan("total"); - total.setCnt(0); - for(TypeStatistics stat: totalList) { - total.setCnt(total.getCnt()+stat.getCnt()); + if(!totalList.isEmpty()) { + TypeStatistics total = new TypeStatistics(); + total.setItemValue("누계"); + total.setWrtOrgan("total"); + total.setCnt(0); + for(TypeStatistics stat: totalList) { + total.setCnt(total.getCnt()+stat.getCnt()); + } + totalList.add(total); } - totalList.add(total); mav.addObject("totalList", totalList); type1List = addTotalRow(type1, type1List); type2List = addTotalRow(type2, type2List); diff --git a/src/main/resources/mybatisMapper/AffairMapper.xml b/src/main/resources/mybatisMapper/AffairMapper.xml index 874c1271..d4ae9da5 100644 --- a/src/main/resources/mybatisMapper/AffairMapper.xml +++ b/src/main/resources/mybatisMapper/AffairMapper.xml @@ -123,12 +123,17 @@ item_value from code_mgt where category_cd = 'DC01' - - and item_cd in - - #{item} - - + + + and item_cd in + + #{item} + + + + and item_cd not in (select item_cd from code_mgt where category_cd = 'DC01') + + order by affairType asc @@ -137,12 +142,17 @@ item_value from code_mgt where category_cd = 'DC02' - - and item_cd in - - #{item} - - + + + and item_cd in + + #{item} + + + + and item_cd not in (select item_cd from code_mgt where category_cd = 'DC02') + + order by affairType asc @@ -151,12 +161,17 @@ item_value from code_mgt where category_cd = 'DC03' - - and item_cd in - - #{item} - - + + + and item_cd in + + #{item} + + + + and item_cd not in (select item_cd from code_mgt where category_cd = 'DC03') + + order by affairType asc @@ -165,12 +180,17 @@ item_value from code_mgt where category_cd = 'DC04' - - and item_cd in - - #{item} - - + + + and item_cd in + + #{item} + + + + and item_cd not in (select item_cd from code_mgt where category_cd = 'DC04') + + order by affairType asc @@ -184,16 +204,47 @@ from code_mgt where category_cd = 'OG' and use_chk = 'T' - - and item_cd in - - #{item} - - + + + and item_cd in + + #{item} + + + + and item_cd not in (select item_cd from code_mgt where category_cd = 'OG' and use_chk = 'T') + + order by item_cd asc) a left outer join (select wrt_organ, count(*) as cnt from affair_board + + + or affair_type1 in + + #{item} + + + + or affair_type2 in + + #{item} + + + + or affair_type3 in + + #{item} + + + + or affair_type4 in + + #{item} + + + group by wrt_organ)b on a.item_cd = b.wrt_organ order by wrt_organ asc @@ -209,12 +260,17 @@ item_value from code_mgt where category_cd = 'DC01' - - and item_cd in - - #{item} - - + + + and item_cd in + + #{item} + + + + and item_cd not in (select item_cd from code_mgt where category_cd = 'DC01') + + )a left join (select item_cd, item_value @@ -248,12 +304,17 @@ item_value from code_mgt where category_cd = 'DC02' - + + and item_cd in - #{item} - - + #{item} + + + + and item_cd not in (select item_cd from code_mgt where category_cd = 'DC02') + + )a left join (select item_cd, item_value @@ -287,12 +348,17 @@ item_value from code_mgt where category_cd = 'DC03' - + + and item_cd in - #{item} - - + #{item} + + + + and item_cd not in (select item_cd from code_mgt where category_cd = 'DC03') + + )a left join (select item_cd, item_value @@ -326,12 +392,17 @@ item_value from code_mgt where category_cd = 'DC04' - + + and item_cd in - #{item} - - + #{item} + + + + and item_cd not in (select item_cd from code_mgt where category_cd = 'DC04') + + )a left join (select item_cd, item_value diff --git a/src/main/resources/templates/igActivities/fpiMgt/affair/affairStatistics.html b/src/main/resources/templates/igActivities/fpiMgt/affair/affairStatistics.html index 67a09c04..18d44b78 100644 --- a/src/main/resources/templates/igActivities/fpiMgt/affair/affairStatistics.html +++ b/src/main/resources/templates/igActivities/fpiMgt/affair/affairStatistics.html @@ -90,24 +90,40 @@ 구분 누계 + 분류1 + + 분류2 + + 분류3 + + 분류4 + + + + + + + + +