Java树结构

   今天在项目中,运用到了Java树结构,是在一个查询中,选择树结构例如图片

  Java树结构_第1张图片

该结构采用了前段的最新的知识,通过xml结构的数据库,后端Spring的映射实现的。

代码示例:

数据库:


    

后台action层:

/**
     * 企业税种分布统计
     * 
     * @return
     */
    @RequiresPermissions("analysis:analysis:getCompanyTaxTwelveTotal")
    @RequestMapping(value = "/analysis/analysis/companyTaxTypeDistribution")
    public String companyTaxTypeDistribution()
    {
        List yearMonthList = companyService.getYearMonth();
        Page page = new Page(request, response);
        page.setPageSize(10);
        
        el.setCurrentMonth(null);
        el.setStartTime(yearMonthList.get(11) + "-01");
        el.setLastTime(yearMonthList.get(0) + "-01");
        
        List taxList = companyService.getElectronicTaxDao().getTaxTypeDistribution(el);
        page = companyService.getTaxTypeDistribution(page, el);
        
        model.addAttribute("taxList", taxList);
        model.addAttribute("page", page);
        model.addAttribute("yearMonthList", yearMonthList);
        
        return "addons/analysis/analysis/companyTaxTypeList";
    }
    

前台页面:

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="org.apache.shiro.web.filter.authc.FormAuthenticationFilter"%>
<%@ include file="../../../admin/defaults/include/header.jsp" %>

  
  
          
  
  
  <%@ include file="../../../admin/defaults/include/treetable.jsp" %>
  
    
class="page" style="overflow:auto;">
class="fixed-empty">
class="breadcrumb form-search"> class="tb-type1 noborder search">
时间跨度: - 金额: class="input-medium"/> - class="input-medium"/> 税种: title="税种" url="/sys/dict/treeData?type=taxtype_code" cssStyle="width:170px;" cssClass="required txt" notAllowSelectParent="false" notAllowSelectRoot="falsse" checked="true" isChild="true" /> class="btn-search " title="查询" οnclick="$('#searchForm').submit();">  class="w120"> 
class="table tb-type2" id="contentTable" style="width:400px; float:left;"> class="tfoot">
税种 金额
${el.taxtypeName}
class="pagination"> ${page }
${item.taxtypeName }
${el.currentMonth } ${item.amount }

 

转载于:https://www.cnblogs.com/bwcx1375/p/7689037.html

你可能感兴趣的:(Java树结构)