<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ page isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%
    String basePath = request.getContextPath();
%>
<div class="table-responsive">
    <table class="table table-striped table-bordered table-hover " >
        <thead>
        <tr>
            <th colspan="2" >数据</th>
            <th colspan="1">API</th>
            <th colspan="2">微应用</th>
        </tr>
        <tr>
            <th>部门</th>
            <th>数据交易统计</th>
            <th>API交易统计</th>
            <th>微应用交易统计</th>
            <th>统计</th>
        </tr>
        </thead>
        <tbody>
        <c:set var="dataCount" value="0"></c:set>
        <c:set var="apiCount" value="0"></c:set>
        <c:set var="weiCount" value="0"></c:set>
        <c:set var="shuTongji1" value="0"></c:set>
        <c:set var="shuTongji2" value="0"></c:set>
        <c:set var="shuTongji3" value="0"></c:set>
        <c:set var="count" value="0"></c:set>
        <c:choose>
            <c:when test="${list!=null}">
                <c:forEach items="${list}" var="item" >
                    <tr>
                        <td>${item.catelogName}</td>
                        <td>${item.dataCount}</td>
                        <c:set var="dataCount" value="${dataCount +(item.dataCount) }" />
                        <td>${item.apiCount}</td>
                        <c:set var="apiCount" value="${apiCount +(item.apiCount) }" />
                        <td>${item.weiCount}</td>
                        <c:set var="weiCount" value="${weiCount +(item.weiCount) }" />
                        <c:set var="hengTongji" value="${hengTongji +(item.dataCount) +(item.apiCount) +(item.weiCount)}" />
                        <td>${hengTongji}</td>
                        <c:set var="hengTongji" value="0"></c:set>

                    <c:set var="shuTongji1" value="${shuTongji1 +(item.dataCount)}" />
                    <c:set var="shuTongji2" value="${shuTongji2 +(item.apiCount)}" />
                    <c:set var="shuTongji3" value="${shuTongji3 +(item.weiCount)}" />
                    </tr>
                </c:forEach>
            </c:when>
            <c:otherwise>
                <tr>
                    <td colspan="4">无数据</td>
                </tr>
            </c:otherwise>
        </c:choose>
        <tr>
            <td>统计</td>
            <td>${shuTongji1}</td>
            <td>${shuTongji2}</td>
            <td>${shuTongji3}</td>
            <c:set var="count" value="${shuTongji1 + shuTongji2 + shuTongji3}" />
            <td>${count}</td>
        </tr>
        </tbody>
    </table>
</div>

<script type="text/javascript">

</script>