parent
fd2368956a
commit
cda93a2819
|
|
@ -214,6 +214,7 @@ public class UnlawfulFishingController {
|
|||
params.setViewOrgan(loginUser.getOgCd());
|
||||
}
|
||||
params.setQueryInfo();
|
||||
params.setType("selectModal");
|
||||
mav.addObject("illegalShipInfoList", unlawfulFishingService.selectIllegalShipInfoList(params));
|
||||
params.setContentCnt(unlawfulFishingService.selectIllegalShipInfoListCnt(params));
|
||||
params.setPaginationInfo();
|
||||
|
|
@ -399,8 +400,13 @@ public class UnlawfulFishingController {
|
|||
//메뉴권한 확인
|
||||
AccessConfig accessConfig = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/unlawfulFishing/statistics?type=type1").get(0);
|
||||
mav.addObject("menuKey", accessConfig.getMenuKey());
|
||||
List<Integer> yearList = unlawfulFishingService.selectFishingBoatYearParam();
|
||||
if(yearList.size()==0){
|
||||
yearList.add(LocalDate.now().getYear());
|
||||
}
|
||||
mav.addObject("yearList", yearList);
|
||||
if(Utils.isEmpty(params.getYear())){
|
||||
params.setYear(LocalDate.now().getYear());
|
||||
params.setYear(yearList.get(0));
|
||||
}
|
||||
switch (params.getType()){
|
||||
case "type1":
|
||||
|
|
|
|||
|
|
@ -1,4 +1,23 @@
|
|||
package com.dbnt.faisp.main.faStatistics.unlawfulFishing.model.statistics;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
public class ProcessStatistics {
|
||||
private Integer year;
|
||||
private Integer yearTotal=0;
|
||||
private Integer depositPaidTotal=0;
|
||||
private Integer evictionCnt=0;
|
||||
private Integer handoverCnt=0;
|
||||
private Integer depositPaidCnt=0;
|
||||
private Integer depositUnpaidTotal=0;
|
||||
private Integer purchaseCnt=0;
|
||||
private Integer consignmentCnt=0;
|
||||
private Integer disposalCnt=0;
|
||||
private Integer depositUnpaidCnt=0;
|
||||
private Integer processingCnt=0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -416,7 +416,33 @@ public class UnlawfulFishingService {
|
|||
}
|
||||
|
||||
public List<ProcessStatistics> selectStatisticsListType3(StatisticsParam params) {
|
||||
return unlawfulFishingMapper.selectStatisticsListType3(params);
|
||||
List<ProcessStatistics> tempList = unlawfulFishingMapper.selectStatisticsListType3(params);
|
||||
List<ProcessStatistics> statList = new ArrayList<>();
|
||||
ProcessStatistics total = new ProcessStatistics();
|
||||
for(ProcessStatistics stat : tempList){
|
||||
stat.setYearTotal(stat.getEvictionCnt()+stat.getHandoverCnt()+stat.getDepositPaidCnt()
|
||||
+stat.getPurchaseCnt()+stat.getConsignmentCnt()+stat.getDisposalCnt()+stat.getDepositUnpaidCnt()
|
||||
+stat.getProcessingCnt());
|
||||
stat.setDepositPaidTotal(stat.getEvictionCnt()+stat.getHandoverCnt()+stat.getDepositPaidCnt());
|
||||
stat.setDepositUnpaidTotal(stat.getPurchaseCnt()+stat.getConsignmentCnt()+stat.getDisposalCnt()+stat.getDepositUnpaidCnt());
|
||||
|
||||
total.setEvictionCnt(total.getEvictionCnt()+stat.getEvictionCnt());
|
||||
total.setHandoverCnt(total.getHandoverCnt()+stat.getHandoverCnt());
|
||||
total.setDepositPaidCnt(total.getDepositPaidCnt()+stat.getDepositPaidCnt());
|
||||
total.setPurchaseCnt(total.getPurchaseCnt()+stat.getPurchaseCnt());
|
||||
total.setConsignmentCnt(total.getConsignmentCnt()+stat.getConsignmentCnt());
|
||||
total.setDisposalCnt(total.getDisposalCnt()+stat.getDisposalCnt());
|
||||
total.setDepositUnpaidCnt(total.getDepositUnpaidCnt()+stat.getDepositUnpaidCnt());
|
||||
total.setProcessingCnt(total.getProcessingCnt()+stat.getProcessingCnt());
|
||||
}
|
||||
total.setYearTotal(total.getEvictionCnt()+total.getHandoverCnt()+total.getDepositPaidCnt()
|
||||
+total.getPurchaseCnt()+total.getConsignmentCnt()+total.getDisposalCnt()+total.getDepositUnpaidCnt()
|
||||
+total.getProcessingCnt());
|
||||
total.setDepositPaidTotal(total.getEvictionCnt()+total.getHandoverCnt()+total.getDepositPaidCnt());
|
||||
total.setDepositUnpaidTotal(total.getPurchaseCnt()+total.getConsignmentCnt()+total.getDisposalCnt()+total.getDepositUnpaidCnt());
|
||||
statList.add(total);
|
||||
statList.addAll(tempList);
|
||||
return statList;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
select distinct extract(year from napo_dt) as year
|
||||
from crackdown_status
|
||||
where napo_dt is not null
|
||||
order by year desc
|
||||
</select>
|
||||
|
||||
<select id="selectCrackdownInfoList" resultType="CrackdownInfo" parameterType="UnlawfulFishingParam">
|
||||
|
|
@ -43,7 +44,7 @@
|
|||
group by aa.cds_key
|
||||
) vi on a.cds_key = vi.cds_key
|
||||
<include refid="selectCrackdownInfoListWhere"></include>
|
||||
order by a.wrt_dt desc
|
||||
order by a.napo_dt desc, a.wrt_dt desc
|
||||
limit #{rowCnt} offset #{firstIndex}
|
||||
</select>
|
||||
<select id="selectCrackdownInfoListCnt" resultType="int" parameterType="UnlawfulFishingParam">
|
||||
|
|
@ -131,7 +132,7 @@
|
|||
from illegal_ship_info a
|
||||
left outer join crackdown_info b on a.cds_key = b.cds_key
|
||||
<include refid="selectIllegalShipInfoListWhere"></include>
|
||||
order by a.wrt_dt desc
|
||||
order by b.napo_dt desc, a.wrt_dt desc
|
||||
limit #{rowCnt} offset #{firstIndex}
|
||||
</select>
|
||||
<select id="selectIllegalShipInfoListCnt" resultType="int" parameterType="UnlawfulFishingParam">
|
||||
|
|
@ -142,6 +143,11 @@
|
|||
</select>
|
||||
<sql id="selectIllegalShipInfoListWhere">
|
||||
where a.status <> 'DST008'
|
||||
<if test='type == "selectModal"'>
|
||||
and fb_key not in (select fb_key
|
||||
from ship_process_info
|
||||
where status <> 'DST008')
|
||||
</if>
|
||||
<if test='boatName != null and boatName != ""'>
|
||||
and (a.boat_name_kr like '%'||#{boatName}||'%' or a.boat_name_cn like '%'||#{boatName}||'%')
|
||||
</if>
|
||||
|
|
@ -203,7 +209,7 @@
|
|||
inner join illegal_ship_info b on a.fb_key = b.fb_key
|
||||
inner join crackdown_info c on b.cds_key = c.cds_key
|
||||
<include refid="selectShipProcessInfoListWhere"></include>
|
||||
order by a.wrt_dt desc
|
||||
order by c.napo_dt desc, a.wrt_dt desc
|
||||
limit #{rowCnt} offset #{firstIndex}
|
||||
</select>
|
||||
<select id="selectShipProcessInfoListCnt" resultType="int" parameterType="UnlawfulFishingParam">
|
||||
|
|
@ -471,5 +477,57 @@
|
|||
group by month
|
||||
</select>
|
||||
<select id="selectStatisticsListType3" parameterType="StatisticsParam" resultType="ProcessStatistics">
|
||||
select year,
|
||||
sum(evictionCnt) as evictionCnt,
|
||||
sum(handoverCnt) as handoverCnt,
|
||||
sum(depositPaidCnt) as depositPaidCnt,
|
||||
sum(purchaseCnt) as purchaseCnt,
|
||||
sum(consignmentCnt) as consignmentCnt,
|
||||
sum(disposalCnt) as disposalCnt,
|
||||
sum(depositUnpaidCnt) as depositUnpaidCnt,
|
||||
sum(processingCnt) as processingCnt
|
||||
from (
|
||||
select EXTRACT(YEAR FROM a.napo_dt) as year,
|
||||
case
|
||||
when c.process_status = 'PR009' then 1
|
||||
else 0
|
||||
end as evictionCnt, -- 퇴거
|
||||
case
|
||||
when c.process_status = 'PR010' then 1
|
||||
else 0
|
||||
end as handoverCnt, -- 직접인계
|
||||
case
|
||||
when (c.process_status = 'PR011' or c.process_status = 'PR012' or c.process_status = 'PR013')
|
||||
and (b.deposit_unpaid is null or b.deposit_unpaid = 0) then 1
|
||||
else 0
|
||||
end as depositPaidCnt, -- 담보금납부 기타
|
||||
case
|
||||
when c.process_status = 'PR004' then 1
|
||||
else 0
|
||||
end as purchaseCnt, -- 공매(인수)
|
||||
case
|
||||
when c.process_status = 'PR002' or c.process_status = 'PR003' then 1
|
||||
else 0
|
||||
end as consignmentCnt, -- 위탁
|
||||
case
|
||||
when c.process_status = 'PR005' or c.process_status = 'PR006' then 1
|
||||
else 0
|
||||
end as disposalCnt, -- 폐기(폐선, 폐선조건부공매)
|
||||
case
|
||||
when (c.process_status = 'PR011' or c.process_status = 'PR012' or c.process_status = 'PR013')
|
||||
and b.deposit_unpaid > 0 then 1
|
||||
else 0
|
||||
end as depositUnpaidCnt, -- 담보금미납 기타
|
||||
case
|
||||
when c.process_status = 'PR001' or c.process_status = 'PR007' or c.process_status = 'PR008' then 1
|
||||
else 0
|
||||
end as processingCnt -- 조사중, 재판중
|
||||
from crackdown_info a
|
||||
inner join illegal_ship_info b on a.cds_key = b.cds_key
|
||||
inner join ship_process_info c on b.fb_key = c.fb_key
|
||||
) aa
|
||||
where year <= ${year} and year >= ${year}-5
|
||||
group by year
|
||||
order by year desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -1,7 +1,15 @@
|
|||
$(document).on('click', '.statTab', function (event){
|
||||
location.href = "/unlawfulFishing/statistics?type="+event.target.id.replace("Tab", "");
|
||||
getStatistics(event.target.id.replace("Tab", ""), null);
|
||||
})
|
||||
|
||||
$(document).on('change', '#yearSelector', function (){
|
||||
getStatistics($(".nav-link.active")[0].id.replace("Tab", ""), this.value);
|
||||
})
|
||||
|
||||
function getStatistics(tab, year){
|
||||
location.href = "/unlawfulFishing/statistics?type="+tab+(year!==null?"&year="+year:"");
|
||||
}
|
||||
|
||||
$(document).on('click', '.type1Row', function (){
|
||||
$('#statYear').val($(this).attr('data-year'));
|
||||
$('#statEtc').val($(this).find('.etc').text())
|
||||
|
|
|
|||
|
|
@ -40,6 +40,17 @@
|
|||
</ul>
|
||||
<div class="tab-content bg-white border border-top-0 p-2">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="row">
|
||||
<div class="col-auto">
|
||||
<select class="form-select form-select-sm" id="yearSelector">
|
||||
<th:block th:each="year:${yearList}">
|
||||
<option th:value="${year}" th:text="${year}" th:selected="${searchParams.year eq year}"></option>
|
||||
</th:block>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<table class="table table-sm table-hover table-bordered ws-nowrap">
|
||||
<th:block th:if="${searchParams.type eq 'type1'}">
|
||||
|
|
@ -177,13 +188,50 @@
|
|||
</th:block>
|
||||
<th:block th:if="${searchParams.type eq 'type3'}">
|
||||
<colgroup>
|
||||
|
||||
<th:block th:each="num : ${#numbers.sequence(1,12)}">
|
||||
<col th:style="|width:${100/12}%|">
|
||||
</th:block>
|
||||
</colgroup>
|
||||
<thead>
|
||||
|
||||
<thead class="table-secondary align-middle text-center">
|
||||
<tr>
|
||||
<th rowspan="3">구분</th>
|
||||
<th rowspan="3">나포(척)</th>
|
||||
<th colspan="10">처리결과</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="4">담보금 납부</th>
|
||||
<th colspan="5">담보금 미납 · 영해침범</th>
|
||||
<th rowspan="2">진행</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>소계</th>
|
||||
<th>퇴거</th>
|
||||
<th>집접인계</th>
|
||||
<th>기타</th>
|
||||
<th>소계</th>
|
||||
<th>인수</th>
|
||||
<th>위탁</th>
|
||||
<th>폐기</th>
|
||||
<th>기타</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<tbody class="align-middle text-center">
|
||||
<th:block th:each="stat:${processStatList}">
|
||||
<tr>
|
||||
<td th:text="${stat.year eq null?'총계':#strings.concat(stat.year, '년')}"></td>
|
||||
<td th:text="${stat.yearTotal}"></td>
|
||||
<td th:text="${stat.depositPaidTotal}"></td>
|
||||
<td th:text="${stat.evictionCnt}"></td>
|
||||
<td th:text="${stat.handoverCnt}"></td>
|
||||
<td th:text="${stat.depositPaidCnt}"></td>
|
||||
<td th:text="${stat.depositUnpaidTotal}"></td>
|
||||
<td th:text="${stat.purchaseCnt}"></td>
|
||||
<td th:text="${stat.consignmentCnt}"></td>
|
||||
<td th:text="${stat.disposalCnt}"></td>
|
||||
<td th:text="${stat.depositUnpaidCnt}"></td>
|
||||
<td th:text="${stat.processingCnt}"></td>
|
||||
</tr>
|
||||
</th:block>
|
||||
</tbody>
|
||||
</th:block>
|
||||
</table>
|
||||
|
|
|
|||
Loading…
Reference in New Issue