fix:견문통계 완료(추후 수정필요)
parent
573e69c8f3
commit
c1066f21a8
|
|
@ -259,10 +259,18 @@ public class AffairController { // 첩보수집활동 > 외사경찰 견문관
|
|||
totalList.add(total);
|
||||
}
|
||||
mav.addObject("totalList", totalList);
|
||||
type1List = addTotalRow(typeStatistics.getCategory1(), type1List);
|
||||
type2List = addTotalRow(typeStatistics.getCategory2(), type2List);
|
||||
type3List = addTotalRow(typeStatistics.getCategory3(), type3List);
|
||||
type4List = addTotalRow(typeStatistics.getCategory4(), type4List);
|
||||
if(typeStatistics.getCategory1() != null) {
|
||||
type1List = addTotalRow(typeStatistics.getCategory1(), type1List);
|
||||
}
|
||||
if(typeStatistics.getCategory2() != null) {
|
||||
type2List = addTotalRow(typeStatistics.getCategory2(), type2List);
|
||||
}
|
||||
if(typeStatistics.getCategory3() != null) {
|
||||
type3List = addTotalRow(typeStatistics.getCategory3(), type3List);
|
||||
}
|
||||
if(typeStatistics.getCategory4() != null) {
|
||||
type4List = addTotalRow(typeStatistics.getCategory4(), type4List);
|
||||
}
|
||||
mav.addObject("type1List", type1List);
|
||||
mav.addObject("type2List", type2List);
|
||||
mav.addObject("type3List", type3List);
|
||||
|
|
@ -287,8 +295,12 @@ public class AffairController { // 첩보수집활동 > 외사경찰 견문관
|
|||
}
|
||||
totalList.add(total);
|
||||
}
|
||||
sangboCntList = addTotalRow(typeStatistics.getSangbo(), sangboCntList);
|
||||
arrCntList = addTotalRow(typeStatistics.getRating(), arrCntList);
|
||||
if(typeStatistics.getSangbo() != null) {
|
||||
sangboCntList = addTotalRow(typeStatistics.getSangbo(), sangboCntList);
|
||||
}
|
||||
if(typeStatistics.getRating() != null) {
|
||||
arrCntList = addTotalRow(typeStatistics.getRating(), arrCntList);
|
||||
}
|
||||
mav.addObject("totalList", totalList);
|
||||
mav.addObject("sangboList", sangboCntList);
|
||||
mav.addObject("arrCntList", arrCntList);
|
||||
|
|
|
|||
|
|
@ -126,21 +126,21 @@
|
|||
and wrt_dt <= #{endDate}::date+1
|
||||
</if>
|
||||
<if test='rating != null and rating != "" or sangbo != null and sangbo != ""'>
|
||||
and affair_key in (
|
||||
and ab.affair_key in (
|
||||
select affair_key
|
||||
from affair_rating aa
|
||||
inner join organ_config ab
|
||||
on aa.rating_organ = ab.organ_cd
|
||||
from affair_rating ar2
|
||||
inner join organ_config oc2
|
||||
on ar2.rating_organ = oc2.organ_cd
|
||||
<where>
|
||||
<if test='rating != null and rating != ""'>
|
||||
and aa.affair_rate in
|
||||
and ar2.affair_rate in
|
||||
<foreach collection="rating" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test='sangbo != null and sangbo != ""'>
|
||||
and aa.organ_up = 'T'
|
||||
and ab.organ_type in
|
||||
and ar2.organ_up = 'T'
|
||||
and oc2.organ_type in
|
||||
<foreach collection="sangbo" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
|
|
@ -230,40 +230,42 @@
|
|||
order by item_cd asc) a left outer join
|
||||
(select wrt_organ,
|
||||
count(*) as cnt
|
||||
from affair_board
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
<if test='userNm != null and userNm != ""'>
|
||||
and wrt_user_nm like '%'||#{userNm}||'%'
|
||||
</if>
|
||||
<if test='startDate != null and startDate != ""'>
|
||||
and wrt_dt >= #{startDate}::date
|
||||
</if>
|
||||
<if test='endDate != null and endDate != ""'>
|
||||
and wrt_dt <= #{endDate}::date+1
|
||||
</if>
|
||||
<if test='rating != null and rating != "" or sangbo != null and sangbo != ""'>
|
||||
and affair_key in (
|
||||
select affair_key
|
||||
from affair_rating aa
|
||||
inner join organ_config ab
|
||||
on aa.rating_organ = ab.organ_cd
|
||||
<where>
|
||||
<if test='rating != null and rating != ""'>
|
||||
and aa.affair_rate in
|
||||
<foreach collection="rating" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test='sangbo != null and sangbo != ""'>
|
||||
and aa.organ_up = 'T'
|
||||
and ab.organ_type in
|
||||
<foreach collection="sangbo" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
)
|
||||
</if>
|
||||
from affair_board ab,
|
||||
affair_rating ar
|
||||
where ab.affair_key = ar.affair_key
|
||||
and (ar.organ_up != 'T' or ar.organ_up is null)
|
||||
<if test='userNm != null and userNm != ""'>
|
||||
and wrt_user_nm like '%'||#{userNm}||'%'
|
||||
</if>
|
||||
<if test='startDate != null and startDate != ""'>
|
||||
and wrt_dt >= #{startDate}::date
|
||||
</if>
|
||||
<if test='endDate != null and endDate != ""'>
|
||||
and wrt_dt <= #{endDate}::date+1
|
||||
</if>
|
||||
<if test='rating != null and rating != "" or sangbo != null and sangbo != ""'>
|
||||
and ab.affair_key in (
|
||||
select affair_key
|
||||
from affair_rating ar2
|
||||
inner join organ_config oc2
|
||||
on ar2.rating_organ = oc2.organ_cd
|
||||
<where>
|
||||
<if test='rating != null and rating != ""'>
|
||||
and ar2.affair_rate in
|
||||
<foreach collection="rating" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test='sangbo != null and sangbo != ""'>
|
||||
and ar2.organ_up = 'T'
|
||||
and oc2.organ_type in
|
||||
<foreach collection="sangbo" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
)
|
||||
</if>
|
||||
<if test='category1 != null and category1 != ""'>
|
||||
and affair_type1 in
|
||||
<foreach collection="category1" item="item" index="index" separator="," open="(" close=")">
|
||||
|
|
@ -288,7 +290,6 @@
|
|||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</trim>
|
||||
group by wrt_organ)b on
|
||||
a.item_cd = b.wrt_organ
|
||||
order by wrt_organ asc
|
||||
|
|
@ -322,10 +323,11 @@
|
|||
(select wrt_organ,
|
||||
affair_type1 as affair_type,
|
||||
count(*) as cnt
|
||||
from affair_board
|
||||
<where>
|
||||
from affair_board ab,
|
||||
affair_rating ar
|
||||
where ab.affair_key = ar.affair_key
|
||||
and (ar.organ_up != 'T' or ar.organ_up is null)
|
||||
<include refid="searchStatistics"></include>
|
||||
</where>
|
||||
group by wrt_organ,affair_type1) c
|
||||
on a.item_cd = c.affair_type and b.item_cd = c.wrt_organ
|
||||
order by wrt_organ,affair_type asc
|
||||
|
|
@ -359,10 +361,11 @@
|
|||
(select wrt_organ,
|
||||
affair_type2 as affair_type,
|
||||
count(*) as cnt
|
||||
from affair_board
|
||||
<where>
|
||||
from affair_board ab,
|
||||
affair_rating ar
|
||||
where ab.affair_key = ar.affair_key
|
||||
and (ar.organ_up != 'T' or ar.organ_up is null)
|
||||
<include refid="searchStatistics"></include>
|
||||
</where>
|
||||
group by wrt_organ,affair_type2) c
|
||||
on a.item_cd = c.affair_type and b.item_cd = c.wrt_organ
|
||||
order by wrt_organ,affair_type asc
|
||||
|
|
@ -396,10 +399,11 @@
|
|||
(select wrt_organ,
|
||||
affair_type3 as affair_type,
|
||||
count(*) as cnt
|
||||
from affair_board
|
||||
<where>
|
||||
from affair_board ab,
|
||||
affair_rating ar
|
||||
where ab.affair_key = ar.affair_key
|
||||
and (ar.organ_up != 'T' or ar.organ_up is null)
|
||||
<include refid="searchStatistics"></include>
|
||||
</where>
|
||||
group by wrt_organ,affair_type3) c
|
||||
on a.item_cd = c.affair_type and b.item_cd = c.wrt_organ
|
||||
order by wrt_organ,affair_type asc
|
||||
|
|
@ -433,84 +437,74 @@
|
|||
(select wrt_organ,
|
||||
affair_type4 as affair_type,
|
||||
count(*) as cnt
|
||||
from affair_board
|
||||
<where>
|
||||
from affair_board ab,
|
||||
affair_rating ar
|
||||
where ab.affair_key = ar.affair_key
|
||||
and (ar.organ_up != 'T' or ar.organ_up is null)
|
||||
<include refid="searchStatistics"></include>
|
||||
</where>
|
||||
group by wrt_organ,affair_type4) c
|
||||
on a.item_cd = c.affair_type and b.item_cd = c.wrt_organ
|
||||
order by wrt_organ,affair_type asc
|
||||
</select>
|
||||
|
||||
<sql id="raitingSearch">
|
||||
<choose>
|
||||
<when test='sangbo != null and sangbo != ""'>
|
||||
and ar.organ_up = 'T'
|
||||
and oc.organ_type in
|
||||
<foreach collection="sangbo" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</when>
|
||||
<otherwise>
|
||||
and oc.organ_type not in ('OGC002','OGC003')
|
||||
</otherwise>
|
||||
</choose>
|
||||
<choose>
|
||||
<when test='category1 != null and category1 != ""'>
|
||||
and affair_type1 in
|
||||
<foreach collection="category1" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</when>
|
||||
<otherwise>
|
||||
and affair_type1 not in (select item_cd from code_mgt where category_cd = 'DC01')
|
||||
</otherwise>
|
||||
</choose>
|
||||
<choose>
|
||||
<when test='category2 != null and category2 != ""'>
|
||||
and affair_type2 in
|
||||
<foreach collection="category2" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</when>
|
||||
<otherwise>
|
||||
and affair_type2 not in (select item_cd from code_mgt where category_cd = 'DC02')
|
||||
</otherwise>
|
||||
</choose>
|
||||
<choose>
|
||||
<when test='category3 != null and category3 != ""'>
|
||||
and affair_type3 in
|
||||
<foreach collection="category3" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</when>
|
||||
<otherwise>
|
||||
and affair_type3 not in (select item_cd from code_mgt where category_cd = 'DC03')
|
||||
</otherwise>
|
||||
</choose>
|
||||
<choose>
|
||||
<when test='category4 != null and category4 != ""'>
|
||||
and affair_type4 in
|
||||
<foreach collection="category4" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</when>
|
||||
<otherwise>
|
||||
and affair_type4 not in (select item_cd from code_mgt where category_cd = 'DC04')
|
||||
</otherwise>
|
||||
</choose>
|
||||
<choose>
|
||||
<when test='rating != null and rating != ""'>
|
||||
and affair_rate in
|
||||
<foreach collection="rating" item="item" index="index" separator="," open="(" close=")">
|
||||
<if test='userNm != null and userNm != ""'>
|
||||
and wrt_user_nm like '%'||#{userNm}||'%'
|
||||
</if>
|
||||
<if test='startDate != null and startDate != ""'>
|
||||
and wrt_dt >= #{startDate}::date
|
||||
</if>
|
||||
<if test='endDate != null and endDate != ""'>
|
||||
and wrt_dt <= #{endDate}::date+1
|
||||
</if>
|
||||
<if test='rating != null and rating != "" or sangbo != null and sangbo != ""'>
|
||||
and ab.affair_key in (
|
||||
select affair_key
|
||||
from affair_rating ar2
|
||||
inner join organ_config oc2
|
||||
on ar2.rating_organ = oc2.organ_cd
|
||||
<where>
|
||||
<if test='rating != null and rating != ""'>
|
||||
and ar2.affair_rate in
|
||||
<foreach collection="rating" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test='sangbo != null and sangbo != ""'>
|
||||
and ar2.organ_up = 'T'
|
||||
and oc2.organ_type in
|
||||
<foreach collection="sangbo" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
)
|
||||
</if>
|
||||
<if test='category1 != null and category1 != ""'>
|
||||
and affair_type1 in
|
||||
<foreach collection="category1" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</when>
|
||||
<otherwise>
|
||||
and affair_rate not in (select item_cd from code_mgt where category_cd = 'AAR')
|
||||
</otherwise>
|
||||
</choose>
|
||||
</sql>
|
||||
</if>
|
||||
<if test='category2 != null and category2 != ""'>
|
||||
and affair_type2 in
|
||||
<foreach collection="category2" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test='category3 != null and category3 != ""'>
|
||||
and affair_type3 in
|
||||
<foreach collection="category3" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test='category4 != null and category4 != ""'>
|
||||
and affair_type4 in
|
||||
<foreach collection="category4" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="selectRatingStatusTotal" resultType="TypeStatistics" parameterType="TypeStatistics">
|
||||
select item_cd as wrt_organ,
|
||||
|
|
@ -521,18 +515,28 @@
|
|||
item_value
|
||||
from code_mgt
|
||||
where category_cd = 'OG'
|
||||
and use_chk = 'T') a
|
||||
and use_chk = 'T'
|
||||
<choose>
|
||||
<when test='organList != null and organList != ""'>
|
||||
and item_cd in
|
||||
<foreach collection="organList" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</when>
|
||||
<otherwise>
|
||||
and item_cd not in (select item_cd from code_mgt where category_cd = 'OG' and use_chk = 'T')
|
||||
</otherwise>
|
||||
</choose>
|
||||
) a
|
||||
left outer join
|
||||
(select ab.wrt_organ,
|
||||
oc.organ_type,
|
||||
count(*) as cnt
|
||||
from affair_board ab,
|
||||
affair_rating ar,
|
||||
organ_config oc
|
||||
affair_rating ar
|
||||
where ab.affair_key = ar.affair_key
|
||||
and ar.rating_organ = oc.organ_cd
|
||||
and (ar.organ_up != 'T' or ar.organ_up is null)
|
||||
<include refid="raitingSearch"></include>
|
||||
group by ab.wrt_organ,oc.organ_type) c
|
||||
group by ab.wrt_organ) c
|
||||
on a.item_cd = c.wrt_organ
|
||||
order by item_cd asc
|
||||
</select>
|
||||
|
|
@ -573,6 +577,7 @@
|
|||
organ_config oc
|
||||
where ab.affair_key = ar.affair_key
|
||||
and ar.rating_organ = oc.organ_cd
|
||||
and (ar.organ_up != 'T' or ar.organ_up is null)
|
||||
<include refid="raitingSearch"></include>
|
||||
group by ab.wrt_organ,oc.organ_type) c
|
||||
on a.item_cd = c.wrt_organ and b.organ_type = c.organ_type
|
||||
|
|
@ -609,12 +614,9 @@
|
|||
ar.affair_rate,
|
||||
count(*) as cnt
|
||||
from affair_board ab,
|
||||
affair_rating ar,
|
||||
organ_config oc
|
||||
affair_rating ar
|
||||
where ab.affair_key = ar.affair_key
|
||||
and ar.rating_organ = oc.organ_cd
|
||||
and ar.affair_rate is not null
|
||||
and ar.affair_rate != ''
|
||||
and (ar.organ_up != 'T' or ar.organ_up is null)
|
||||
<include refid="raitingSearch"></include>
|
||||
group by ab.wrt_organ,ar.affair_rate) c
|
||||
on c.wrt_organ = a.item_cd and c.affair_rate = b.item_cd
|
||||
|
|
|
|||
|
|
@ -5,11 +5,29 @@ $(function(){
|
|||
});
|
||||
})
|
||||
|
||||
$(document).on('click', '#downExcel', function (){
|
||||
exportExcel();
|
||||
$(document).on('click', '#fieldDownExcel', function (){
|
||||
exportExcel('분야별');
|
||||
})
|
||||
|
||||
function exportExcel(){
|
||||
$(document).on('click', '#ratingDownExcel', function (){
|
||||
exportExcel('평가별');
|
||||
})
|
||||
|
||||
function exportExcel(name){
|
||||
var excelHandler = {
|
||||
getExcelFileName : function(){
|
||||
return '견문통계'+'_'+name+'_'+getToday()+'.xlsx'; //파일명
|
||||
},
|
||||
getSheetName : function(){
|
||||
return '견문통계'+'_'+name;
|
||||
},
|
||||
getExcelData : function(){
|
||||
return document.getElementById('tableData'); //TABLE id
|
||||
},
|
||||
getWorksheet : function(){
|
||||
return XLSX.utils.table_to_sheet(this.getExcelData());
|
||||
}
|
||||
}
|
||||
// step 1. workbook 생성
|
||||
var wb = XLSX.utils.book_new();
|
||||
|
||||
|
|
@ -26,21 +44,6 @@ function exportExcel(){
|
|||
saveAs(new Blob([s2ab(wbout)],{type:"application/octet-stream"}), excelHandler.getExcelFileName());
|
||||
}
|
||||
|
||||
var excelHandler = {
|
||||
getExcelFileName : function(){
|
||||
return '견문통계'+'_'+getToday()+'.xlsx'; //파일명
|
||||
},
|
||||
getSheetName : function(){
|
||||
return 'Table Test Sheet'; //시트명
|
||||
},
|
||||
getExcelData : function(){
|
||||
return document.getElementById('tableData'); //TABLE id
|
||||
},
|
||||
getWorksheet : function(){
|
||||
return XLSX.utils.table_to_sheet(this.getExcelData());
|
||||
}
|
||||
}
|
||||
|
||||
function s2ab(s) {
|
||||
var buf = new ArrayBuffer(s.length); //convert s to arrayBuffer
|
||||
var view = new Uint8Array(buf); //create uint8array as viewer
|
||||
|
|
@ -89,9 +92,17 @@ function goFieldStatistics(){
|
|||
}
|
||||
|
||||
$(document).on('click', '#ratingSearch', function (){
|
||||
if($('input:checkbox[name=rating]:checked').length < 1){
|
||||
alert("평가항목을 선택해주세요");
|
||||
return false;
|
||||
}
|
||||
goRatingStatistics();
|
||||
})
|
||||
$(document).on('click', '#ratingTab', function (){
|
||||
if($('input:checkbox[name=rating]:checked').length < 1){
|
||||
alert("평가항목을 선택해주세요");
|
||||
return false;
|
||||
}
|
||||
goRatingStatistics();
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -92,8 +92,8 @@
|
|||
</ul>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<input id="category11" name="sangbo" type="checkbox" value="OGC003" checked>경찰서상보<br>
|
||||
<input id="category11" name="sangbo" type="checkbox" value="OGC002" checked>지방청상보
|
||||
<input id="category11" name="sangbo" type="checkbox" value="OGC003">경찰서상보<br>
|
||||
<input id="category11" name="sangbo" type="checkbox" value="OGC002">지방청상보
|
||||
</div>
|
||||
<div class="col-1 d-grid gap-2">
|
||||
<button type="button" id="fieldSearch" class="btn btn-lg btn-primary col-auto">분야별 검색</button>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
</ul>
|
||||
<div class="card-body">
|
||||
<button id="showMenu">검색조건열기</button>
|
||||
<button id="downExcel">엑셀다운</button>
|
||||
<button id="fieldDownExcel">엑셀다운</button>
|
||||
<div class="row" id="statisticsDiv">
|
||||
<table class="table table-hover table-bordered border-dark"
|
||||
id="tableData">
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
</ul>
|
||||
<div class="card-body">
|
||||
<button id="showMenu">검색조건열기</button>
|
||||
<button id="downExcel">엑셀다운</button>
|
||||
<button id="ratingDownExcel">엑셀다운</button>
|
||||
<div class="row" id="statisticsDiv">
|
||||
<table class="table table-hover table-bordered border-dark"
|
||||
id="tableData">
|
||||
|
|
|
|||
Loading…
Reference in New Issue