<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorate="~{layout/layout}">
<th:block layout:fragment="script">
    <script th:inline="javascript">
        const crackdownStatus = [[${crackdownStatus}]];
        const commonCode = [[${session.commonCode}]];
    </script>
    <script type="text/javascript" th:src="@{/js/faStatistics/crackdownStatus.js}"></script>
</th:block>
<div layout:fragment="content">
    <main class="pt-3">
        <h4>불법조업 외국어선 단속현황</h4>
        <input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
        <input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
        <div class="row mx-0">
            <div class="col-12 card">
                <div class="card-body">
                    <form method="get" th:action="@{/faStatistics/crackdownStatus}" id="cdsSearchForm">
                        <input type="hidden" name="pageIndex" id="pageIndex" th:value="${searchParams.pageIndex}">
                        <div class="row justify-content-between pe-3 py-1">
                            <div class="col-auto">
                                <div class="col-auto">
                                    <select class="form-select form-select-sm" name="year">
                                        <option value="">연도</option>
                                        <th:block th:each="year : ${#numbers.sequence(2020, 2030)}">
                                            <option th:value="${year}" th:text="${year}" th:selected="${searchParams.year eq year}"></option>
                                        </th:block>
                                    </select>
                                </div>
                                <div class="col-auto">
                                    <select class="form-select form-select-sm" name="month">
                                        <option value="">월</option>
                                        <th:block th:each="month : ${#numbers.sequence(1, 12)}">
                                            <option th:value="${month}" th:text="${month}" th:selected="${searchParams.month eq month}"></option>
                                        </th:block>
                                    </select>
                                </div>
                            </div>
                            <div class="col-10">
                                <div class="row justify-content-between">
                                    <div class="col-auto">
                                        <input class="form-control form-control-sm" name="napoDate" id="napoDate" placeholder="나포일시" th:value="${#temporals.format(searchParams.napoDate, 'yyyy-MM-dd')}">
                                    </div>
                                    <div class="col-auto">
                                        <select class="form-select form-select-sm violation" name="violation">
                                            <option value="">위반내용</option>
                                            <th:block th:each="commonCode:${session.commonCode.get('VT')}">
                                                <option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
                                                        th:selected="${commonCode.itemCd eq searchParams.violation}"></option>></option>
                                            </th:block>
                                        </select>
                                    </div>
                                    <div class="col-auto">
                                        <input class="form-control form-control-sm" name="napoSeaPointDetail" id="napoSeaPointDetail" placeholder="위반장소" th:value="${searchParams.napoSeaPointDetail}">
                                    </div>
                                    <div class="col-auto">
                                        <select class="form-select form-select-sm" name="invasionType">
                                            <option value="">침범유형</option>
                                            <th:block th:each="commonCode:${session.commonCode.get('IST')}">
                                                <option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
                                                        th:selected="${commonCode.itemCd eq searchParams.invasionType}"></option>
                                            </th:block>
                                        </select>
                                    </div>
                                    <div class="col-auto">
                                        <select class="form-select form-select-sm" name="nll">
                                            <option value="">NLL</option>
                                            <option value="Y" th:selected="${searchParams.nll == 'Y'}">O</option>
                                            <option value="N" th:selected="${searchParams.nll == 'N'}">X</option>
                                        </select>
                                    </div>
                                    <div class="col-auto">
                                        <input type="number" min="0" class="form-control form-control-sm" name="obstrExspdCnt" id="obstrExspdCnt" placeholder="인적피해 발생건수" th:value="${searchParams.obstrExspdCnt}">
                                    </div>
                                    <div class="col-auto">
                                        <input type="number" min="0" class="form-control form-control-sm" name="personDamageCnt" id="personDamageCnt" placeholder="인적피해 피해인원" th:value="${searchParams.personDamageCnt}">
                                    </div>
                                    <div class="col-auto">
                                        <input type="number" min="0" class="form-control form-control-sm" name="personDamageAmount" id="personDamageAmount" placeholder="인적피해 피해액" th:value="${searchParams.personDamageAmount}">
                                    </div>
                                    <div class="col-auto">
                                        <input class="form-control form-control-sm" name="personDamageDetail" id="personDamageDetail" placeholder="인적피해 상세내용" th:value="${searchParams.personDamageDetail}">
                                    </div>
                                    <div class="col-auto">
                                        <input type="number" min="0" class="form-control form-control-sm" name="materialDamageCnt" id="materialDamageCnt" placeholder="물적피해 발생건수" th:value="${searchParams.materialDamageCnt}">
                                    </div>
                                    <div class="col-auto">
                                        <input type="number" min="0" class="form-control form-control-sm" name="materialDamageAmount" id="materialDamageAmount" placeholder="물적피해 피해액" th:value="${searchParams.materialDamageAmount}">
                                    </div>
                                    <div class="col-auto">
                                        <input class="form-control form-control-sm" name="materialDamageDetail" id="materialDamageDetail" placeholder="물적피해 상세내용" th:value="${searchParams.materialDamageDetail}">
                                    </div>
                                    <div class="col-auto">
                                        <select class="form-select form-select-sm" name="caseAgency">
                                            <option value="">사건담당기관</option>
                                            <th:block th:each="commonCode:${session.commonCode.get('ATA')}">
                                                <option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
                                                        th:selected="${commonCode.itemCd eq searchParams.caseAgency}"></option>
                                            </th:block>
                                        </select>
                                    </div>
                                    <div class="col-auto">
                                        <select class="form-select form-select-sm" name="crackdownPolice">
                                            <option value="">단속경찰서</option>
                                            <th:block th:each="commonCode:${session.commonCode.get('CPO')}">
                                                <option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
                                                        th:selected="${commonCode.itemCd eq searchParams.crackdownPolice}"></option>
                                            </th:block>
                                        </select>
                                    </div>
                                    <div class="col-auto">
                                        <select class="form-select form-select-sm" name="crackdownBoat">
                                            <option value="">단속함정</option>
                                            <th:block th:each="num : ${#numbers.sequence(1,#lists.size(session.commonCode.get('CPO')))}">
                                                <th:block th:if="${'CPO'+num == searchParams.crackdownPolice}" th:each="commonCode:${session.commonCode.get('CPO'+num)}">
                                                    <option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${searchParams.crackdownBoat eq commonCode.itemCd}"></option>
                                                </th:block>
                                            </th:block>
                                        </select>
                                    </div>
                                    <div class="col-auto">
                                        <input class="form-control form-control-sm" name="mmsi" id="mmsi" placeholder="MMSI.NO" th:value="${searchParams.mmsi}">
                                    </div>
                                    <div class="col-auto">
                                        <input class="form-control form-control-sm" name="boatNameKr" id="boatNameKr" placeholder="선명" th:value="${searchParams.boatNameKr}">
                                    </div>
                                    <div class="col-auto">
                                        <div style="display: flex;">
                                            <input type="number" min="0" class="form-control form-control-sm" name="tonStartCnt" id="tonStartCnt" placeholder="톤수 (~이상)" th:value="${searchParams.tonStartCnt}">
                                            ~<input type="number" min="0" class="form-control form-control-sm" name="tonEndCnt" id="tonEndCnt" placeholder="톤수 (~이하)" th:value="${searchParams.tonEndCnt}">
                                        </div>
                                    </div>
                                    <div class="col-auto">
                                        <select class="form-select form-select-sm" name="boatMaterial" id="boatMaterial">
                                            <option value="">선질</option>
                                            <th:block th:each="commonCode:${session.commonCode.get('BM')}">
                                                <option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
                                                        th:selected="${commonCode.itemCd eq searchParams.boatMaterial}"></option>
                                            </th:block>
                                            <option value="etc">직접입력</option>
                                        </select>
                                    </div>
                                    <div class="col-auto">
                                        <input class="form-control form-control-sm" name="boatNnySung" id="boatNnySung" placeholder="선적 성" th:value="${searchParams.boatNnySung}">
                                    </div>
                                    <div class="col-auto">
                                        <input class="form-control form-control-sm" name="boatNnySi" id="boatNnySi" placeholder="선적 시" th:value="${searchParams.boatNnySi}">
                                    </div>
                                    <div class="col-auto">
                                        <input class="form-control form-control-sm" name="sailorNameKr" id="sailorNameKr" placeholder="선장명" th:value="${searchParams.sailorNameKr}">
                                    </div>
                                    <div class="col-auto">
                                        <select class="form-select form-select-sm" name="fisheryType" id="fisheryType">
                                            <option value="">선종</option>
                                            <th:block th:each="commonCode:${session.commonCode.get('FT')}">
                                                <option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
                                                        th:selected="${commonCode.itemCd eq searchParams.fisheryType}"></option>
                                            </th:block>
                                        </select>
                                    </div>
                                    <div class="col-auto">
                                        <input class="form-control form-control-sm" name="catchFishSpecies" id="catchFishSpecies" placeholder="어획물 축소기재 어종" th:value="${searchParams.catchFishSpecies}">
                                    </div>
                                    <!--<div class="col-auto">
                                        <input class="form-control form-control-sm" name="catchCnt" id="catchCnt" placeholder="어획물 축소기재 수량" th:value="${searchParams.catchCnt}">
                                    </div>-->
                                    <div class="col-auto">
                                        <input class="form-control form-control-sm" name="offenseFishSpecies" id="offenseFishSpecies" placeholder="범칙물 어종" th:value="${searchParams.offenseFishSpecies}">
                                    </div>
                                    <!--<div class="col-auto">
                                        <input class="form-control form-control-sm" name="offenseCatchCnt" id="offenseCatchCnt" placeholder="범칙물 어획량" th:value="${searchParams.offenseCatchCnt}">
                                    </div>
                                    <div class="col-auto">
                                        <input class="form-control form-control-sm" name="offenseIllegalWasteQuantity" id="offenseIllegalWasteQuantity" placeholder="범칙물 폐기량" th:value="${searchParams.offenseIllegalWasteQuantity}">
                                    </div>
                                    <div class="col-auto">
                                        <input class="form-control form-control-sm" name="offenseQuantity" id="offenseQuantity" placeholder="범칙물 위판량" th:value="${searchParams.offenseQuantity}">
                                    </div>
                                    <div class="col-auto">
                                        <input class="form-control form-control-sm" name="offenseAmount" id="offenseAmount" placeholder="범칙물 위판금액" th:value="${searchParams.offenseAmount}">
                                    </div>-->
                                    <div class="col-auto">
                                        <select class="form-select form-select-sm" name="processStatus" id="processStatus">
                                            <option value="">처리현황</option>
                                            <th:block th:each="commonCode:${session.commonCode.get('PR')}">
                                                <option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
                                                        th:selected="${commonCode.itemCd eq searchParams.processStatus}"></option>
                                            </th:block>
                                        </select>
                                    </div>
                                    <!--<div class="col-auto">
                                        <input class="form-control form-control-sm" name="damboPayment" id="damboPayment" placeholder="담보금 납부액" th:value="${searchParams.damboPayment}">
                                    </div>
                                    <div class="col-auto">
                                        <input class="form-control form-control-sm" name="paymentPaymentDate" id="paymentPaymentDate" placeholder="담보금 납부일시" th:value="${#temporals.format(searchParams.paymentPaymentDate, 'yyyy-MM-dd')}">
                                    </div>
                                    <div class="col-auto">
                                        <input class="form-control form-control-sm" name="damboUnpaidAmount" id="damboUnpaidAmount" placeholder="담보금 미납액" th:value="${searchParams.damboUnpaidAmount}">
                                    </div>-->
                                    <div class="col-auto">
                                        <select class="form-select form-select-sm" name="isDamboUnpaidAmount" th:value="${searchParams.isDamboUnpaidAmount}">
                                            <option value="">담보금 미납 여부</option>
                                            <option value="Y" th:selected="${searchParams.isDamboUnpaidAmount eq 'Y'}">O</option>
                                            <option value="N" th:selected="${searchParams.isDamboUnpaidAmount eq 'N'}">X</option>
                                        </select>
                                    </div>
                                    <div class="col-auto">
                                        <select class="form-select form-select-sm" name="isDirectHandoverDt" th:value="${searchParams.isDirectHandoverDt}">
                                            <option value="">직접인계 여부</option>
                                            <option value="Y" th:selected="${searchParams.isDirectHandoverDt eq 'Y'}">O</option>
                                            <option value="N" th:selected="${searchParams.isDirectHandoverDt eq 'N'}">X</option>
                                        </select>
                                    </div>
                                    <div class="col-auto">
                                        <!--<input class="form-control form-control-sm" name="evictionDt" id="evictionDt" placeholder="퇴거일" th:value="${#temporals.format(searchParams.evictionDt, 'yyyy-MM-dd')}">-->
                                        <select class="form-select form-select-sm" name="isEvictionDt" th:value="${searchParams.isEvictionDt}">
                                            <option value="">퇴거여부</option>
                                            <option value="Y" th:selected="${searchParams.isEvictionDt eq 'Y'}">O</option>
                                            <option value="N" th:selected="${searchParams.isEvictionDt eq 'N'}">X</option>
                                        </select>
                                    </div>
                                    <div class="col-auto">
                                        <!--<input class="form-control form-control-sm" name="returnDt" id="returnDt" placeholder="환부일" th:value="${#temporals.format(searchParams.returnDt, 'yyyy-MM-dd')}">-->
                                        <select class="form-select form-select-sm" name="isReturnDt" th:value="${searchParams.isReturnDt}">
                                            <option value="">환부여부</option>
                                            <option value="Y" th:selected="${searchParams.isReturnDt eq 'Y'}">O</option>
                                            <option value="N" th:selected="${searchParams.isReturnDt eq 'N'}">X</option>
                                        </select>
                                    </div>
                                    <div class="col-auto">
                                        <select class="form-select form-select-sm" name="isConsignmentStartDt" th:value="${searchParams.isConsignmentStartDt}">
                                            <option value="">위탁관리 여부</option>
                                            <option value="Y" th:selected="${searchParams.isConsignmentStartDt eq 'Y'}">O</option>
                                            <option value="N" th:selected="${searchParams.isConsignmentStartDt eq 'N'}">X</option>
                                        </select>
                                    </div>
                                    <div class="col-auto">
                                        <input class="form-control form-control-sm" name="consignmentStartDate" id="consignmentStartDate" placeholder="위탁시작일" th:value="${#temporals.format(searchParams.consignmentStartDate, 'yyyy-MM-dd')}">
                                    </div>
                                    <div class="col-auto">
                                        <input class="form-control form-control-sm" name="consignmentEndDate" id="consignmentEndDate" placeholder="위탁종료일" th:value="${#temporals.format(searchParams.consignmentEndDate, 'yyyy-MM-dd')}">
                                    </div>
                                    <div class="col-auto">
                                        <!--<input class="form-control form-control-sm" name="confiscationDt" id="confiscationDt" placeholder="몰수확정일" th:value="${#temporals.format(searchParams.confiscationDt, 'yyyy-MM-dd')}">-->
                                        <select class="form-select form-select-sm" name="isConfiscationDt" th:value="${searchParams.isConfiscationDt}">
                                            <option value="">침몰여부</option>
                                            <option value="Y" th:selected="${searchParams.isConfiscationDt eq 'Y'}">O</option>
                                            <option value="N" th:selected="${searchParams.isConfiscationDt eq 'N'}">X</option>
                                        </select>
                                    </div>
                                    <!--<div class="col-auto">
                                        <input class="form-control form-control-sm" name="boatDisposalDt" id="boatDisposalDt" placeholder="폐선일" th:value="${#temporals.format(searchParams.boatDisposalDt, 'yyyy-MM-dd')}">
                                    </div>-->
                                    <div class="col-auto">
                                        <select class="form-select form-select-sm" name="boatDisposalType" th:value="${searchParams.boatDisposalType}">
                                            <option value="">폐선종류</option>
                                            <th:block th:each="commonCode:${session.commonCode.get('BDT')}">
                                                <option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
                                                        th:selected="${commonCode.itemCd eq searchParams.boatDisposalType}"></option>
                                            </th:block>
                                        </select>
                                    </div>
                                    <div class="col-auto">
                                        <input class="form-control form-control-sm" name="directHandoverDate" id="directHandoverDate" placeholder="직접인계일" th:value="${#temporals.format(searchParams.directHandoverDate, 'yyyy-MM-dd')}">
                                    </div>
                                    <div class="col-auto">
                                        <input class="form-control form-control-sm" name="handoverSeaPointDetail" id="handoverSeaPointDetail" placeholder="직접인계 해점" th:value="${searchParams.handoverSeaPointDetail}">
                                    </div>
                                    <div class="col-auto">
                                        <input class="form-control form-control-sm" name="handoverBoat" id="handoverBoat" placeholder="인계함정" th:value="${searchParams.handoverBoat}">
                                    </div>
                                    <div class="col-auto">
                                        <input class="form-control form-control-sm" name="middleTakeoverBoat" id="middleTakeoverBoat" placeholder="중측 인수함정" th:value="${searchParams.middleTakeoverBoat}">
                                    </div>
                                    <div class="col-auto">
                                        <select class="form-select form-select-sm" name="captin">
                                            <option value="">선장 구속여부</option>
                                            <option value="Y" th:selected="${searchParams.captin eq 'Y'}">구속</option>
                                            <option value="N" th:selected="${searchParams.captin eq 'N'}">불구속</option>
                                        </select>
                                    </div>
                                    <div class="col-auto">
                                        <select class="form-select form-select-sm" name="mate">
                                            <option value="">향해장 구속여부</option>
                                            <option value="Y" th:selected="${searchParams.mate eq 'Y'}">구속</option>
                                            <option value="N" th:selected="${searchParams.mate eq 'N'}">불구속</option>
                                        </select>
                                    </div>
                                    <div class="col-auto">
                                        <select class="form-select form-select-sm" name="warden">
                                            <option value="">기관장 구속여부</option>
                                            <option value="Y" th:selected="${searchParams.warden eq 'Y'}">구속</option>
                                            <option value="N" th:selected="${searchParams.warden eq 'N'}">불구속</option>
                                        </select>
                                    </div>
                                    <div class="col-auto">
                                        <input class="form-control form-control-sm" name="fieldIvsgtNapoDate" id="fieldIvsgtNapoDate" placeholder="현장조사 나포일시" th:value="${#temporals.format(searchParams.fieldIvsgtNapoDate, 'yyyy-MM-dd')}">
                                    </div>
                                    <div class="col-auto">
                                        <input class="form-control form-control-sm" name="fieldIvsgtReleaseDate" id="fieldIvsgtReleaseDate" placeholder="현장조사 석방일시" th:value="${#temporals.format(searchParams.fieldIvsgtReleaseDate, 'yyyy-MM-dd')}">
                                    </div>
                                    <!--<div class="col-auto">
                                        <input class="form-control form-control-sm" name="pressurizedStartDt" id="pressurizedStartDt" placeholder="압송시작일" th:value="${#temporals.format(searchParams.pressurizedStartDt, 'yyyy-MM-dd')}">
                                    </div>
                                    <div class="col-auto">
                                        <input class="form-control form-control-sm" name="pressurizedEndDt" id="pressurizedEndDt" placeholder="압송종료일" th:value="${#temporals.format(searchParams.pressurizedEndDt, 'yyyy-MM-dd')}">
                                    </div>-->
                                    <div class="col-auto">
                                        <input class="form-control form-control-sm" name="distance" id="distance" placeholder="거리" th:value="${searchParams.distance}">
                                    </div>
                                    <div class="col-auto">
                                        <input class="form-control form-control-sm" name="confiscationFrame" id="confiscationFrame" placeholder="틀" th:value="${searchParams.confiscationFrame}">
                                    </div>
                                    <div class="col-auto">
                                        <input class="form-control form-control-sm" name="confiscationWidth" id="confiscationWidth" placeholder="폭" th:value="${searchParams.confiscationWidth}">
                                    </div>
                                    <div class="col-auto">
                                        <input class="form-control form-control-sm" name="confiscationJo" id="confiscationJo" placeholder="조" th:value="${searchParams.confiscationJo}">
                                    </div>
                                    <div class="col-auto">
                                        <input class="form-control form-control-sm" name="confiscationGae" id="confiscationGae" placeholder="개" th:value="${searchParams.confiscationGae}">
                                    </div>
                                    <div class="col-auto">
                                        <input class="form-control form-control-sm" name="confiscationEtc" id="confiscationEtc" placeholder="기타" th:value="${searchParams.confiscationEtc}">
                                    </div>
                                </div>
                            </div>
                            <div class="col-auto">
                                <input type="submit" class="btn btn-sm btn-primary col-auto" id="searchBtn" value="검색">
                            </div>
                        </div>
                    </form>
                    <div class="row justify-content-start" style="overflow: hidden; overflow-x: scroll">
                        <table class="table table-hover table-bordered ws-nowrap" style="max-width: none; width: auto;" id="cdsTable">
                            <thead class="align-middle text-center">
                            <tr>
                                <th rowspan="4">연번</th>
                                <th rowspan="4">나포일시</th>
                                <th rowspan="4">위반내용</th>
                                <th rowspan="4">위반장소</th>
                                <th colspan="4">침범유형</th>
                                <th rowspan="3">NLL</th>
                                <th colspan="7">특수공무집행방해</th>
                                <th rowspan="4">사건담당경찰서</th>
                                <th colspan="2">검거기관</th>
                                <th rowspan="4">MMSI.NO(AIS)</th>
                                <th colspan="6">선박제원</th>
                                <th rowspan="3" colspan="2">선장(출생년도)</th>
                                <th rowspan="4">선종</th>
                                <th rowspan="3" colspan="2">어획물 축소기재</th>
                                <th colspan="5">범칙물</th>
                                <th colspan="2">처리현황</th>
                                <th colspan="3">담보금납부(만원)</th>
                                <th colspan="2">담보금미납(만원)</th>
                                <th colspan="10">선박처리</th>
                                <th colspan="4">직접인계</th>
                                <th colspan="6">구속</th>
                                <th colspan="6">불구속</th>
                                <th rowspan="3" colspan="4">현장조사</th>
                                <th rowspan="3" colspan="2">압송</th>
                                <th rowspan="4">영장청구 소요시간</th>
                                <th colspan="5">압수어구</th>
                            </tr>
                            <tr>
                                <th rowspan="2">무허가 조업</th>
                                <th rowspan="2">
                                    <div>특정금지</div>
                                    <div>(무허가, 정선명령위반)</div>
                                </th>
                                <th rowspan="2">
                                    <div>EEZ</div>
                                    <div>제한조건</div>
                                </th>
                                <th rowspan="2">영해침범</th>
                                <th rowspan="2">발생건수</th>
                                <th colspan="3">인적피해</th>
                                <th colspan="3">물적피해</th>
                                <th rowspan="2" colspan="2">구분</th>
                                <th rowspan="3">선명</th>
                                <th rowspan="3">톤수(톤)</th>
                                <th rowspan="3">선원(명)</th>
                                <th rowspan="3">선질</th>
                                <th rowspan="2" colspan="2">선적</th>
                                <th rowspan="3">어종</th>
                                <th rowspan="2">어획량(kg)</th>
                                <th rowspan="2">폐기량(kg)</th>
                                <th rowspan="2">위판량(kg)</th>
                                <th rowspan="2">위판금액(원)</th>
                                <th rowspan="2">조사중</th>
                                <th rowspan="2">완료</th>
                                <th rowspan="2">척수</th>
                                <th rowspan="2">납부액</th>
                                <th rowspan="3">납부일시</th>
                                <th rowspan="2">미납</th>
                                <th rowspan="2">미납금액</th>
                                <th rowspan="2">위탁관리</th>
                                <th rowspan="3">위탁시작일</th>
                                <th rowspan="3">위탁종료일</th>
                                <th rowspan="2">퇴거</th>
                                <th rowspan="2">직접인계</th>
                                <th rowspan="2">공매</th>
                                <th colspan="2">폐선</th>
                                <th rowspan="2">침몰</th>
                                <th rowspan="2">환부</th>
                                <th rowspan="3">일시</th>
                                <th rowspan="3">해점</th>
                                <th rowspan="3">인계함정</th>
                                <th rowspan="3">중측인수함정</th>
                                <th rowspan="2">계</th>
                                <th rowspan="2">선장</th>
                                <th rowspan="2">항해장</th>
                                <th rowspan="2">기관장</th>
                                <th rowspan="2">선원</th>
                                <th rowspan="2">구속척수(몰수판결)</th>
                                <th rowspan="2">계</th>
                                <th rowspan="2">선장</th>
                                <th rowspan="2">항해장</th>
                                <th rowspan="2">기관장</th>
                                <th rowspan="2">선원</th>
                                <th rowspan="2">불구속척수</th>
                                <th rowspan="2">틀(타망)</th>
                                <th rowspan="2">폭(유망)</th>
                                <th rowspan="2">조(형망)</th>
                                <th rowspan="2">개(통발)</th>
                                <th rowspan="2">기타</th>
                            </tr>
                            <tr>
                                <th>피해인원</th>
                                <th>피해액(만원)</th>
                                <th rowspan="2">상세내용</th>
                                <th>발생건수</th>
                                <th>피해액(만원)</th>
                                <th rowspan="2">상세내용</th>
                                <th>단순폐선</th>
                                <th>폐선조건부공매</th>
                            </tr>
                            <tr>
                                <th th:text="${#aggregates.sum(crackdownStatusList.?[invasionType == 'IST001'].![1]) ne null ? #aggregates.sum(crackdownStatusList.?[invasionType == 'IST001'].![1]) : 0}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.?[invasionType == 'IST002'].![1]) ne null ? #aggregates.sum(crackdownStatusList.?[invasionType == 'IST002'].![1]) : 0}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.?[invasionType == 'IST003'].![1]) ne null ? #aggregates.sum(crackdownStatusList.?[invasionType == 'IST003'].![1]) : 0}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.?[invasionType == 'IST004'].![1]) ne null ? #aggregates.sum(crackdownStatusList.?[invasionType == 'IST004'].![1]) : 0}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.?[nll == 'Y'].![1]) ne null ? #aggregates.sum(crackdownStatusList.?[nll == 'Y'].![1]) : 0}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.?[personDamageCnt > 0 || personDamageAmount > 0].![1]) ne null ? 1 : 0}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.![personDamageCnt])}"></th>
                                <th th:text="${#numbers.formatInteger(#aggregates.sum(crackdownStatusList.![personDamageAmount]), 3, 'COMMA')}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.?[materialDamageCnt > 0 || materialDamageAmount > 0].![1]) ne null ? 1 : 0}"></th>
                                <th th:text="${#numbers.formatInteger(#aggregates.sum(crackdownStatusList.![materialDamageAmount]), 3, 'COMMA')}"></th>
                                <th>단속경찰서</th>
                                <th>단속함정</th>
                                <th>성</th>
                                <th>시</th>
                                <th>이름</th>
                                <th>출생년도</th>
                                <th>어종</th>
                                <th>수량</th>
                                <th th:text="${#numbers.formatInteger(#aggregates.sum(crackdownStatusList.![fishingBoat.offenseCatchCnt]), 3, 'COMMA')}"></th>
                                <th th:text="${#numbers.formatInteger(#aggregates.sum(crackdownStatusList.![fishingBoat.offenseIllegalWasteQuantity]), 3, 'COMMA')}"></th>
                                <th th:text="${#numbers.formatInteger(#aggregates.sum(crackdownStatusList.![fishingBoat.offenseQuantity]), 3, 'COMMA')}"></th>
                                <th th:text="${#numbers.formatInteger(#aggregates.sum(crackdownStatusList.![fishingBoat.offenseAmount]), 3, 'COMMA')}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.?[processResult.processStatus == 'PR001'].![1]) ne null ? #aggregates.sum(crackdownStatusList.?[processResult.processStatus == 'PR001'].![1]) : 0}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.?[processResult.processStatus == 'PR009'].![1]) ne null ? #aggregates.sum(crackdownStatusList.?[processResult.processStatus == 'PR009'].![1]) : 0}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.?[fishingBoat.damboPayment > 0].![1]) ne null ? 1 : 0}"></th>
                                <th th:text="${#numbers.formatInteger(#aggregates.sum(crackdownStatusList.![fishingBoat.damboPayment]), 3, 'COMMA')}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.?[fishingBoat.damboUnpaidAmount > 0].![1]) ne null ? 1 : 0}"></th>
                                <th th:text="${#numbers.formatInteger(#aggregates.sum(crackdownStatusList.![fishingBoat.damboUnpaidAmount]), 3, 'COMMA')}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.?[processResult.consignmentStartDt != null].![1]) ne null ? 1 : 0}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.?[processResult.evictionDt != null].![1]) ne null ? 1 : 0}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.?[processResult.directHandoverDt != null].![1]) ne null ? 1 : 0}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.?[processResult.boatDisposalDt != null && processResult.boatDisposalType == 'BDT001'].![1]) ne null ? #aggregates.sum(crackdownStatusList.?[processResult.boatDisposalDt != null && processResult.boatDisposalType == 'BDT001'].![1]) : 0}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.?[processResult.boatDisposalDt != null && processResult.boatDisposalType == 'BDT002'].![1]) ne null ? #aggregates.sum(crackdownStatusList.?[processResult.boatDisposalDt != null && processResult.boatDisposalType == 'BDT002'].![1]) : 0}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.?[processResult.boatDisposalDt != null && processResult.boatDisposalType == 'BDT003'].![1]) ne null ? #aggregates.sum(crackdownStatusList.?[processResult.boatDisposalDt != null && processResult.boatDisposalType == 'BDT003'].![1]) : 0}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.?[processResult.confiscationDt != null].![1]) ne null ? 1 : 0}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.?[processResult.returnDt != null].![1]) ne null ? 1 : 0}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.![restrictionTotal])}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.![restrictionCaptin])}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.![restrictionMate])}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.![restrictionWarden])}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.![restrictionSailor])}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.?[processResult.confiscationDt != null].![1]) ne null ? #aggregates.sum(crackdownStatusList.?[processResult.confiscationDt != null].![1]) : 0}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.![notRestrictionTotal])}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.![notRestrictionCaptin])}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.![notRestrictionMate])}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.![notRestrictionWarden])}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.![notRestrictionSailor])}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.?[processResult.confiscationDt != null].![1]) ne null ? 0 : #aggregates.sum(crackdownStatusList.?[processResult.confiscationDt != null].![1])}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.?[fieldIvsgtNapoDt != null].![1]) ne null ? 1 : 0}"></th>
                                <th>나포일시</th>
                                <th>석방일시</th>
                                <th>소요시간</th>
                                <th>소요시간</th>
                                <th>거리(해리)</th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.?[fishingBoat.confiscationFrame != null && fishingBoat.confiscationFrame != ''].![1]) ne null ? #aggregates.sum(crackdownStatusList.?[fishingBoat.confiscationFrame != null && fishingBoat.confiscationFrame != ''].![1]) : 0}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.?[fishingBoat.confiscationFrame != null && fishingBoat.confiscationWidth != ''].![1]) ne null ? #aggregates.sum(crackdownStatusList.?[fishingBoat.confiscationWidth != null && fishingBoat.confiscationWidth != ''].![1]) : 0}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.?[fishingBoat.confiscationFrame != null && fishingBoat.confiscationJo != ''].![1]) ne null ? #aggregates.sum(crackdownStatusList.?[fishingBoat.confiscationJo != null && fishingBoat.confiscationJo != ''].![1]) : 0}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.?[fishingBoat.confiscationFrame != null && fishingBoat.confiscationGae != ''].![1]) ne null ? #aggregates.sum(crackdownStatusList.?[fishingBoat.confiscationGae != null && fishingBoat.confiscationGae != ''].![1]) : 0}"></th>
                                <th th:text="${#aggregates.sum(crackdownStatusList.?[fishingBoat.confiscationFrame != null && fishingBoat.confiscationEtc != ''].![1]) ne null ? #aggregates.sum(crackdownStatusList.?[fishingBoat.confiscationEtc != null && fishingBoat.confiscationEtc != ''].![1]) : 0}"></th>
                            </tr>
                            </thead>
                            <tbody class="table-group-divider align-middle text-center">
                                <th:block th:each="crackdownStatus:${crackdownStatusList}">
                                    <tr class="tr" th:data-key="${crackdownStatus.cdsKey}">
                                        <td th:text="${crackdownStatus.cdsKey}"></td>
                                        <td th:text="${#temporals.format(crackdownStatus.napoDt, 'yyyy-MM-dd HH:mm')}"></td>
                                        <td>
                                            <th:block th:if="${#lists.size(crackdownStatus.violationList) >= 1}">
                                                <th:block th:each="violation:${crackdownStatus.violationList}">
                                                    <th:block th:each="commonCode:${session.commonCode.get('VT')}">
                                                        <div th:if="${violation.violation eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></div>
                                                    </th:block>
                                                </th:block>
                                            </th:block>
                                        </td>
                                        <td>
                                            <span th:text="${crackdownStatus.napoSeaPointLat}"> ~ </span>
                                            <span th:text="${crackdownStatus.napoSeaPointLon}"></span>
                                            <div th:text="${crackdownStatus.napoSeaPointDetail}"></div>
                                        </td>
                                        <th:block th:each="commonCode:${session.commonCode.get('IST')}">
                                            <td th:if="${crackdownStatus.invasionType ne null && crackdownStatus.invasionType eq commonCode.itemCd}" th:text="1"></td>
                                            <td th:if="${crackdownStatus.invasionType ne commonCode.itemCd}" th:text="0"></td>
                                        </th:block>
                                        <td th:text="${crackdownStatus.nll eq 'Y' ? 1 : 0}"></td>
                                        <td th:text="${crackdownStatus.obstrExspdCnt}"></td>
                                        <td th:text="${crackdownStatus.personDamageCnt}"></td>
                                        <td th:text="${#numbers.formatInteger(crackdownStatus.personDamageAmount, 3, 'COMMA')}"></td>
                                        <td th:text="${crackdownStatus.personDamageDetail}"></td>
                                        <td th:text="${crackdownStatus.materialDamageCnt}"></td>
                                        <td th:text="${#numbers.formatInteger(crackdownStatus.materialDamageAmount, 3, 'COMMA')}"></td>
                                        <td th:text="${crackdownStatus.materialDamageDetail}"></td>
                                        <th:block th:each="commonCode:${session.commonCode.get('ATA')}">
                                            <td th:if="${crackdownStatus.caseAgency eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
                                        </th:block>
                                        <th:block th:if="${crackdownStatus.caseAgency eq null || crackdownStatus.caseAgency eq ''}">
                                            <td></td>
                                        </th:block>
                                        <th:block th:each="commonCode:${session.commonCode.get('CPO')}">
                                            <td th:if="${crackdownStatus.crackdownPolice eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
                                        </th:block>
                                        <th:block th:if="${!#strings.contains(crackdownStatus.crackdownPolice, 'CPO')}">
                                            <td th:text="${crackdownStatus.crackdownPolice}"></td>
                                        </th:block>
                                        <th:block th:each="num : ${#numbers.sequence(1,#lists.size(session.commonCode.get('CPO')))}">
                                            <th:block th:if="${'CPO'+num == crackdownStatus.crackdownPolice}" th:each="commonCode:${session.commonCode.get('CPO'+num)}">
                                                <td th:if="${crackdownStatus.crackdownBoat eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
                                            </th:block>
                                        </th:block>
                                        <th:block th:if="${!#strings.contains(crackdownStatus.crackdownBoat, 'CPO')}">
                                            <td></td>
                                        </th:block>
                                        <td th:text="${crackdownStatus.mmsi}"></td>
                                        <td th:text="${crackdownStatus.fishingBoat.boatNameKr}"></td>
                                        <td th:text="${crackdownStatus.fishingBoat.tonCnt}"></td>
                                        <td th:text="${crackdownStatus.restrictionSailor + crackdownStatus.notRestrictionSailor}"></td>
                                        <th:block th:each="commonCode:${session.commonCode.get('BM')}">
                                            <td th:if="${crackdownStatus.fishingBoat.boatMaterial eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
                                        </th:block>
                                        <th:block th:if="${!#strings.contains(crackdownStatus.fishingBoat.boatMaterial, 'BM')}">
                                            <td th:text="${crackdownStatus.fishingBoat.boatMaterial}"></td>
                                        </th:block>
                                        <td th:text="${crackdownStatus.fishingBoat.boatNnySung}"></td>
                                        <td th:text="${crackdownStatus.fishingBoat.boatNnySi}"></td>
                                        <th:block th:each="sailor:${crackdownStatus.sailorList}">
                                            <td th:if="${sailor.position eq 'POS001'}" th:text="${sailor.sailorNameKr}"></td>
                                            <td th:if="${sailor.position eq 'POS001'}" th:text="${#temporals.format(sailor.birthdate, 'yyyy-MM-dd')}"></td>
                                        </th:block>
                                        <th:block th:if="${#lists.size(crackdownStatus.sailorList) == 0}">
                                            <td></td>
                                            <td></td>
                                        </th:block>
                                        <th:block th:each="commonCode:${session.commonCode.get('FT')}">
                                            <td th:if="${crackdownStatus.fishingBoat.fisheryType eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
                                        </th:block>
                                        <th:block th:if="${!#strings.contains(crackdownStatus.fishingBoat.fisheryType, 'FT')}">
                                            <td th:text="${crackdownStatus.fishingBoat.fisheryType}"></td>
                                        </th:block>
                                        <td th:text="${crackdownStatus.fishingBoat.catchFishSpecies}"></td>
                                        <td th:text="${#numbers.formatInteger(crackdownStatus.fishingBoat.catchCnt, 3, 'COMMA')}"></td>
                                        <td th:text="${crackdownStatus.fishingBoat.offenseFishSpecies}"></td>
                                        <td th:text="${#numbers.formatInteger(crackdownStatus.fishingBoat.offenseCatchCnt, 3, 'COMMA')}"></td>
                                        <td th:text="${#numbers.formatInteger(crackdownStatus.fishingBoat.offenseIllegalWasteQuantity, 3, 'COMMA')}"></td>
                                        <td th:text="${#numbers.formatInteger(crackdownStatus.fishingBoat.offenseQuantity, 3, 'COMMA')}"></td>
                                        <td th:text="${#numbers.formatInteger(crackdownStatus.fishingBoat.offenseAmount, 3, 'COMMA')}"></td>
                                        <td th:text="${crackdownStatus.processResult.processStatus eq 'PR001' ? 1 : 0}"></td>
                                        <td th:text="${crackdownStatus.processResult.processStatus eq 'PR009' ? 1 : 0}"></td>
                                        <td th:text="${crackdownStatus.fishingBoat.damboPayment ne 0 ? 1 : 0}"></td>
                                        <td th:text="${#numbers.formatInteger(crackdownStatus.fishingBoat.damboPayment, 3, 'COMMA')}"></td>
                                        <td th:text="${#temporals.format(crackdownStatus.fishingBoat.paymentPaymentDt, 'yyyy-MM-dd HH:mm')}"></td>
                                        <td th:text="${crackdownStatus.fishingBoat.damboUnpaidAmount ne 0 ? 1 : 0}"></td>
                                        <td th:text="${#numbers.formatInteger(crackdownStatus.fishingBoat.damboUnpaidAmount, 3, 'COMMA')}"></td>
                                        <td th:text="${crackdownStatus.processResult.consignmentStartDt ne null ? 1 : 0}"></td>
                                        <td th:text="${crackdownStatus.processResult.consignmentStartDt}"></td>
                                        <td th:text="${crackdownStatus.processResult.consignmentEndDt}"></td>
                                        <td th:text="${crackdownStatus.processResult.evictionDt ne null ? 1 : 0}"></td>
                                        <td th:text="${crackdownStatus.processResult.directHandoverDt ne null ? 1 : 0}"></td>
                                        <td th:text="${crackdownStatus.processResult.boatDisposalDt ne null && crackdownStatus.processResult.boatDisposalType eq 'BDT001'? 1 : 0}"></td>
                                        <td th:text="${crackdownStatus.processResult.boatDisposalDt ne null && crackdownStatus.processResult.boatDisposalType eq 'BDT002'? 1 : 0}"></td>
                                        <td th:text="${crackdownStatus.processResult.boatDisposalDt ne null && crackdownStatus.processResult.boatDisposalType eq 'BDT003'? 1 : 0}"></td>
                                        <td th:text="${crackdownStatus.processResult.confiscationDt ne null ? 1 : 0}"></td>
                                        <td th:text="${crackdownStatus.processResult.returnDt ne null ? 1 : 0}"></td>
                                        <td th:text="${crackdownStatus.processResult.directHandoverDt}"></td>
                                        <td>
                                            <span th:text="${crackdownStatus.processResult.handoverSeaPointLat}"> ~ </span>
                                            <span th:text="${crackdownStatus.processResult.handoverSeaPointLon}"></span>
                                        </td>
                                        <td th:text="${crackdownStatus.processResult.handoverBoat}"></td>
                                        <td th:text="${crackdownStatus.processResult.middleTakeoverBoat}"></td>
                                        <td th:text="${crackdownStatus.restrictionTotal}"></td>
                                        <td th:text="${crackdownStatus.restrictionCaptin}"></td>
                                        <td th:text="${crackdownStatus.restrictionMate}"></td>
                                        <td th:text="${crackdownStatus.restrictionWarden}"></td>
                                        <td th:text="${crackdownStatus.restrictionSailor}"></td>
                                        <td th:text="${crackdownStatus.processResult.confiscationDt ne null ? 1 : 0}"></td>
                                        <td th:text="${crackdownStatus.notRestrictionTotal}"></td>
                                        <td th:text="${crackdownStatus.notRestrictionCaptin}"></td>
                                        <td th:text="${crackdownStatus.notRestrictionMate}"></td>
                                        <td th:text="${crackdownStatus.notRestrictionWarden}"></td>
                                        <td th:text="${crackdownStatus.notRestrictionSailor}"></td>
                                        <td th:text="${crackdownStatus.processResult.confiscationDt ne null ? 0 : 1}"></td>
                                        <td th:text="${crackdownStatus.fieldIvsgtNapoDt ne null? 1 : 0}"></td>
                                        <td th:text="${#temporals.format(crackdownStatus.fieldIvsgtNapoDt, 'yyyy-MM-dd HH:mm')}"></td>
                                        <td th:text="${#temporals.format(crackdownStatus.fieldIvsgtReleaseDt, 'yyyy-MM-dd HH:mm')}"></td>
                                        <td th:text="${crackdownStatus.fieldIvsgtTimeTaken}"></td>
                                        <td th:text="${crackdownStatus.processResult.pressurizedTimeTaken}"></td>
                                        <td th:text="${crackdownStatus.distance}"></td>
                                        <td th:text="${crackdownStatus.processResult.warrantReqTakeTime}"></td>
                                        <td th:text="${crackdownStatus.fishingBoat.confiscationFrame}"></td>
                                        <td th:text="${crackdownStatus.fishingBoat.confiscationWidth}"></td>
                                        <td th:text="${crackdownStatus.fishingBoat.confiscationJo}"></td>
                                        <td th:text="${crackdownStatus.fishingBoat.confiscationGae}"></td>
                                        <td th:text="${crackdownStatus.fishingBoat.confiscationEtc}"></td>
                                    </tr>
                                </th:block>
                            </tbody>
                        </table>
                    </div>
                    <div class="row justify-content">
                        <button class="btn btn-sm btn-primary col-auto" id="cdsDownExcel">엑셀 다운로드</button>
                        <button class="btn btn-sm btn-primary col-auto" id="crackdownStatusAddBtn">등록</button>
                    </div>
                </div>
            </div>
        </div>

        <div class="modal fade" id="crackdownStatusEditModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="crackdownStatusEditModalLabel" aria-hidden="true">
            <div class="modal-dialog modal-xl modal-dialog-scrollable">
                <div class="modal-content" id="crackdownStatusEditModalContent">

                </div>
            </div>
        </div>
        <div class="modal fade" id="crackdownStatusViewModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="crackdownStatusViewModalLabel" aria-hidden="true">
            <div class="modal-dialog modal-xl modal-dialog-scrollable">
                <div class="modal-content" id="crackdownStatusViewBody">

                </div>
            </div>
        </div>
    </main>
</div>
</html>