<ul class="nav nav-tabs" id="userTab" role="tablist">
	<li class="nav-item" role="presentation">
		<button class="nav-link active" id="fieldTab" data-bs-toggle="tab"
			type="button" role="tab">분야별</button>
	</li>
	<li class="nav-item" role="presentation">
		<button class="nav-link" id="ratingTab" data-bs-toggle="tab"
			type="button" role="tab">평가별</button>
	</li>
</ul>
<div class="card-body">
	<button class="btn btn-primary" id="showMenu">검색조건열기</button>
	<button class="btn btn-success" id="fieldDownExcel">엑셀다운</button>
	<div class="row" id="statisticsDiv">
		<table class="table table-hover table-bordered"
			id="tableData">
			<thead>
				<tr>
					<th rowspan="2">구분</th>
					<th rowspan="2">누계</th>
					<th:block th:unless="${#lists.isEmpty(searchParams.category1)}">
						<th th:colspan="${searchParams.category1.size()}">분류1</th>
					</th:block>
					<th:block th:unless="${#lists.isEmpty(searchParams.category2)}">
						<th th:colspan="${searchParams.category2.size()}">분류2</th>
					</th:block>
					<th:block th:unless="${#lists.isEmpty(searchParams.category3)}">
						<th th:colspan="${searchParams.category3.size()}">분류3</th>
					</th:block>
					<th:block th:unless="${#lists.isEmpty(searchParams.category4)}">
						<th th:colspan="${searchParams.category4.size()}">분류4</th>
					</th:block>
				</tr>
				<tr>
					<th:block th:unless="${#lists.isEmpty(searchParams.category1)}">
						<th:block th:each="commonCode:${session.commonCode.get('DC01')}">
							<th:block
								th:if="${#lists.contains(searchParams.category1, commonCode.itemCd)}">
								<th th:text="${commonCode.itemValue}"></th>
							</th:block>
						</th:block>
					</th:block>
					<th:block th:unless="${#lists.isEmpty(searchParams.category2)}">
						<th:block th:each="commonCode:${session.commonCode.get('DC02')}">
							<th:block
								th:if="${#lists.contains(searchParams.category2, commonCode.itemCd)}">
								<th th:text="${commonCode.itemValue}"></th>
							</th:block>
						</th:block>
					</th:block>
					<th:block th:unless="${#lists.isEmpty(searchParams.category3)}">
						<th:block th:each="commonCode:${session.commonCode.get('DC03')}">
							<th:block
								th:if="${#lists.contains(searchParams.category3, commonCode.itemCd)}">
								<th th:text="${commonCode.itemValue}"></th>
							</th:block>
						</th:block>
					</th:block>
					<th:block th:unless="${#lists.isEmpty(searchParams.category4)}">
						<th:block th:each="commonCode:${session.commonCode.get('DC04')}">
							<th:block
								th:if="${#lists.contains(searchParams.category4, commonCode.itemCd)}">
								<th th:text="${commonCode.itemValue}"></th>
							</th:block>
						</th:block>
					</th:block>
				</tr>
			</thead>
			<tbody class="table-group-divider">
				<th:block th:each="total:${totalList}">
					<tr>
						<td th:text="${total.itemValue}"></td>
						<td th:text="${total.cnt}"></td>
						<th:block th:each="category1:${searchParams.category1}">
							<th:block th:each="type1List:${type1List}">
								<th:block
									th:if="${type1List.affairType eq category1} and ${total.wrtOrgan eq type1List.wrtOrgan}">
									<td th:text="${type1List.cnt}"></td>
								</th:block>
							</th:block>
						</th:block>
						<th:block th:each="category2:${searchParams.category2}">
							<th:block th:each="type2List:${type2List}">
								<th:block
									th:if="${type2List.affairType eq category2} and ${total.wrtOrgan eq type2List.wrtOrgan}">
									<td th:text="${type2List.cnt}"></td>
								</th:block>
							</th:block>
						</th:block>
						<th:block th:each="category3:${searchParams.category3}">
							<th:block th:each="type3List:${type3List}">
								<th:block
									th:if="${type3List.affairType eq category3} and ${total.wrtOrgan eq type3List.wrtOrgan}">
									<td th:text="${type3List.cnt}"></td>
								</th:block>
							</th:block>
						</th:block>
						<th:block th:each="category4:${searchParams.category4}">
							<th:block th:each="type4List:${type4List}">
								<th:block
									th:if="${type4List.affairType eq category4} and ${total.wrtOrgan eq type4List.wrtOrgan}">
									<td th:text="${type4List.cnt}"></td>
								</th:block>
							</th:block>
						</th:block>
					</tr>
				</th:block>
			</tbody>
		</table>
	</div>
</div>