highcharts图形界面(Java从数据库获取值)

1.页面

<%@ page language="java" pageEncoding="UTF-8"
	contentType="text/html; charset=UTF-8"%>
<%@page import="net.e_lian.bpm.core.user.action.WebUser"%>
<%@page import="net.e_lian.bpm.constans.Web"%>
<%@ taglib uri="/struts-tags" prefix="s"%>

<%@ taglib uri="bpm" prefix="o"%>
<%
	WebUser webUser = (WebUser) session
			.getAttribute(Web.SESSION_ATTRIBUTE_FRONT_USER);
	String domainid = webUser.getDomainid();
	String applicationid = request.getParameter("application");
	String path = request.getContextPath();
%>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Highcharts Example</title>
<script src='<s:url value="/script/My97DatePicker/WdatePicker.js"/>'></script>
<script src="../../script/jquery-ui/js/jquery-1.8.3.js"></script>
<script type="text/javascript"
	src="../../script/highcharts/highcharts.js" charset="utf-8"></script>
<script type="text/javascript"
	src="../../script/highcharts/highcharts-more.js"></script>

	<style type="text/css">
.tbInput
{
    border-collapse: collapse;
    width: 100%;
    border: 1px solid #E5F4FB;
    margin-bottom: 5px;
    margin-right: 0px;
    margin-top: 8px;
}
.tdHeadTitle
{

	background-color:#dbf1fe;
    height: 30px;
    background-repeat: repeat-x;
    text-align: left;
    color: #000;
    font-size: 14px;
    font-weight:normal;
    border-left: #e5f4fb 1px solid;
    border-right: #e5f4fb 1px solid;
}
.tdLeft
{
    background: #F8FBFF;
    vertical-align: middle;
    font-size: 12px;
    text-align: right;
    width: 15%;
    border: 1px solid #E5F4FB;
    empty-cells: show;
}
.tdRight
{
    border: 1px solid #E5F4FB;
    empty-cells: show;
    vertical-align: middle;
    padding-left: 5px;
    padding-top: 2px;
    padding-bottom: 2px;
    font-size: 12px;
    width: 85%;
}
.tdRight1
{
    border: 1px solid #E5F4FB;
    empty-cells: show;
    vertical-align: middle;
    padding-left: 5px;
    padding-top: 2px;
    padding-bottom: 2px;
    font-size: 12px;
    width: 35%;
}
.d1 {
	background-color:#F7FAFF;
    height: 30px;
    text-align: center;
    color:#173E5B;
    font-size: 14px;
    border-style:solid;
    border-width:1px;
}
.d2 {
    vertical-align: middle;
    font-size: 12px;
    text-align: center;
    empty-cells: show;
    border-style:solid;
    border-width:1px;
}
.pp{
    border: 1px solid #BDC1C4;
	padding-top:10px;

	width: 100%;

}
#box1{
	border:1px solid #F8FBFF;
    padding-top:10px;
    padding-left:20px;
    padding-right:20px;
    margin:10px;
    height:700px;
}
.yincang{
display:none;
}
.zhidu{
disabled:disabled;
}
.xianshi{
display:block;
}
.div2{
	 margin-top:10px;
}
.div1{
border:1px solid #000;
margin-top:1170px;

}
.ddd{
padding-right:80px;
}
	</style>
<script type="text/javascript">
var contextPath='<%=path%>';
var domainid='<%=domainid%>';
var applicationid='<%=applicationid%>';
var bg=0;//主要用来判断继续分析后面有无单选项
var c="";//关联分析y轴未转码值
var s="";//关联分析series的未转码值
var  conditions="";//关联分析y轴已转码值
var  seriesname="";//关联分析series的已转码值
var  tjsj="";//接收选择柱状图条件
var  sjsz="";//接收继续关联选中复选框值
var  titles="";//highscharts标题
var fxk;//所选复选框文本内容
var fxk1;//所选复选框文本内容]
var yysj=new Array();//医院name值
var wpdlname=new Array();//物品大类name值
var wpzlname=new Array();//物品中类name值
var checksj=new Array();//录入数据复选框的name值

$(function(){

	 document.getElementById('jixuguanlian').className='yincang';
	  var quxz="<table border=1 cellSpacing=0 cellPadding=0 align=left rules=all class='pp' > <tr><td class='tdHeadTitle' colSpan='4' style='border-bottom: #b4ccee 1px solid; border-left: #b4ccee 1px solid; border-top: #b4ccee 1px solid; border-right: #b4ccee 1px solid'>Ⅰ区域选择";//
	  var htmlfd="<table border=1 cellSpacing=0 cellPadding=0 align=left rules=all class='pp' > <tr><td class='tdHeadTitle' colSpan='4' style='border-bottom: #b4ccee 1px solid; border-left: #b4ccee 1px solid; border-top: #b4ccee 1px solid; border-right: #b4ccee 1px solid'>Ⅱ患者一般信息</td></tr><tr><td class='tdLeft'>基本信息:</td><td class='tdRight' colSpan='3'>姓名:<input id='xm' type='text' > <br>性别:<input  name='xb' type='radio' value='1'   />男  <input  name='xb'  type='radio' value='2' />女 <br>联系电话:<input  name='dh' type='radio' value='1'  />有<input  name='dh'  type='radio' value='2' /> 无<br></td></tr>";//物品名称
	  var bms=["HJ_dic","WHCD2015_dic","ZY_dic","SHFSYY_dic","SHFSDD_dic","SHFSSHD2015_dic","SFGY_dic","YJQK_dic","SHXZ_dic","SHBW2015_dic","SHLJXT_dic","SHYZCD_dic","SHJJ2015_dic","CPSYGX_dic","DXAL_dic"];
	  var bname=["户籍","受教育程度","职业","伤害发生原因","伤害发生地点","伤害发生时活动","是否故意"," 饮酒情况","伤害性质","伤害部位","伤害累及系统","伤害严重程度","伤害结局","与该产品使用的关系"," 典型案例"];
	  var zd=["VC_HJ","VC_WHCD","VC_ZY","VC_SHFSYY","VC_SHFSDD","VC_SHFSSHD","VC_SFGY","VC_YJQK","VC_SHXZ","VC_SHBW","VC_SHLJXT","VC_SHYZCD","VC_SHJJ","VC_CPZLSFYG","VC_DXALLX"];
	  var tdleft="";//录入表数据
	  var table1="";
	  var qyleft="";//区域数据
	  var sfgy="";//是否故意数据项
	  var r=0;
	  var qy=new Array();//医院区域

	  //自动获取录入表数据
		$.ajax({
		url : contextPath + "/portal/custom/getDataItem.action",
		dataType : 'json',
	   success: function(item_objid){
				var json = eval(item_objid);
				for(var i=0;i<bms.length;i++){
					if(bms[i]!="SFGY_dic"){
					tdleft+="<tr> <td class='tdLeft' >"+bname[i]+"<input type=checkbox name=All"+i+" onclick=\"checkAll('mm"+i+"')\">:</td><td class='tdRight' colSpan='3'>";
					}
					for(var key in json.list){

						 if(json.list[key].formname.indexOf(bms[i]) > 0){
							 if(json.list[key].formname.indexOf("SFGY_dic") > 0){
								sfgy+="<input type=checkbox name=sfgy  value=\""+json.list[key].item_objid+"\" onclick=\"checkItem('sfgy1')\">"+json.list[key].item_objjc;
							 }else{
							  tdleft+="<input type=checkbox name=mm"+i+"  value=\""+bms[i]+","+zd[i]+","+json.list[key].item_objid+","+bname[i]+"\" onclick=\"checkItem('All"+i+"')\">"+json.list[key].item_objjc;
							 }
						 }

					}
					checksj[i]="mm"+i;

					tdleft+="</td></tr>";
					if(i==2){
						tdleft+="<tr><td class='tdHeadTitle' colSpan='4' style='border-bottom: #b4ccee 1px solid; border-left: #b4ccee 1px solid; border-top: #b4ccee 1px solid; border-right: #b4ccee 1pxsolid'>Ⅲ 伤害事件的基本情况</td></tr>";
					}
					if(i==7){
						tdleft+="<tr><td class='tdHeadTitle' colSpan='4' style='border-bottom: #b4ccee 1px solid; border-left: #b4ccee 1px solid; border-top: #b4ccee 1px solid; border-right: #b4ccee 1pxsolid'> Ⅳ 伤害临床信息</td></tr>";
					}
					if(i==11){
						tdleft+="<tr><td class='tdLeft'>伤害临床诊断:</td><td class='tdRight' colSpan='3'><input id='LCZD' type='text' ></td></tr>";
					}
				}

				table1=htmlfd+tdleft+"<tr><td  align=right colspan='4'><button id='tongji' type='button'   onclick=\"Highscat()\" >统计</button></td></tr></table>";
				document.getElementById("aaaaaas"). innerHTML=table1;
				document.getElementById("sfgy"). innerHTML=sfgy;

				//document.getElementById("aaaaaas").innerText=table1;

			}
		});
	  //自动获取区域数据
		$.ajax({
			url : contextPath + "/portal/custom/getAreaDic.action",
			dataType : 'json',
		   success: function(code){
					var json = eval(code);
					for(var key in json.list){
						qy[r]=json.list[key].qy;
						r++;
					}
					uniqueArray(qy);
					for(var i=0;i<qy.length;i++){
						qyleft+="<tr> <td class='tdLeft' >"+qy[i]+"<input type=checkbox name=Agg"+i+" onclick=\"checkAll('mg"+i+"')\">:</td><td class='tdRight' colSpan='3'>";
						for(var key in json.list){

							 if(json.list[key].qy==(qy[i])){

								 qyleft+="<input type=checkbox name=mg"+i+"  value=\""+json.list[key].code+"\" onclick=\"checkItem('Agg"+i+"')\">"+json.list[key].ares; 

							 }

						}
						yysj[i]="mg"+i;

						qyleft+="</td></tr>";

					}
					document.getElementById("qysj"). innerHTML=quxz+qyleft+"</table>";
					//document.getElementById("aaaaaas"). innerText=htmlfd+qyleft+"</table>";

			}
		});
		 //var selects = document.getElementById('selectData1');
		   //selects.length = 0;
		var wpsj="<table border=1 cellSpacing=0 cellPadding=0 align=left rules=all class='pp' > <tr> <td class='tdLeft'  >物品大类<input type=checkbox name=wpdl1 onclick=\"checkAll('wpdl')\" >:</td><td class='tdRight' colSpan='3'> ";//

		$.ajax({
			url : contextPath + "/portal/custom/getWpdldic.action",
			dataType : 'json',
		   success: function(dlid){
					var json = eval(dlid);

					for(var key in json.list){
						wpsj+="<input type=checkbox    name=wpdl  value=\""+json.list[key].dlid+"\" onclick=\"checkItem('wpdl1')\" onchange=\"getSelectData2(this.value)\">"+json.list[key].dlname; 

					   	 //var objid= json.list[key].dlid;
					     //var objjc= json.list[key].dlname;
						 //selects.options.add(new Option(objjc,objid));
					}
					wpsj+="</td></tr> <tr>  <td id='wpzls' class='tdLeft'  >物品中类 <input type=checkbox name=wpzl1 onclick=\"checkAll('wpzl')\">:</td><td id='wpzl' class='tdRight' colSpan='3'> </tr><tr>  <td id='wpxls' class='tdLeft'  >物品小类 <input type=checkbox name=wpxl1 onclick=\"checkAll('wpxl')\">:</td><td id='wpxl' class='tdRight' colSpan='3'> </tr><tr><td class='tdLeft'>物品名称:</td><td class='tdRight1' colSpan='3'><input id='wpname' type='text' /></td></tr>";
					document.getElementById("wpsj"). innerHTML=wpsj+"</table>";

			}
		})

	});
	function checkAll(str)
	{
    var a = document.getElementsByName(str);
    var n = a.length;
    for (var i=0; i<n; i++)
    a[i].checked = window.event.srcElement.checked;
	 	if(str=="wpdl"){
	 		getSelectData2("wpdl");

	 	}
		if(str=="wpzl"){
	 		getSelectData3("wpzl");

	 	}
	}
	function getSelectData2(dataid){

		var wpzl="<br />";
		var wpzls=0;
		var wpdlsj="";//所有复选框的值 传递给后台
		var wpdlss=new Array();//所有复选框的值 前台用
		var str=document.getElementsByName("wpdl");
			for (i=0;i<str.length;i++)
			{
			  if(str[i].checked == true)
			  {
			   wpdlsj+=str[i].value+"::";
			  }
			}
		wpdlss=wpdlsj.split("::");
		$.ajax({
		dataType : 'json',
		data: {"id":wpdlsj},
		url : contextPath + "/portal/custom/getWpzldic.action",
		 success: function(zlid){
				var json = eval(zlid);
				for(var i=0;i<wpdlss.length;i++){
					for(var key in json.list){
						if(wpdlss[i]==json.list[key].dlid){
						wpzl+="<input type=checkbox name=wpzl  value=\""+json.list[key].zlid+"\" onclick=\"checkItem('wpzl1')\" onchange=\"getSelectData3(this.value)\">"+json.list[key].zlname; 

						}

					}
				wpzl+="<br />";
				}

				document.getElementById("wpzls").innerHTML="物品中类 <input type=checkbox name=wpzl1 onclick=\"checkAll('wpzl')\">:";
				document.getElementById("wpzl").innerHTML=wpzl;
				document.getElementById("wpxls").innerHTML="物品小类 <input type=checkbox name=wpxl1 onclick=\"checkAll('wpxl')\">:";
				document.getElementById("wpxl").innerHTML="";

		}
		})

	};
	function getSelectData3(dataid){
		 var wpxl="<br />";
			var wpdlsj="";//所有复选框的值 传递给后台
			var wpdlss=new Array();//所有复选框的值 前台用

				var str=document.getElementsByName("wpzl");

				for (i=0;i<str.length;i++)
				{
				  if(str[i].checked == true)
				  {
				   wpdlsj+=str[i].value+"::";
				  }
				}  

			 wpdlss=wpdlsj.split("::");
		$.ajax({
		dataType : 'json',
		data: {"id":wpdlsj},
		url : contextPath + "/portal/custom/getWpxldic.action",
		 success: function(xlid){
				var json = eval(xlid);
				for(var i=0;i<wpdlss.length;i++){
					for(var key in json.list){
						if(wpdlss[i]==json.list[key].zlid){
						wpxl+="<input type=checkbox name=wpxl  value=\""+json.list[key].xlid+"\" onclick=\"checkItem('wpxl1')\" >"+json.list[key].xlname;
						}

					}
					wpxl+="<br />";
				}
				document.getElementById("wpxls").innerHTML="物品小类 <input type=checkbox name=wpxl1 onclick=\"checkAll('wpxl')\">:";

				document.getElementById("wpxl").innerHTML=wpxl;

		}
		})
	};
	function checkItem(str)
	{
    var e = window.event.srcElement;
    var all = eval("document.all."+ str);
	    if (e.checked)
	    {
	        var a = document.getElementsByName(e.name);
	        all.checked = true;
	        for (var i=0; i<a.length; i++)
	        {
	            if (!a[i].checked)
	            {
	                all.checked = false; break;
	            }
	        }
	    }
    else
        all.checked = false;
	}; 

	//数组去重
	 function uniqueArray(data){
		   data = data || [];
		   var a = {};
		   for (var i=0; i<data.length; i++) {
		       var v = data[i];
		       if (typeof(a[v]) == 'undefined'){
		            a[v] = 1;
		       }
		   };
		   data.length=0;
		   for (var i in a){
		        data[data.length] = i;
		   }
		   return data;
		}; 

	function Highscat() {
		var sfgysj="";//是否故意
		var sfgj=document.getElementsByName("sfgy");
			for (i=0;i<sfgj.length;i++)
			{
				  if(sfgj[i].checked == true)
			 {
					  sfgysj+=sfgj[i].value+"::";
				 }
				}
		if(sfgysj== ""){
			alert("是否故意必须填写!");
		}else{
		var chestr="";//所有复选框的值
		var rnt=new Array();
		 for(var jj=0;jj<checksj.length;jj++){
		var str=document.getElementsByName(checksj[jj]);
		var jjk="";//一类复选框的值
			for (i=0;i<str.length;i++)
			{
			  if(str[i].checked == true)
			  {
			   chestr+=str[i].value+";";
			   jjk+=str[i].value+";";
			  }
			}
			if(jjk == ""){

			}else{
				chestr+="::";//主要用来区分多少个不同类的复选框有值
			}
		}
		if(chestr == "")
		{
		  alert("请选择两类数据进行关联分析!");
		}
		else
		{
		  rnt=chestr.split("::");
		  if(rnt.length==2){
			  alert("必须选择两类复选框");
		  }else if(rnt.length>3){
			alert("只能选择两类复选框");
		  }else{
			  var shujuss=new Array();
				var table1=new Array();
				var table2=new Array();
				var table4=new Array();
				var table5=new Array();
				shujuss=chestr.split("::");
				table1=shujuss[0].split(";");
				table2=shujuss[1].split(";");
				table4=table1[0].split(",");
				table5=table2[0].split(",");
				 fxk=table4[3];//所选复选框文本内容
			 fxk1=table5[3];//所选复选框文本内容
				var bm=table4[0];
				var bm1=table5[0];
			 document.getElementById(bm).className='yincang';
		    	document.getElementById(bm1).className='yincang';
		var starttime=document.getElementById('shfssj').value;//伤害开始时间
		var shendtime=document.getElementById('shjssj').value;//伤害结束时间
		var gxstarttime=document.getElementById('sjgxsj').value;//数据更新开始时间
		var gxendtime=document.getElementById('gxjssj').value;//数据更新结束时间
		var wpdlsj="";//物品大类
		var wpdl=document.getElementsByName("wpdl");
			for (i=0;i<wpdl.length;i++)
			{
			  if(wpdl[i].checked == true)
			  {
			   wpdlsj+=wpdl[i].value+"::";
			  }
			}
		var wpzlsj="";//物品中类
			var wpzl=document.getElementsByName("wpzl");
				for (i=0;i<wpzl.length;i++)
				{
				  if(wpzl[i].checked == true)
				  {
					  wpzlsj+=wpzl[i].value+"::";
				  }
				}
		var wpxlsj="";//物品小类
			var wpxl=document.getElementsByName("wpxl");
				for (i=0;i<wpxl.length;i++)
				{
					  if(wpxl[i].checked == true)
				 {
						  wpxlsj+=wpxl[i].value+"::";
					 }
					}
		//var wpdl=document.getElementById('selectData1').value;//物品大类
		//var wpzl=document.getElementById('selectData2').value;//物品中类
		//var wpxl=document.getElementById('selectData3').value;//物品小类
		var wpmc=encodeURIComponent(document.getElementById('wpname').value);//物品名称
		var LCZD= encodeURIComponent(document.getElementById('LCZD').value);//临床诊断
		var yyvalues="";//所有医院的值
		var rnt=new Array();
		 for(var jj=0;jj<yysj.length;jj++){
		var str=document.getElementsByName(yysj[jj]);
		var jjk="";//一类复选框的值
			for (i=0;i<str.length;i++)
			{
			  if(str[i].checked == true)
			  {
			   yyvalues+=str[i].value+";";
			   jjk+=str[i].value+";";
			  }
			}
			if(jjk == ""){

			}else{
				yyvalues+="::";//主要用来区分多少个不同类的复选框有值
			}
		}

		var lx=1;//类型
	    var xm= encodeURIComponent(document.getElementById('xm').value);//对汉字进行转码
	    var chestr= encodeURIComponent(chestr);//对汉字进行转码
	    var xb1="";
		var xb=document.getElementsByName('xb');//性别
	  	for(var i=0; i<xb.length; i ++){
	        if(xb[i].checked){
	            xb1=xb[i].value;
	        }
	    }
	  	var dh1="";
		var dh=document.getElementsByName('dh');//联系电话
	  	for(var i=0; i<dh.length; i ++){
	        if(dh[i].checked){
	            dh1=dh[i].value;
	        }
	    }
		var r=0;
		var htmlfd="<table border=1 cellSpacing=0 cellPadding=0 align=left rules=all class='pp' ><tr><td class='d1'></td>";//物品名称
		//var wpname="<tr><td class='d1'>伤害人次</td>";//伤害人次表格
		var sjbg="<table border=1 cellSpacing=0 cellPadding=0 align=left rules=all class='pp' ><tr><td class='d1'></td>";//关联分析图表格
		var jjjj=new Array();//x轴值
		var xtext =new Array();//y轴
		var bkl=new Array() ;//人次
		var options;
		$.ajax({
			type : 'get',
			url : contextPath + "/portal/custom/getCdcgl.action",
			dataType : 'json',
			data: {"checks":chestr,"xm":xm,"xb":xb1,"dh":dh1,"lx":lx,"starttime":starttime,"shendtime":shendtime,"gxstarttime":gxstarttime,"gxendtime":gxendtime,"wpdl":wpdlsj,"wpzl":wpzlsj,"wpxl":wpxlsj,"wpname":wpmc,"yys":yyvalues,"sfgy":sfgysj,"LCZD":LCZD},//给后台传值
			success : function(data) {
				var json = eval(data);
				for(var key in json.list){
					jjjj[r]=json.list[key].glgx;
				    xtext[r] = json.list[key].name;
				    r++;

				}
				uniqueArray(jjjj);
				uniqueArray(xtext);

				for (var jk=0;jk<xtext.length;jk++){
					var hj="test"+jk;
					bkl[jk]=hj;
				}

				for (var jk=0;jk<jjjj.length;jk++){
					sjbg+="<td class='d1'>"+jjjj[jk]+"</td>";
				}

				sjbg+="</tr>";

				for (var jk=0;jk<xtext.length;jk++){
					  bkl[jk]=new Array();
					  sjbg+="<tr><td class='d1'>"+xtext[jk]+"</td>";

					for (var i=0;i<jjjj.length;i++){
						bkl[jk][i]=0;
						var bgss="<td class='d2'>0</td>";
						for(var key in json.list){
							var nnn=json.list[key].glgx;
							var mmmm=json.list[key].name;
							if((xtext[jk]==(mmmm))&&(jjjj[i]==(nnn))){
								bkl[jk][i]=json.list[key].data;
								bgss="<td class='d2'>"+json.list[key].data+"</td>";
							}
						}
						sjbg+=bgss;
					}
					sjbg+="</tr>";
					options.series[jk].name=xtext[jk];
					options.series[jk].data=bkl[jk];
				}
				document.getElementById("biaoge").innerHTML=sjbg+"</table>";
				chart = new Highcharts.Chart(options);
				for(var i=0;i<20;i++){
					if(chart.series.length>xtext.length){
						var j=chart.series.length;
						chart.series[j-1].remove();
					}
				}

			},
			error : function(e) {
				alert("error: " + e.responseText);
			}
		});

		document.getElementById('container').className='div1';

		 options = {
		        chart: {
		        	renderTo:'container',
		            type: 'column'
		        },
		        title: {
		            text: fxk+"与"+fxk1+"关联分析图"
		        },
		        subtitle: {
		            text: ''
		        },
		        xAxis: {
		            categories:jjjj
		        },
		        yAxis: {
		            min: 0,
		            title: {
		                text: ''
		            }
		        },
		        tooltip: {
		            headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
		            pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
		                '<td style="padding:0"><b>{point.y:.1f} 人次</b></td></tr>',
		            footerFormat: '</table>',
		            shared: true,
		            useHTML: true
		        },
		        plotOptions: {
		        	/*series : {
		        		events : {
		        		legendItemClick: function(event) {
		        		alert("点击了:"+this.name);
		        		}
		        		}
		        		},*/
		            column: {
		                pointPadding: 0.2,
		                borderWidth: 0,
		                point: {
		                    events: {
		                        click: function (e) {
		                        	c=e.point.category;
		                        	s=e.point.series.name;
		                        	conditions= encodeURIComponent(e.point.category);//对汉字进行转码

		                        	  seriesname=encodeURIComponent(e.point.series.name);
		                        	document.getElementById('jixuguanlian').className='xianshi';
		                        	document.getElementById('box1').className='yincang';
		                        	//var  conditions=encodeURI(encodeURI(e.point.category));
		                        	//var  seriesname=encodeURI(encodeURI(e.point.series.name));
		                        	//window.open(contextPath+'/portal/share/custom/highcharts/CDCSkip.jsp?_formid=11e5-3738-24a2e744-8637-0d6c93828b97&conditions='+conditions+'&seriesname='+seriesname,'_self','width=200,height=100');

		                        }
		                    }
		                }
		            }
		        },
		        series: [
		                 {
		                 },{
		                 },{
		                 },{
		                 }, {
		                 },{
		                 },{
		                 },{
		                 }, {
		                 },{
		                 },{
		                 },{
		                 }, {
		                 },{
		                 },{
		                 },{
		                 }
     					 /*<c:forEach var="x" begin="0" end="11">
     					{},
     					</c:forEach>*/
						]
		    };
		  }
		}
	  }
	};
	function Highscat1() {

		document.getElementById('box1').disabled="disabled";//设定div为只读
		document.getElementById('tongji').disabled="disabled";//设定button按钮只读

		var xtext =new Array();//X轴TEXT
		var ytext =new Array();//Y轴
		var Sname =new Array();//serres name属性值
		var name;//serres name属性值
		var r=0;
		var options;
		var sj="";//当前的
		var radios = document.getElementsByName("sj");
		var sjbg="<table border=1 cellSpacing=0 cellPadding=0 align=left rules=all class='pp' ><tr>";//关联分析图表格
		var bgsj="<tr>";//次数
	    //根据 name集合长度 遍历name集合
	    for(var i=0;i<radios.length;i++)
	    {
	        //判断那个单选按钮为选中状态
	        if(radios[i].checked)
	        {
	            //弹出选中单选按钮的值
	            sj=radios[i].value;
	            radios[i].checked=false;
	        }
	    }
	  	if(sj == "")
		{
		  alert("请选择一项数据");
		}else{
		Sname=sj.split(",");
		sjsz=sjsz+Sname[0]+","+Sname[1]+";";
		bm2=Sname[0];
		name=Sname[2];
		document.getElementById('box1').className='xianshi';
    	document.getElementById('jixuguanlian').className='yincang';
    	document.getElementById(bm2).className='yincang';
		$.ajax({
			type : 'get',
			url : contextPath + "/portal/custom/getCDCcontinuegl.action",
			dataType : 'json',
			data: {"seriesname":seriesname,"conditions":conditions,"sj":sj,"tjsj":tjsj,"sjsz":sjsz},
			success : function(data) {
				var json = eval(data);
				for(var key in json.list){
				    json.list[key].y = json.list[key].data; //给Y轴赋值
				    sjbg+="<td class='d1'>"+json.list[key].name+"</td>";
				    bgsj+="<td class='d2'>"+json.list[key].data+"</td>";
				    xtext[r] = json.list[key].name;//给X轴TEXT赋值
				    r++;
				    json.list[key].color= "#558ED5";
				}
				sjbg+="</tr>";
				bgsj+="</tr>";
				document.getElementById("biaoge").innerHTML=sjbg+bgsj+"</table>";

				    chart.series[0].setData(json.list);//数据填充到highcharts上面

			},
		});
		document.getElementById('container').className='div1';

		var chart = new Highcharts.Chart({
			chart : {
				renderTo : 'container',
				type : 'column' //显示类型 柱形
			},
			title : {
				text: fxk+"/"+s+"---->"+fxk1+"/"+c+titles+"---->"+name+"关联分析图"//图表的标题
			},
			plotOptions: {
			    column: {
			        pointWidth: 30,//设定柱子宽度
			        point: {
	                    events: {
	                        click: function (e) {
	                        	//alert(event.point.y);
	                        	//alert(event.point.category);
	                        	//var  conditions=encodeURI(encodeURI(e.point.category));

	                        	//window.open(contextPath+'/portal/share/custom/highcharts/CDCSkip1.jsp?_formid=11e5-3738-24a2e744-8637-0d6c93828b97&conditions1='+conditions,'_self');
	                        	if(bg<8){
		                        	titles=titles+"--->"+name+"/"+e.point.category;
		                        	tjsj=tjsj+encodeURIComponent(e.point.category);
		                        	bg++;
		                        	document.getElementById('jixuguanlian').className='xianshi';
		                        	document.getElementById('box1').className='yincang';
	                        	}
	                        }
	                    }
	                }
			    },

			},
			xAxis : {
				categories : xtext
			},
			yAxis : {
				min: 0,
				title : {
					text : '伤害次数' //Y轴的名称
				},
			},
 			series : [ {
				name : name
			} ]
		});

		}
		};

</script>
</head>
<body>

	<div id="box1" >

	<table border=1 cellSpacing=0 cellPadding=0 align=center class='tbInput' >
	<tr>
	<td class='tdLeft'>
	伤害发生时间:
	</td>
	<td class='tdRight1'>
		<input id="shfssj" type="text" class="Wdate" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd ',maxDate:'#F{$dp.$D(\'shjssj\')||\'2020-10-01\'}'})"/>
	</td>
	<td class='tdLeft'>
	至
	</td>
	<td class='tdRight1'>
		<input id="shjssj" type="text" class="Wdate" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd ',minDate:'#F{$dp.$D(\'shfssj\')}',maxDate:'2020-10-01'})"/>
	</td>
	</tr>
	<tr>
	<td class='tdLeft'>
	数据更新时间:
	</td>
	<td class='tdRight1'>
		<input id="sjgxsj" type="text" class="Wdate" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd ',maxDate:'#F{$dp.$D(\'gxjssj\')||\'2020-10-01\'}'})"/>
	</td>
	<td class='tdLeft'>
	至
	</td>
	<td class='tdRight1'>
		<input id="gxjssj" type="text" class="Wdate" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd ',minDate:'#F{$dp.$D(\'sjgxsj\')}',maxDate:'2020-10-01'})"/>
	</td>
	</tr>
	<tr>
	<td class='tdLeft'  >是否故意<font color='red'>*</font> <input type=checkbox name=sfgy1 onclick="checkAll('sfgy')">:
	</td>
	<td id='sfgy' class='tdRight' colSpan='3'>
	</td>
	</tr>
	</table>

	<div id="wpsj"  ></div>
	<div id="qysj"  ></div>

	<div id="aaaaaas"  class='div2'  ></div>

	<div id="container"  ></div>

	<div id="biaoge"  class='div2'  ></div>
	</div>

		<div id="jixuguanlian" >
	<table border=1 cellSpacing=0 cellPadding=0 align=center class='tbInput' style="width:50%" >
	<tr>

	<td class='tdLeft' style="width:10%" >
	数据:
	</td>
	<td class='tdRight1'>
<font   id="HJ_dic" ><input  name="sj" type="radio"  value="HJ_dic,VC_HJ,户籍"  >户籍</font>
<font id="WHCD2015_dic" ><input name="sj" type="radio" value="WHCD2015_dic,VC_WHCD,受教育程度"  >受教育程度</font>
<font  id="ZY_dic" ><input name="sj" type="radio"  value="ZY_dic,VC_ZY,职业"  >职业</font>
<font id="SHFSYY_dic" ><input name="sj" type="radio" value="SHFSYY_dic,VC_SHFSYY,伤害发生原因"  >伤害发生原因</font><br/>
<font  id="SHFSDD_dic" ><input name="sj" type="radio"  value="SHFSDD_dic,VC_SHFSDD,伤害发生地点"  >伤害发生地点</font>
<font id="SHFSSHD2015_dic" ><input name="sj" type="radio"  value="SHFSSHD2015_dic,VC_SHFSSHD,伤害发生时活动"  >伤害发生时活动</font>
<font id="SFGY_dic" ><input name="sj" type="radio"  value="SFGY_dic,VC_SFGY,是否故意"  >是否故意</font>
<font id="YJQK_dic" ><input name="sj" type="radio"  value="YJQK_dic,VC_YJQK,饮酒情况"  >饮酒情况</font><br/>
<font  id="SHXZ_dic" ><input name="sj" type="radio" value="SHXZ_dic,VC_SHXZ,伤害性质"  >伤害性质</font>
<font  id="SHBW2015_dic" ><input name="sj" type="radio"  value="SHBW2015_dic,VC_SHBW,伤害部位"  >伤害部位</font>
<font  id="SHLJXT_dic" ><input name="sj" type="radio" value="SHLJXT_dic,VC_SHLJXT,伤害累及系统"  >伤害累及系统</font>
<font id="SHYZCD_dic" ><input name="sj" type="radio" value="SHYZCD_dic,VC_SHYZCD,伤害严重程度"  >伤害严重程度</font> <br/>
<font id="SHJJ2015_dic" ><input name="sj" type="radio" value="SHJJ2015_dic,VC_SHJJ,伤害结局"  >伤害结局</font>
<font id="CPSYGX_dic" ><input name="sj" type="radio" value="CPSYGX_dic,VC_CPZLSFYG,与该产品使用的关系"  >与该产品使用的关系</font>
<font  id="DXAL_dic" ><input name="sj" type="radio" value="DXAL_dic,VC_DXALLX,典型案例"  >典型案例</font>
	</td>
	</tr>

	<tr>
	<td  align=right colspan=2>
	<button  type="button"   onclick="Highscat1()" >继续统计</button>
	</td>
	</tr>
	</table>
	</div>

</body>

</html>

2.创建xml文件

<!DOCTYPE struts PUBLIC
        "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
        "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<!-- domain package -->
	<package name="highcharts-front" extends="bpm-default"
		namespace="/portal/custom">

		<action name="qureybyid"
			class="net.e_lian.bpm.custom.highcharts.action.highchartsDateAction"
			method="QureyByid">
			<result name="success" type="dispatcher">
				/portal/share/custom/highcharts/highcharts-index.jsp
			</result>
			<interceptor-ref name="params" />
		</action>
		<action name="demo3"
			class="net.e_lian.bpm.custom.highcharts.action.highchartsDateAction"
			method="demo3">
			<interceptor-ref name="params" />
		</action>
		<action name="getHighChartsData"
			class="net.e_lian.bpm.custom.highcharts.action.highchartsDateAction"
			method="getHighChartsData">
			<result name="success" type="dispatcher">
				/portal/share/custom/highcharts/highchartsDemo.jsp
			</result>
			<interceptor-ref name="params" />
		</action>

		<action name="getCdcgl"
			class="net.e_lian.bpm.custom.highcharts.action.highchartsDateAction"
			method="getCdcgl">
			<result name="success" type="dispatcher">
				/portal/share/custom/highcharts/highchartsDemo.jsp
			</result>
			<interceptor-ref name="params" />
		</action>
			<action name="getCDCcontinuegl"
			class="net.e_lian.bpm.custom.highcharts.action.highchartsDateAction"
			method="getCDCcontinuegl">
			<result name="success" type="dispatcher">
				/portal/share/custom/highcharts/highchartsDemo.jsp
			</result>
			<interceptor-ref name="params" />
		</action>
			<action name="getCDCdh"
			class="net.e_lian.bpm.custom.highcharts.action.highchartsDateAction"
			method="getCDCdh">
			<result name="success" type="dispatcher">
				/portal/share/custom/highcharts/highchartsDemo.jsp
			</result>
			<interceptor-ref name="params" />
		</action>
				<action name="getCDCxc"
			class="net.e_lian.bpm.custom.highcharts.action.highchartsDateAction"
			method="getCDCxc">
			<result name="success" type="dispatcher">
				/portal/share/custom/highcharts/highchartsDemo.jsp
			</result>
			<interceptor-ref name="params" />
		</action>
			<action name="getCDCzl"
			class="net.e_lian.bpm.custom.highcharts.action.highchartsDateAction"
			method="getCDCzl">
			<result name="success" type="dispatcher">
				/portal/share/custom/highcharts/highchartsDemo.jsp
			</result>
			<interceptor-ref name="params" />
		</action>
			<action name="getDataItem"
			class="net.e_lian.bpm.custom.highcharts.action.highchartsDateAction"
			method="getDataItem">
			<result name="success" type="dispatcher">
				/portal/share/custom/highcharts/highchartsDemo.jsp
			</result>
			<interceptor-ref name="params" />
		</action>
			<action name="getWSDataItem"
			class="net.e_lian.bpm.custom.highcharts.action.highchartsDateAction"
			method="getWSDataItem">
			<result name="success" type="dispatcher">
				/portal/share/custom/highcharts/highchartsDemo.jsp
			</result>
			<interceptor-ref name="params" />
		</action>

		<action name="getOnlnegl"
			class="net.e_lian.bpm.custom.highcharts.action.highchartsDateAction"
			method="getOnlnegl">
			<result name="success" type="dispatcher">
				/portal/share/custom/highcharts/highchartsDemo.jsp
			</result>
			<interceptor-ref name="params" />
		</action>
				<action name="getOnlinecontinuegl"
			class="net.e_lian.bpm.custom.highcharts.action.highchartsDateAction"
			method="getOnlinecontinuegl">
			<result name="success" type="dispatcher">
				/portal/share/custom/highcharts/highchartsDemo.jsp
			</result>
			<interceptor-ref name="params" />
		</action>

			<action name="getHighChartsOnline"
			class="net.e_lian.bpm.custom.highcharts.action.highchartsDateAction"
			method="getHighChartsOnline">
			<result name="success" type="dispatcher">
				/portal/share/custom/highcharts/highchartsDemo.jsp
			</result>
			<interceptor-ref name="params" />
		</action>
		<action name="getWpStatistics"
			class="net.e_lian.bpm.custom.highcharts.action.highchartsDateAction"
			method="getWpStatistics">
			<result name="success" type="dispatcher">
				/portal/share/custom/highcharts/highchartsDemo.jsp
			</result>
			<interceptor-ref name="params" />
		</action>
			<action name="getOnlineWpStatistics"
			class="net.e_lian.bpm.custom.highcharts.action.highchartsDateAction"
			method="getOnlineWpStatistics">
			<result name="success" type="dispatcher">
				/portal/share/custom/highcharts/highchartsDemo.jsp
			</result>
			<interceptor-ref name="params" />
		</action>

			<action name="getWpname"
			class="net.e_lian.bpm.custom.highcharts.action.highchartsDateAction"
			method="getWpname">
			<result name="success" type="dispatcher">
				/portal/share/custom/highcharts/highchartsDemo.jsp
			</result>
			<interceptor-ref name="params" />
		</action>
		<action name="getWpNumber"
			class="net.e_lian.bpm.custom.highcharts.action.highchartsDateAction"
			method="getWpNumber">
			<result name="success" type="dispatcher">
				/portal/share/custom/highcharts/highchartsDemo.jsp
			</result>
			<interceptor-ref name="params" />
		</action>
		<action name="getWpzldic"
			class="net.e_lian.bpm.custom.highcharts.action.highchartsDateAction"
			method="getWpzldic">
			<result name="success" type="dispatcher">
				/portal/share/custom/highcharts/highchartsDemo.jsp
			</result>
			<interceptor-ref name="params" />
		</action>
			<action name="getPm"
			class="net.e_lian.bpm.custom.highcharts.action.highchartsDateAction"
			method="getPm">
			<result name="success" type="dispatcher">
				/portal/share/custom/highcharts/highchartsDemo.jsp
			</result>
			<interceptor-ref name="params" />
		</action>

				<action name="getDHsj"
			class="net.e_lian.bpm.custom.highcharts.action.highchartsDateAction"
			method="getDHsj">
			<result name="success" type="dispatcher">
				/portal/share/custom/highcharts/highchartsDemo.jsp
			</result>
			<interceptor-ref name="params" />
		</action>
			<action name="getAreaDic"
			class="net.e_lian.bpm.custom.highcharts.action.highchartsDateAction"
			method="getAreaDic">
			<result name="success" type="dispatcher">
				/portal/share/custom/highcharts/highchartsDemo.jsp
			</result>
			<interceptor-ref name="params" />
		</action>
			<action name="getWpdldic"
			class="net.e_lian.bpm.custom.highcharts.action.highchartsDateAction"
			method="getWpdldic">
			<result name="success" type="dispatcher">
				/portal/share/custom/highcharts/highchartsDemo.jsp
			</result>
			<interceptor-ref name="params" />
		</action>
			<action name="getWpxldic"
			class="net.e_lian.bpm.custom.highcharts.action.highchartsDateAction"
			method="getWpxldic">
			<result name="success" type="dispatcher">
				/portal/share/custom/highcharts/highchartsDemo.jsp
			</result>
			<interceptor-ref name="params" />
		</action>
				<action name="getShengdic"
			class="net.e_lian.bpm.custom.highcharts.action.highchartsDateAction"
			method="getShengdic">
			<result name="success" type="dispatcher">
				/portal/share/custom/highcharts/highchartsDemo.jsp
			</result>
			<interceptor-ref name="params" />
		</action>
			<action name="getShidic"
			class="net.e_lian.bpm.custom.highcharts.action.highchartsDateAction"
			method="getShidic">
			<result name="success" type="dispatcher">
				/portal/share/custom/highcharts/highchartsDemo.jsp
			</result>
			<interceptor-ref name="params" />
		</action>
			<action name="getXiandic"
			class="net.e_lian.bpm.custom.highcharts.action.highchartsDateAction"
			method="getXiandic">
			<result name="success" type="dispatcher">
				/portal/share/custom/highcharts/highchartsDemo.jsp
			</result>
			<interceptor-ref name="params" />
		</action>
		<action name="save"
			class="net.e_lian.bpm.core.domain.action.DomainAction"
			method="doSave">
			<result name="input" type="dispatcher">
				/portal/share/uManageDomainInfo.jsp
			</result>
			<result name="success" type="dispatcher">
				/portal/share/uManageDomainInfo.jsp
			</result>
			<interceptor-ref name="defaultStack">
			    <param name="workflow.excludeMethods">default</param>
			</interceptor-ref>

		</action>
	</package>
</struts>

3.建立实体类

package net.e_lian.bpm.custom.highcharts.action;

import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletResponse;

import net.e_lian.bpm.util.http.ResponseUtil;
import net.e_lian.bpm.util.json.JsonUtil;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;

public class highchartsDateAction extends ActionSupport {
	final static String APPLICATIONID = "11e5-2f5a-1002d0a2-bd9d-990d0d4debcd";
	Connection conn;
	Statement psts;
	ResultSet rs;

	private static final long serialVersionUID = 1L;

	/**
	 * highcharts用的
	 *
	 * @Title: chart
	 * @Description: 直接转出JSON传递给前台页面接受
	 * @return
	 * @throws Exception
	 */

	public void getHighChartsData() throws Exception {

		chartDao cDao = new chartDao();
		List<Map<String, Object>> list = cDao.chart();
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("list", list);
		String ss = JsonUtil.toJson(map);
		HttpServletResponse response = ServletActionContext.getResponse();
		ResponseUtil.setJsonToResponse(response, ss);
	}
	//CDC电话
	public void getCDCdh() throws Exception {

		chartDao cDao = new chartDao();

		List<Map<String, Object>> list = cDao.CDCdh();
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("list", list);
		String ss = JsonUtil.toJson(map);
		HttpServletResponse response = ServletActionContext.getResponse();
		ResponseUtil.setJsonToResponse(response, ss);
	}
	//CDC现场
	public void getCDCxc() throws Exception {

		chartDao cDao = new chartDao();

		List<Map<String, Object>> list = cDao.CDCxc();
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("list", list);
		String ss = JsonUtil.toJson(map);
		HttpServletResponse response = ServletActionContext.getResponse();
		ResponseUtil.setJsonToResponse(response, ss);
	}

	//CDC质量统计
	public void getCDCzl() throws Exception {

			chartDao cDao = new chartDao();
			System.out.println("1111111");
			List<Map<String, Object>> list = cDao.CDCzl();
			Map<String, Object> map = new HashMap<String, Object>();
			map.put("list", list);
			String ss = JsonUtil.toJson(map);
			HttpServletResponse response = ServletActionContext.getResponse();
			ResponseUtil.setJsonToResponse(response, ss);
		}
	public void getWpStatistics() throws Exception {

		chartDao cDao = new chartDao();
		List<Map<String, Object>> list = cDao.Wptj();
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("list", list);
		String ss = JsonUtil.toJson(map);
		HttpServletResponse response = ServletActionContext.getResponse();
		ResponseUtil.setJsonToResponse(response, ss);
	}

	public void getCdcgl() throws Exception {

		chartDao cDao = new chartDao();
		List<Map<String, Object>> list = cDao.CDCglfx();
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("list", list);
		String ss = JsonUtil.toJson(map);
		HttpServletResponse response = ServletActionContext.getResponse();
		ResponseUtil.setJsonToResponse(response, ss);
	}
	public void getCDCcontinuegl() throws Exception {
		chartDao cDao = new chartDao();
		List<Map<String, Object>> list = cDao.CDCcontinuegl();
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("list", list);
		String ss = JsonUtil.toJson(map);
		HttpServletResponse response = ServletActionContext.getResponse();
		ResponseUtil.setJsonToResponse(response, ss);
	}
	public void getDataItem() throws Exception {
		chartDao cDao = new chartDao();
		List<Map<String, Object>> list = cDao.DataItem();
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("list", list);
		String ss = JsonUtil.toJson(map);
		HttpServletResponse response = ServletActionContext.getResponse();
		ResponseUtil.setJsonToResponse(response, ss);
	}
	public void getWSDataItem() throws Exception {
		chartDao cDao = new chartDao();
		List<Map<String, Object>> list = cDao.WSDataItem();
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("list", list);
		String ss = JsonUtil.toJson(map);
		HttpServletResponse response = ServletActionContext.getResponse();
		ResponseUtil.setJsonToResponse(response, ss);
	}

	public void getOnlnegl() throws Exception {

		chartDao cDao = new chartDao();
		List<Map<String, Object>> list = cDao.Onlneglfx();
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("list", list);
		String ss = JsonUtil.toJson(map);
		HttpServletResponse response = ServletActionContext.getResponse();
		ResponseUtil.setJsonToResponse(response, ss);
	}

	public void getOnlinecontinuegl() throws Exception {
		chartDao cDao = new chartDao();
		List<Map<String, Object>> list = cDao.Onlinecontinuegl();
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("list", list);
		String ss = JsonUtil.toJson(map);
		//System.out.println("ss========"+ss);
		HttpServletResponse response = ServletActionContext.getResponse();
		ResponseUtil.setJsonToResponse(response, ss);
	}
	public void getOnlineWpStatistics() throws Exception {

		chartDao cDao = new chartDao();
		List<Map<String, Object>> list = cDao.onlineWptj();
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("list", list);
		String ss = JsonUtil.toJson(map);
		HttpServletResponse response = ServletActionContext.getResponse();
		ResponseUtil.setJsonToResponse(response, ss);
	}
	public void getHighChartsOnline() throws Exception {

		chartDao cDao = new chartDao();
		List<Map<String, Object>> list = cDao.online();
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("list", list);
		String ss = JsonUtil.toJson(map);
		HttpServletResponse response = ServletActionContext.getResponse();
		ResponseUtil.setJsonToResponse(response, ss);
	}

	public void getAreaDic() throws Exception {

		chartDao cDao = new chartDao();
		List<Map<String, Object>> list = cDao.aredic();
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("list", list);
		String ss1 = JsonUtil.toJson(map);
		HttpServletResponse response = ServletActionContext.getResponse();
		ResponseUtil.setJsonToResponse(response, ss1);
	}
	public void getDHsj() throws Exception {

		chartDao cDao = new chartDao();
		List<Map<String, Object>> list = cDao.DHsj();
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("list", list);
		String ss1 = JsonUtil.toJson(map);
		HttpServletResponse response = ServletActionContext.getResponse();
		ResponseUtil.setJsonToResponse(response, ss1);
	}
	public void getWpdldic() throws Exception {

		chartDao cDao = new chartDao();
		List<Map<String, Object>> list = cDao.wpdldic();
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("list", list);
		String ss1 = JsonUtil.toJson(map);
		HttpServletResponse response = ServletActionContext.getResponse();
		ResponseUtil.setJsonToResponse(response, ss1);
	}
	public void getWpname() throws Exception {

		chartDao cDao = new chartDao();
		List<Map<String, Object>> list = cDao.wpdic();
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("list", list);
		String ss1 = JsonUtil.toJson(map);
		HttpServletResponse response = ServletActionContext.getResponse();
		ResponseUtil.setJsonToResponse(response, ss1);
	}
	public void getWpNumber() throws Exception {

		chartDao cDao = new chartDao();
		List<Map<String, Object>> list = cDao.WpNumber();
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("list", list);
		String ss1 = JsonUtil.toJson(map);
		HttpServletResponse response = ServletActionContext.getResponse();
		ResponseUtil.setJsonToResponse(response, ss1);
	}
	public void getWpzldic() throws Exception {

		chartDao cDao = new chartDao();
		List<Map<String, Object>> list = cDao.wpzldic();
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("list", list);
		String ss2 = JsonUtil.toJson(map);
		HttpServletResponse response = ServletActionContext.getResponse();
		ResponseUtil.setJsonToResponse(response, ss2);
	}
	public void getWpxldic() throws Exception {

		chartDao cDao = new chartDao();
		List<Map<String, Object>> list = cDao.wpxldic();
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("list", list);
		String ss2 = JsonUtil.toJson(map);
		HttpServletResponse response = ServletActionContext.getResponse();
		ResponseUtil.setJsonToResponse(response, ss2);
	}
	public void getShengdic() throws Exception {

		chartDao cDao = new chartDao();
		List<Map<String, Object>> list = cDao.Shengdic();
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("list", list);
		String ss2 = JsonUtil.toJson(map);
		HttpServletResponse response = ServletActionContext.getResponse();
		ResponseUtil.setJsonToResponse(response, ss2);
	}
	public void getShidic() throws Exception {

		chartDao cDao = new chartDao();
		List<Map<String, Object>> list = cDao.Shidic();
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("list", list);
		String ss2 = JsonUtil.toJson(map);
		HttpServletResponse response = ServletActionContext.getResponse();
		ResponseUtil.setJsonToResponse(response, ss2);
	}
	public void getXiandic() throws Exception {

		chartDao cDao = new chartDao();
		List<Map<String, Object>> list = cDao.Xiandic();
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("list", list);
		String ss2 = JsonUtil.toJson(map);
		HttpServletResponse response = ServletActionContext.getResponse();
		ResponseUtil.setJsonToResponse(response, ss2);
	}
	public void getPm() throws Exception {

		chartDao cDao = new chartDao();
		List<Map<String, Object>> list = cDao.pm();
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("list", list);
		String ss2 = JsonUtil.toJson(map);
		HttpServletResponse response = ServletActionContext.getResponse();
		ResponseUtil.setJsonToResponse(response, ss2);
	}

	/**
	 * 喷出json数据
	 */
	public void printWriter(String json) {
		HttpServletResponse response = ServletActionContext.getResponse();
		response.setContentType("application/json;charset=UTF-8");
		PrintWriter writer;
		try {
			writer = response.getWriter();
			writer.write(json);
			writer.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}
package net.e_lian.bpm.custom.highcharts.action;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;

import net.e_lian.bpm.base.action.BaseAction;
import net.e_lian.bpm.base.action.ParamsTable;
import net.e_lian.bpm.core.user.ejb.UserDefined;
import net.e_lian.bpm.custom.db.DataBaseConnection;
import net.e_lian.bpm.custom.highcharts.action.DataEntity;

/***
 * @see 传参数调用 数据库连接
 * @author niuchunlei
 * @since 2015-11-05
 * @param APPLICATIONID
 *            国家产品伤害监测系统
 */
public class chartDao {
	final static String APPLICATIONID = "11e5-2f5a-1002d0a2-bd9d-990d0d4debcd";
	Connection conn;
	Statement psts;
	ResultSet rs;
	ResultSet qy;
	String bmsum="";
	DataBaseConnection dbc = new DataBaseConnection();
	HttpServletRequest request = ServletActionContext.getRequest();
	//CDC分析(包含2012,2015,排名分析)
	public List<Map<String, Object>> chart() throws UnsupportedEncodingException {
		List<Map<String, Object>> dalist = new ArrayList<Map<String, Object>>();
		HttpServletRequest request = ServletActionContext.getRequest();
		String starttime=request.getParameter("starttime");//伤害发生时间
		String shendtime=request.getParameter("shendtime");//伤害结束时间
		String gxstarttime=request.getParameter("gxstarttime");//数据更新开始时间
		String gxendtime=request.getParameter("gxendtime");//数据更新结束时间
		String yys=request.getParameter("yys");
		String wpdl=request.getParameter("wpdl");//物品大类
		String wpzl=request.getParameter("wpzl");//物品中类
		String wpxl=request.getParameter("wpxl");//物品小类
		String wpname=request.getParameter("wpname");//物品名称
		String gy=request.getParameter("datatime");//数据项
		String pm=request.getParameter("pm");//排名
		String xm=request.getParameter("xm");
		String xb=request.getParameter("xb");
		String dh=request.getParameter("dh");
		String LCZD=request.getParameter("LCZD");//临床诊断
		String sfgy=request.getParameter("sfgy");//对汉字进行解码;//是否故意
		if(""!=xm&&null!=xm){
			 xm=java.net.URLDecoder.decode(xm,"utf-8");//对汉字进行解码
			}
		if(""!=wpname&&null!=wpname){
			wpname=java.net.URLDecoder.decode(wpname,"utf-8");//对汉字进行解码
			}
		if(""!=LCZD&&null!=LCZD){
			LCZD=java.net.URLDecoder.decode(LCZD,"utf-8");//对汉字进行解码
			}
		String lx=request.getParameter("lx");//CDC类型区分2012,2015
		String checkss=request.getParameter("checks");//所选中复选框的值
		String sql="";
		if(""!=checkss&&null!=checkss){
				String checks=java.net.URLDecoder.decode(checkss,"utf-8");//对汉字进行解码
				String  shuju[]=checks.split("::");
				for(int i=0;i<shuju.length;i++){
					String  table1[]=shuju[i].split(";");
					String  zd="";//字段名
					String  jk="";//条件
					for(int j=0;j<table1.length;j++){
						String  table3[]=table1[j].split(",");

						zd=table3[1];
						if(j==(table1.length-1)){
						jk+="'"+table3[2]+"'";
						sql+=" and to_char(item_"+zd+") in ("+jk+") ";
						}else{
						jk+="'"+table3[2]+"',";
						}
					}
				}
		}
		if(""!=starttime&&null!=starttime){
			sql += " and item_VC_SHFSSJ >= to_date('"+starttime +"','yyyy-mm-dd ') ";
		}
		if(""!=shendtime&&null!=shendtime){
			sql += " and item_VC_SHFSSJ <= to_date('"+shendtime +"','yyyy-mm-dd ')+1 ";
		}
		if(""!=gxstarttime&&null!=gxstarttime){
			sql += " and item_INTANALYSISDBTime >= to_date('"+gxstarttime +"','yyyy-mm-dd ') ";
		}
		if(""!=gxendtime&&null!=gxendtime){
			sql += " and item_INTANALYSISDBTime <= to_date('"+gxendtime +"','yyyy-mm-dd ')+1 ";
		}
		if(""!=yys&&null!=yys){
			String  yyshuju[]=yys.split("::");
			String  yytj="";//条件
			for(int i=0;i<yyshuju.length;i++){
				String  yytl[]=yyshuju[i].split(";");

				for(int j=0;j<yytl.length;j++){
					if(j==(yytl.length-1)){
						yytj+="'"+yytl[j]+"'";
						}else{
						yytj+="'"+yytl[j]+"',";
						}

				}
			}
			 sql += " and ITEM_VC_JCYYBH in("+ yytj+") ";

		}
		if(""!=wpdl&&null!=wpdl){
			String  yyshuju[]=wpdl.split("::");
			String  yytj="";//条件
			for(int i=0;i<yyshuju.length;i++){
					if(i==(yyshuju.length-1)){
						yytj+="'"+yyshuju[i]+"'";
						}else{
						yytj+="'"+yyshuju[i]+"',";
						}
			}
			   sql += " and ITEM_VC_WP1_DLDM in ("+yytj+") ";
			}
		if(""!=wpzl&&null!=wpzl){
			String  yyshuju[]=wpzl.split("::");
			String  yytj="";//条件
			for(int i=0;i<yyshuju.length;i++){
					if(i==(yyshuju.length-1)){
						yytj+="'"+yyshuju[i]+"'";
						}else{
						yytj+="'"+yyshuju[i]+"',";
						}
			}
			 sql += " and ITEM_VC_WP1_ZLDM in("+yytj+") ";
			}
		if(""!=wpxl&&null!=wpxl){
			String  yyshuju[]=wpxl.split("::");
			String  yytj="";//条件
			for(int i=0;i<yyshuju.length;i++){
					if(i==(yyshuju.length-1)){
						yytj+="'"+yyshuju[i]+"'";
						}else{
						yytj+="'"+yyshuju[i]+"',";
						}
			}
			   sql += " and ITEM_VC_WP1_XLDM in ("+yytj+") ";
			}
		if(""!=sfgy&&null!=sfgy){
			String  yyshuju[]=sfgy.split("::");
			String  yytj="";//条件
			for(int i=0;i<yyshuju.length;i++){
					if(i==(yyshuju.length-1)){
						yytj+="'"+yyshuju[i]+"'";
						}else{
						yytj+="'"+yyshuju[i]+"',";
						}
			}
			   sql += " and ITEM_VC_SFGY in ("+yytj+") ";
			}

		if(""!=wpname&&null!=wpname){
			 sql += " and (ITEM_VC_SHSJWPMC1 in  (select BMNAME from  wplist where WPNAME='"+wpname+"')or ITEM_VC_SHSJWPMC2 in  (select BMNAME from  wplist where WPNAME='"+wpname+"') )";
			}
		if(""!=LCZD&&null!=LCZD){
			   sql += " and to_char(ITEM_VC_SHLCZD) like '%"+LCZD+"%' ";
			}
		if(""!=xm&&null!=xm){
			   sql += " and ITEM_VC_XM like '%"+xm+"%' ";
			}
		if(""!=xb&&null!=xb){
			   sql += " and ITEM_VC_XB = '"+xb+"' ";
			}
		if("1".equals(dh)){
			   sql += " and ITEM_VC_LXDH is not null ";
		}else if("2".equals(dh)){
			sql += " and ITEM_VC_LXDH is  null ";
		}
		String[] datas;//筛选条件
		datas=gy.split(",");

		String SQL1="";
		if("wplist".endsWith(datas[0])){//区分数据项是产品名称,因为产品名称真实值是汉字
			SQL1="select count(item_"+datas[1]+")as item_counts,b.bmname as item_objjc from tlk_SHjcbbk_e a,"+datas[0]+" b where a.item_"+datas[1]+"=b.bmname and a.item_dbType='"+lx+"' " +sql+"group by a.item_"+datas[1]+",b.bmname order by item_counts desc";
		}else{
		 SQL1="select count(item_"+datas[1]+")as item_counts,b.item_objjc from tlk_SHjcbbk_e a, TLK_"+datas[0]+" b where a.item_"+datas[1]+"=b.item_objid and a.item_dbType='"+lx+"'"+sql+"group by a.item_"+datas[1]+",b.item_objjc order by item_counts desc";
		}
		try {
			conn = dbc.getConnection();
			psts = conn.createStatement();
			if(""!=pm){//这主要区分排名分析和无排名分析
				 String slq2="select * from ("+SQL1+") where rownum<="+pm;
				 rs = psts.executeQuery(slq2);
			  }else{
					rs = psts.executeQuery(SQL1);
					}

			while (rs.next()) {
				Map<String, Object> map = new HashMap<String, Object>();
				DataEntity de = new DataEntity();
				de.setName(rs.getString("item_objjc"));
				de.setCounts(rs.getInt("item_counts"));
				map.put("data", de.getCounts());
				map.put("name", de.getName());
				dalist.add(map);
			}
		} catch (Exception e) {
			e.getMessage();
			e.printStackTrace();
		} finally {
			close();
		}
		return dalist;

	}
	//CDC关联分析(包含2012,2015)
	public List<Map<String, Object>> CDCglfx() throws UnsupportedEncodingException {
		List<Map<String, Object>> dalist = new ArrayList<Map<String, Object>>();
		HttpServletRequest request = ServletActionContext.getRequest();
		HttpSession session =  request.getSession();
		String starttime=request.getParameter("starttime");
		String shendtime=request.getParameter("shendtime");
		String gxstarttime=request.getParameter("gxstarttime");
		String gxendtime=request.getParameter("gxendtime");
		String yys=request.getParameter("yys");
		String wpdl=request.getParameter("wpdl");//物品大类
		String wpzl=request.getParameter("wpzl");//物品中类
		String wpxl=request.getParameter("wpxl");//物品小类
		String wpname=request.getParameter("wpname");//物品名称
		String xm=request.getParameter("xm");
		String xb=request.getParameter("xb");
		String dh=request.getParameter("dh");
		String lx=request.getParameter("lx");
		String LCZD=request.getParameter("LCZD");//临床诊断
		String sfgy=request.getParameter("sfgy");//对汉字进行解码;//是否故意

		if(""!=xm&&null!=xm){
			 xm=java.net.URLDecoder.decode(xm,"utf-8");//对汉字进行解码
			}
		if(""!=wpname&&null!=wpname){
			wpname=java.net.URLDecoder.decode(wpname,"utf-8");//对汉字进行解码
			}
		if(""!=LCZD&&null!=LCZD){
			LCZD=java.net.URLDecoder.decode(LCZD,"utf-8");//对汉字进行解码
			}
		String checkss=request.getParameter("checks");//所选中复选框的值
		String checks=java.net.URLDecoder.decode(checkss,"utf-8");//对汉字进行解码
		String  shuju[]=checks.split("::");
		String  table1[]=shuju[0].split(";");//所选第一个复选框的值
		String  table2[]=shuju[1].split(";");
		String  bm="";//表名
		String  zd="";//字段名
		String  jk="";//条件
		String  fxk="";//所选复选框文本内容
		String  fxk1="";
		String  bm1="";
		String  zd1="";
		String  jk1="";
		String  table4[]=table1[0].split(",");
		String  table5[]=table2[0].split(",");
		fxk=table4[3];
		fxk1=table5[3];
		for(int j=0;j<table1.length;j++){
			String  table3[]=table1[j].split(",");
			bm=table3[0];
			zd=table3[1];
			if(j==(table1.length-1)){
			jk+="'"+table3[2]+"'";
			}else{
			jk+="'"+table3[2]+"',";
			}
		}
		for(int j=0;j<table2.length;j++){
			String  table3[]=table2[j].split(",");
			bm1=table3[0];
			zd1=table3[1];
			//fxk1=table3[3];
			if(j==(table2.length-1)){
			jk1+="'"+table3[2]+"'";
			}else{
			jk1+="'"+table3[2]+"',";
			}
		}

		session.setAttribute("LCZD", LCZD);
		session.setAttribute("wpdl", wpdl);
		session.setAttribute("wpzl", wpzl);
		session.setAttribute("wpxl", wpxl);
		session.setAttribute("wpname", wpname);
		session.setAttribute("xm", xm);
		session.setAttribute("lx", lx);
		session.setAttribute("dh", dh);
		session.setAttribute("xb", xb);
		session.setAttribute("bm", bm);
	    session.setAttribute("bm1", bm1);
		session.setAttribute("zd", zd);
	    session.setAttribute("zd1", zd1);
	    session.setAttribute("jk", jk);
	    session.setAttribute("jk1", jk1);
	    session.setAttribute("starttime", starttime);
	    session.setAttribute("shendtime", shendtime);
		session.setAttribute("gxstarttime", gxstarttime);
	    session.setAttribute("gxendtime", gxendtime);
	    session.setAttribute("yys", yys);
	    session.setAttribute("fxk", fxk);
	    session.setAttribute("fxk1", fxk1);
	    session.setAttribute("sfgy", sfgy);

		String sql="";
		if(""!=starttime&&null!=starttime){
			sql += " and item_VC_SHFSSJ >= to_date('"+starttime +"','yyyy-mm-dd ') ";
		}
		if(""!=shendtime&&null!=shendtime){
			sql += " and item_VC_SHFSSJ <= to_date('"+shendtime +"','yyyy-mm-dd ')+1 ";
		}
		if(""!=gxstarttime&&null!=gxstarttime){
			sql += " and item_INTANALYSISDBTime >= to_date('"+gxstarttime +"','yyyy-mm-dd') ";
		}
		if(""!=gxendtime&&null!=gxendtime){
			sql += " and item_INTANALYSISDBTime <= to_date('"+gxendtime +"','yyyy-mm-dd')+1 ";
		}

		if(""!=yys&&null!=yys){
			String  yyshuju[]=yys.split("::");
			String  yytj="";//条件
			for(int i=0;i<yyshuju.length;i++){
				String  yytl[]=yyshuju[i].split(";");

				for(int j=0;j<yytl.length;j++){
					if(j==(yytl.length-1)){
						yytj+="'"+yytl[j]+"'";
						}else{
						yytj+="'"+yytl[j]+"',";
						}

				}
			}
			 sql += " and ITEM_VC_JCYYBH in("+ yytj+") ";

		}
		if(""!=wpdl&&null!=wpdl){
			String  yyshuju[]=wpdl.split("::");
			String  yytj="";//条件
			for(int i=0;i<yyshuju.length;i++){
					if(i==(yyshuju.length-1)){
						yytj+="'"+yyshuju[i]+"'";
						}else{
						yytj+="'"+yyshuju[i]+"',";
						}
			}
			   sql += " and ITEM_VC_WP1_DLDM in ("+yytj+") ";
			}
		if(""!=wpzl&&null!=wpzl){
			String  yyshuju[]=wpzl.split("::");
			String  yytj="";//条件
			for(int i=0;i<yyshuju.length;i++){
					if(i==(yyshuju.length-1)){
						yytj+="'"+yyshuju[i]+"'";
						}else{
						yytj+="'"+yyshuju[i]+"',";
						}
			}
			 sql += " and ITEM_VC_WP1_ZLDM in("+yytj+") ";
			}
		if(""!=wpxl&&null!=wpxl){
			String  yyshuju[]=wpxl.split("::");
			String  yytj="";//条件
			for(int i=0;i<yyshuju.length;i++){
					if(i==(yyshuju.length-1)){
						yytj+="'"+yyshuju[i]+"'";
						}else{
						yytj+="'"+yyshuju[i]+"',";
						}
			}
			   sql += " and ITEM_VC_WP1_XLDM in ("+yytj+") ";
			}
		if(""!=sfgy&&null!=sfgy){
			String  yyshuju[]=sfgy.split("::");
			String  yytj="";//条件
			for(int i=0;i<yyshuju.length;i++){
					if(i==(yyshuju.length-1)){
						yytj+="'"+yyshuju[i]+"'";
						}else{
						yytj+="'"+yyshuju[i]+"',";
						}
			}
			   sql += " and ITEM_VC_SFGY in ("+yytj+") ";
			}

		if(""!=wpname&&null!=wpname){
			 sql += " and (ITEM_VC_SHSJWPMC1 in  (select BMNAME from  wplist where WPNAME='"+wpname+"')or ITEM_VC_SHSJWPMC2 in  (select BMNAME from  wplist where WPNAME='"+wpname+"') )";
			}
		if(""!=xm&&null!=xm){
			   sql += " and ITEM_VC_XM like '%"+xm+"%' ";
			}
		if(""!=LCZD&&null!=LCZD){
			   sql += " and to_char(ITEM_VC_SHLCZD) like '%"+LCZD+"%' ";
			}

		if(""!=xb&&null!=xb){
			   sql += " and ITEM_VC_XB = '"+xb+"' ";
			}
		if("1".equals(dh)){
			   sql += " and ITEM_VC_LXDH is not null ";
		}else if("2".equals(dh)){
			sql += " and ITEM_VC_LXDH is  null ";
		}
		String sql1="SELECT B.Item_Objjc item_xl,count(C.Item_Objjc) item_counts,C.Item_Objjc item_zy FROM tlk_SHJCBBK_E a LEFT JOIN tlk_"+bm1+" b ON to_char(a.item_"+zd1+")=b.item_objid LEFT JOIN tlk_"+bm+" c ON c.item_objid=to_char(a.item_"+zd+") where  item_dbType='"+lx+"' and to_char(item_"+zd1+") in ("+jk1+")and to_char(item_"+zd+") in ("+jk+")"+sql+" group by rollup(B.Item_Objjc,C.Item_Objjc)";
		try {
			conn = dbc.getConnection();
			psts = conn.createStatement();
			qy=psts.executeQuery(sql1);
			while (qy.next()) {
				Map<String, Object> map2 = new HashMap<String, Object>();
				DataEntity de1 = new DataEntity();
				if((qy.getString("item_zy"))!=null){
					de1.setGlxl(qy.getString("item_xl"));
					de1.setName(qy.getString("item_zy"));
					de1.setCounts(qy.getInt("item_counts"));
					map2.put("data", de1.getCounts());
					map2.put("glgx", de1.getGlxl());
					map2.put("name", de1.getName());
					dalist.add(map2);
				}
			}
		} catch (Exception e) {
			e.getMessage();
			e.printStackTrace();
		} finally {
			close();
		}
		return dalist;

	}

	public List<Map<String, Object>> CDCcontinuegl() throws UnsupportedEncodingException {
		List<Map<String, Object>> dalist = new ArrayList<Map<String, Object>>();
		HttpServletRequest request = ServletActionContext.getRequest();
		HttpSession session =  request.getSession();

		String conditions=request.getParameter("conditions");
		session.setAttribute("conditions",conditions);
		conditions = URLDecoder.decode(conditions,"utf-8");
		String seriesname=request.getParameter("seriesname");
		session.setAttribute("seriesname",seriesname);
		seriesname= URLDecoder.decode(seriesname,"utf-8");
		String lx=(String)session.getAttribute("lx");
		String bm=(String)session.getAttribute("bm");
		String bm1=(String)session.getAttribute("bm1");
		String jk=(String)session.getAttribute("jk");
		String jk1=(String)session.getAttribute("jk1");
		String zd=(String)session.getAttribute("zd");
		String zd1=(String)session.getAttribute("zd1");
		String wpdl=(String)session.getAttribute("wpdl");//物品大类
		String wpzl=(String)session.getAttribute("wpzl");//物品中类
		String wpxl=(String)session.getAttribute("wpxl");//物品小类
		String wpname=(String)session.getAttribute("wpname");//物品名称
		String LCZD=(String)session.getAttribute("LCZD");//临床诊断
		String sfgy=(String)session.getAttribute("sfgy");//是否故意

		String sj=request.getParameter("sj");
		String sjtj[]=sj.split(",");
		session.setAttribute("bm2",sjtj[0]);
		session.setAttribute("zd2",sjtj[1]);
		String sjsz=request.getParameter("sjsz");
		String tjsj=request.getParameter("tjsj");
		if(""!=tjsj&&null!=tjsj){
			tjsj=java.net.URLDecoder.decode(tjsj,"utf-8");//对汉字进行解码
			}
		String[] sj2=sjsz.split(";");
		String sql2="";
		String sql="";
		for(int i=0;i<sj2.length;i++){
			String[] tj=sj2[i].split(",");
			if(i==(sj2.length-1)){
			}else{
				sql2+=" LEFT JOIN tlk_"+tj[0]+" b"+i+" ON b"+i+".item_objjc='"+tjsj+"' ";
				sql+=" and item_"+tj[1]+"= b"+i+".item_objid ";
			}

		}
		String starttime=(String)session.getAttribute("starttime");
		String shendtime=(String)session.getAttribute("shendtime");
		String gxstarttime=(String)session.getAttribute("gxstarttime");
		String gxendtime=(String)session.getAttribute("gxendtime");
		String yys=(String)session.getAttribute("yys");
		String xm=(String)session.getAttribute("xm");
		String xb=(String)session.getAttribute("xb");
		String dh=(String)session.getAttribute("dh");
		//String xm=java.net.URLDecoder.decode(xms,"utf-8");//对汉字进行解码
		//null是判断对象为空,""是判断内容为空
		if(null!=starttime&&""!=starttime){
			sql += " and item_VC_SHFSSJ >= to_date('"+starttime +"','yyyy-mm-dd ') ";
		}
		if(null!=shendtime&&""!=shendtime){
			sql += " and item_VC_SHFSSJ <= to_date('"+shendtime +"','yyyy-mm-dd ')+1 ";
		}
		if(null!=gxstarttime&&""!=gxstarttime){
			sql += " and item_INTANALYSISDBTime >= to_date('"+gxstarttime +"','yyyy-mm-dd ') ";
		}
		if(null!=gxendtime&&""!=gxendtime){
			sql += " and item_INTANALYSISDBTime <= to_date('"+gxendtime +"','yyyy-mm-dd ')+1 ";
		}
		if(""!=yys&&null!=yys){
			String  yyshuju[]=yys.split("::");
			String  yytj="";//条件
			for(int i=0;i<yyshuju.length;i++){
				String  yytl[]=yyshuju[i].split(";");

				for(int j=0;j<yytl.length;j++){
					if(j==(yytl.length-1)){
						yytj+="'"+yytl[j]+"'";
						}else{
						yytj+="'"+yytl[j]+"',";
						}

				}
			}
			 sql += " and ITEM_VC_JCYYBH in("+ yytj+") ";

		}
		if(""!=wpdl&&null!=wpdl){
			String  yyshuju[]=wpdl.split("::");
			String  yytj="";//条件
			for(int i=0;i<yyshuju.length;i++){
					if(i==(yyshuju.length-1)){
						yytj+="'"+yyshuju[i]+"'";
						}else{
						yytj+="'"+yyshuju[i]+"',";
						}
			}
			   sql += " and ITEM_VC_WP1_DLDM in ("+yytj+") ";
			}
		if(""!=wpzl&&null!=wpzl){
			String  yyshuju[]=wpzl.split("::");
			String  yytj="";//条件
			for(int i=0;i<yyshuju.length;i++){
					if(i==(yyshuju.length-1)){
						yytj+="'"+yyshuju[i]+"'";
						}else{
						yytj+="'"+yyshuju[i]+"',";
						}
			}
			 sql += " and ITEM_VC_WP1_ZLDM in("+yytj+") ";
			}
		if(""!=wpxl&&null!=wpxl){
			String  yyshuju[]=wpxl.split("::");
			String  yytj="";//条件
			for(int i=0;i<yyshuju.length;i++){
					if(i==(yyshuju.length-1)){
						yytj+="'"+yyshuju[i]+"'";
						}else{
						yytj+="'"+yyshuju[i]+"',";
						}
			}
			   sql += " and ITEM_VC_WP1_XLDM in ("+yytj+") ";
			}
		if(""!=sfgy&&null!=sfgy){
			String  yyshuju[]=sfgy.split("::");
			String  yytj="";//条件
			for(int i=0;i<yyshuju.length;i++){
					if(i==(yyshuju.length-1)){
						yytj+="'"+yyshuju[i]+"'";
						}else{
						yytj+="'"+yyshuju[i]+"',";
						}
			}
			   sql += " and ITEM_VC_SFGY in ("+yytj+") ";
			}
		if(""!=wpname&&null!=wpname){
			 sql += " and (ITEM_VC_SHSJWPMC1 in  (select BMNAME from  wplist where WPNAME='"+wpname+"')or ITEM_VC_SHSJWPMC2 in  (select BMNAME from  wplist where WPNAME='"+wpname+"') )";
			}
		if(""!=xm&&null!=xm){
			   sql += " and ITEM_VC_XM like '%"+xm+"%' ";
			}
		if(""!=LCZD&&null!=LCZD){
			   sql += " and to_char(ITEM_VC_SHLCZD) like '%"+LCZD+"%' ";
			}

		if(""!=xb&&null!=xb){
			   sql += " and ITEM_VC_XB = '"+xb+"' ";
			}
		if("1".equals(dh)){
			   sql += " and ITEM_VC_LXDH is not null ";
		}else if("2".equals(dh)){
			sql += " and ITEM_VC_LXDH is  null ";
		}

		String sql1="SELECT B.Item_Objjc item_xl,COUNT(b.Item_Objjc) item_counts FROM tlk_SHJCBBK_E a LEFT JOIN tlk_"+sjtj[0]+" b ON to_char(a.item_"+sjtj[1]+")=b.item_objid "+sql2+"left join tlk_"+bm1+" c  on c.item_objjc='"+conditions+"' left join tlk_"+bm+" d  on d.item_objjc='"+seriesname+"' WHERE item_dbType   ='"+lx+"'AND to_char(item_"+zd+")=d.item_objid AND to_char(item_"+zd1+")=c.item_objid "+sql+" GROUP BY (B.Item_Objjc)";
		try {
			conn = dbc.getConnection();
			psts = conn.createStatement();
			qy=psts.executeQuery(sql1);
			while (qy.next()) {
				Map<String, Object> map2 = new HashMap<String, Object>();
				DataEntity de1 = new DataEntity();
					de1.setName(qy.getString("item_xl"));
					de1.setCounts(qy.getInt("item_counts"));
					map2.put("data", de1.getCounts());
					map2.put("name", de1.getName());
					dalist.add(map2);
			}
		} catch (Exception e) {
			e.getMessage();
			e.printStackTrace();
		} finally {
			close();
		}
		return dalist;
	}
	//CDC和网上信息采集电话
	public List<Map<String, Object>> CDCdh() throws UnsupportedEncodingException {
		List<Map<String, Object>> dalist = new ArrayList<Map<String, Object>>();
		HttpServletRequest request = ServletActionContext.getRequest();
		String starttime=request.getParameter("starttime");//伤害发生时间
		String shendtime=request.getParameter("shendtime");//伤害结束时间
		String gxstarttime=request.getParameter("gxstarttime");//数据更新开始时间
		String gxendtime=request.getParameter("gxendtime");//数据更新结束时间
		String yys=request.getParameter("yys");
		String gy=request.getParameter("datatime");//数据项
		String lx=request.getParameter("lx");//区分CDC和网上信息采集
		String sql="";

		if(""!=gxstarttime&&null!=gxstarttime){
			sql += " and a.LASTMODIFIED >= to_date('"+gxstarttime +"','yyyy-mm-dd ') ";
		}
		if(""!=gxendtime&&null!=gxendtime){
			sql += " and a.LASTMODIFIED <= to_date('"+gxendtime +"','yyyy-mm-dd ')+1 ";
		}
		if(""!=yys&&null!=yys){
			String  yyshuju[]=yys.split("::");
			String  yytj="";//条件
			for(int i=0;i<yyshuju.length;i++){
				String  yytl[]=yyshuju[i].split(";");

				for(int j=0;j<yytl.length;j++){
					if(j==(yytl.length-1)){
						yytj+="'"+yytl[j]+"'";
						}else{
						yytj+="'"+yytl[j]+"',";
						}

				}
			}
			 sql += " and a.item_yybh in("+ yytj+") ";

		}
		if(lx.equals("ProductTelCard")){
			if(""!=starttime&&null!=starttime){
				sql += " and a.item_VC_SHFSSJ >= to_date('"+starttime +"','yyyy-mm-dd ') ";
			}
			if(""!=shendtime&&null!=shendtime){
				sql += " and a.item_VC_SHFSSJ <= to_date('"+shendtime +"','yyyy-mm-dd ')+1 ";
			}
		}else if("OnlineDHDCK_E".endsWith(lx)){
			if(""!=starttime&&null!=starttime){
				sql += " and a.item_FSSJ >= to_date('"+starttime +"','yyyy-mm-dd ') ";
			}
			if(""!=shendtime&&null!=shendtime){
				sql += " and a.item_FSSJ <= to_date('"+shendtime +"','yyyy-mm-dd ')+1 ";
			}

		}
		String[] datas;//筛选条件
		datas=gy.split(",");
		String SQL1="select count(a.item_"+datas[1]+") as item_counts,b.item_"+datas[3]+" item_objjc,c.item_OBJJC yyname from  tlk_"+lx+" a inner join tlk_"+datas[0]+" b on b.item_"+datas[2]+"=a.item_"+datas[1]+" inner join tlk_YY_dic c on c.item_OBJID=a.item_yybh where 1=1"+sql+" group by a.item_yybh,a.item_"+datas[1]+",b.item_"+datas[3]+",c.item_OBJJC HAVING count(a.item_"+datas[1]+")>0 order by item_yybh,item_counts desc";

		try {
			conn = dbc.getConnection();
			psts = conn.createStatement();
			rs = psts.executeQuery(SQL1);

			while (rs.next()) {
				Map<String, Object> map = new HashMap<String, Object>();
				map.put("data", rs.getInt("item_counts"));
				map.put("name", rs.getString("item_objjc"));
				map.put("yyname", rs.getString("yyname"));
				dalist.add(map);
			}
		} catch (Exception e) {
			e.getMessage();
			e.printStackTrace();
		} finally {
			close();
		}
		return dalist;

	}
	//CDC和网上信息采集现场回访
	public List<Map<String, Object>> CDCxc() throws UnsupportedEncodingException {
		List<Map<String, Object>> dalist = new ArrayList<Map<String, Object>>();
		HttpServletRequest request = ServletActionContext.getRequest();
		String starttime=request.getParameter("starttime");//伤害发生时间
		String shendtime=request.getParameter("shendtime");//伤害结束时间
		String gxstarttime=request.getParameter("gxstarttime");//数据更新开始时间
		String gxendtime=request.getParameter("gxendtime");//数据更新结束时间
		String yys=request.getParameter("yys");
		String gy=request.getParameter("datatime");//数据项
		String lx=request.getParameter("lx");//区分CDC和网上信息采集

		String sql="";
		if("ProductICSICard".endsWith(lx)){
			if(""!=starttime&&null!=starttime){
				sql += " and a.item_VC_SHFSSJ >= to_date('"+starttime +"','yyyy-mm-dd ') ";
			}

		 }else if("OnlineXCDCK_E".endsWith(lx)){
			 if(""!=starttime&&null!=starttime){
					sql += " and a.item_FSSJ >= to_date('"+starttime +"','yyyy-mm-dd ') ";
				}
				if(""!=shendtime&&null!=shendtime){
					sql += " and a.item_FSSJ <= to_date('"+shendtime +"','yyyy-mm-dd ')+1 ";
				}

		 }
		if(""!=shendtime&&null!=shendtime){
			sql += " and a.item_VC_SHFSSJ <= to_date('"+shendtime +"','yyyy-mm-dd ')+1 ";
		}
		if(""!=gxstarttime&&null!=gxstarttime){
			sql += " and a.LASTMODIFIED >= to_date('"+gxstarttime +"','yyyy-mm-dd ') ";
		}
		if(""!=gxendtime&&null!=gxendtime){
			sql += " and a.LASTMODIFIED <= to_date('"+gxendtime +"','yyyy-mm-dd ')+1 ";
		}
		if(""!=yys&&null!=yys){
			String  yyshuju[]=yys.split("::");
			String  yytj="";//条件
			for(int i=0;i<yyshuju.length;i++){
				String  yytl[]=yyshuju[i].split(";");

				for(int j=0;j<yytl.length;j++){
					if(j==(yytl.length-1)){
						yytj+="'"+yytl[j]+"'";
						}else{
						yytj+="'"+yytl[j]+"',";
						}

				}
			}
			 sql += " and a.item_yybh in("+ yytj+") ";

		}
		String[] datas;//筛选条件
		datas=gy.split(",");

		String SQL1="select count(a.item_"+datas[1]+") as item_counts,b.item_"+datas[3]+" item_objjc,c.item_OBJJC yyname from  tlk_"+lx+" a inner join tlk_"+datas[0]+" b on b.item_"+datas[2]+"=a.item_"+datas[1]+" inner join tlk_YY_dic c on c.item_OBJID=a.item_yybh where 1=1"+sql+"  group by a.item_yybh,a.item_"+datas[1]+",b.item_"+datas[3]+",c.item_OBJJC HAVING count(a.item_"+datas[1]+")>0 order by item_yybh,item_counts desc";

		try {
			conn = dbc.getConnection();
			psts = conn.createStatement();
			rs = psts.executeQuery(SQL1);

			while (rs.next()) {
				Map<String, Object> map = new HashMap<String, Object>();
				map.put("data", rs.getInt("item_counts"));
				map.put("name", rs.getString("item_objjc"));
				map.put("yyname", rs.getString("yyname"));
				dalist.add(map);
			}
		} catch (Exception e) {
			e.getMessage();
			e.printStackTrace();
		} finally {
			close();
		}
		return dalist;

	}
	//CDC报告卡质量统计
		public List<Map<String, Object>> CDCzl() throws UnsupportedEncodingException {
			List<Map<String, Object>> dalist = new ArrayList<Map<String, Object>>();
			HttpServletRequest request = ServletActionContext.getRequest();
			String starttime=request.getParameter("starttime");//伤害发生时间
			String shendtime=request.getParameter("shendtime");//伤害结束时间
			String gxstarttime=request.getParameter("gxstarttime");//数据更新开始时间
			String gxendtime=request.getParameter("gxendtime");//数据更新结束时间
			String yys=request.getParameter("yys");
			String lx=request.getParameter("lx");//区分CDC和网上信息采集
			String sql="";
			String  SQL1="";
			if("SHJCBBK_E".endsWith(lx)){
				if(""!=starttime&&null!=starttime){
					sql += " and a.item_VC_SHFSSJ >= to_date('"+starttime +"','yyyy-mm-dd ') ";
				}
				if(""!=shendtime&&null!=shendtime){
					sql += " and a.item_VC_SHFSSJ <= to_date('"+shendtime +"','yyyy-mm-dd ')+1 ";
				}
				if(""!=gxstarttime&&null!=gxstarttime){
					sql += " and a.item_INTANALYSISDBTime >= to_date('"+gxstarttime +"','yyyy-mm-dd ') ";
				}
				if(""!=gxendtime&&null!=gxendtime){
					sql += " and a.item_INTANALYSISDBTime <= to_date('"+gxendtime +"','yyyy-mm-dd ')+1 ";
				}
				if(""!=yys&&null!=yys){
					String  yyshuju[]=yys.split("::");
					String  yytj="";//条件
					for(int i=0;i<yyshuju.length;i++){
						String  yytl[]=yyshuju[i].split(";");

						for(int j=0;j<yytl.length;j++){
							if(j==(yytl.length-1)){
								yytj+="'"+yytl[j]+"'";
								}else{
								yytj+="'"+yytl[j]+"',";
								}

						}
					}
					 sql += " and a.ITEM_VC_JCYYBH in("+ yytj+") ";

				}
				  SQL1="select b.item_OBJJC qyname,c.item_OBJJC yyname,  count(a.item_VC_LXDH) as item_counts,a.item_VC_LXDH from  tlk_SHJCBBK_E a inner join tlk_YY_dic c on c.item_OBJID=a.item_VC_JCYYBH inner join tlk_QY_dic b on b.item_OBJID=c.item_OBJQY where 1=1"+sql+"  group by a.item_VC_JCYYBH,a.item_VC_LXDH,b.item_OBJJC,c.item_OBJJC HAVING count(a.item_VC_LXDH)>1 order by item_VC_JCYYBH,item_counts desc";
			}else 	if("Online_zb_E".endsWith(lx)){
				if(""!=starttime&&null!=starttime){
					sql += " and a.ITEM_happen_time >= to_date('"+starttime +"','yyyy-mm-dd ') ";
				}
				if(""!=shendtime&&null!=shendtime){
					sql += " and a.ITEM_happen_time <= to_date('"+shendtime +"','yyyy-mm-dd ')+1 ";
				}
				if(""!=gxstarttime&&null!=gxstarttime){
					sql += " and a.item_INTANALYSISDBTime >= to_date('"+gxstarttime +"','yyyy-mm-dd ') ";
				}
				if(""!=gxendtime&&null!=gxendtime){
					sql += " and a.item_INTANALYSISDBTime <= to_date('"+gxendtime +"','yyyy-mm-dd ')+1 ";
				}
				if(""!=yys&&null!=yys){
					String  yyshuju[]=yys.split("::");
					String  yytj="";//条件
					for(int i=0;i<yyshuju.length;i++){
						String  yytl[]=yyshuju[i].split(";");

						for(int j=0;j<yytl.length;j++){
							if(j==(yytl.length-1)){
								yytj+="'"+yytl[j]+"'";
								}else{
								yytj+="'"+yytl[j]+"',";
								}

						}
					}
					 sql += " and a.ITEM_JCYY in("+ yytj+") ";

				}
				  SQL1="select b.item_OBJJC qyname,c.item_OBJJC yyname,  count(a.item_tel) as item_counts,a.item_tel item_VC_LXDH from  tlk_Online_zb_E a inner join tlk_YY_dic c on c.item_OBJID=a.item_JCYY inner join tlk_QY_dic b on b.item_OBJID=c.item_OBJQY where 1=1"+sql+"  group by a.item_JCYY,a.item_tel,b.item_OBJJC,c.item_OBJJC HAVING count(a.item_tel)>1 order by item_JCYY,item_counts desc";
			}
			try {
				conn = dbc.getConnection();
				psts = conn.createStatement();
				rs = psts.executeQuery(SQL1);

				while (rs.next()) {
					Map<String, Object> map = new HashMap<String, Object>();
					map.put("data", rs.getInt("item_counts"));
					map.put("name", rs.getString("item_VC_LXDH"));
					map.put("yyname", rs.getString("yyname"));
					map.put("qyname", rs.getString("qyname"));
					dalist.add(map);
				}
			} catch (Exception e) {
				e.getMessage();
				e.printStackTrace();
			} finally {
				close();
			}
			return dalist;

		}

	//CDC分析数据
	public List<Map<String, Object>> DataItem() throws UnsupportedEncodingException {
		List<Map<String, Object>> dalist = new ArrayList<Map<String, Object>>();
		String sql1="select item_objid,item_objjc,formname  from DataItem";
		try {
			conn = dbc.getConnection();
			psts = conn.createStatement();
			qy=psts.executeQuery(sql1);
			while (qy.next()) {
				Map<String, Object> map2 = new HashMap<String, Object>();
					map2.put("item_objid", qy.getString("item_objid"));
					map2.put("item_objjc", qy.getString("item_objjc"));
					map2.put("formname", qy.getString("formname"));
					dalist.add(map2);
			}
		} catch (Exception e) {
			e.getMessage();
			e.printStackTrace();
		} finally {
			close();
		}
		return dalist;
	}

	//网上采集分析数据
	public List<Map<String, Object>> WSDataItem() throws UnsupportedEncodingException {
		List<Map<String, Object>> dalist = new ArrayList<Map<String, Object>>();
		String sql1="select item_objid,item_objjc,formname  from WDATAITEM";
		try {
			conn = dbc.getConnection();
			psts = conn.createStatement();
			qy=psts.executeQuery(sql1);
			while (qy.next()) {
				Map<String, Object> map2 = new HashMap<String, Object>();
					map2.put("item_objid", qy.getString("item_objid"));
					map2.put("item_objjc", qy.getString("item_objjc"));
					map2.put("formname", qy.getString("formname"));
					dalist.add(map2);
			}
		} catch (Exception e) {
			e.getMessage();
			e.printStackTrace();
		} finally {
			close();
		}
		return dalist;
	}
	//电话回访下拉数据项
		public List<Map<String, Object>> DHsj() throws UnsupportedEncodingException {
			List<Map<String, Object>> dalist = new ArrayList<Map<String, Object>>();
			String gy=request.getParameter("datatime");//数据项
			String[] datas;//筛选条件
			datas=gy.split(",");
			String sql1="select item_"+datas[3]+" as item_objjc  from tlk_"+datas[0];
			try {
				conn = dbc.getConnection();
				psts = conn.createStatement();
				qy=psts.executeQuery(sql1);
				while (qy.next()) {
					Map<String, Object> map2 = new HashMap<String, Object>();
						map2.put("item_objjc", qy.getString("item_objjc"));
						dalist.add(map2);
				}
			} catch (Exception e) {
				e.getMessage();
				e.printStackTrace();
			} finally {
				close();
			}
			return dalist;
		}
	/*public List<Map<String, Object>> CDCcontinuegl2() throws UnsupportedEncodingException {
		List<Map<String, Object>> dalist = new ArrayList<Map<String, Object>>();
		HttpServletRequest request = ServletActionContext.getRequest();
		HttpSession session =  request.getSession();
		String conditions = URLDecoder.decode(request.getParameter("conditions"),"utf-8");
		String conditions1 = URLDecoder.decode(request.getParameter("conditions1"),"utf-8");
		String conditions2=request.getParameter("conditions2");
		session.setAttribute("conditions2",conditions2);
		conditions2 = URLDecoder.decode(conditions2,"utf-8");
		String bm1=request.getParameter("bm1");
		String bm2=request.getParameter("bm2");
		String bm3=request.getParameter("bm3");
		String zd3=request.getParameter("zd3");
		String zd2=request.getParameter("zd2");
		String zd=request.getParameter("zd");
		String zd1=request.getParameter("zd1");
		String jk=request.getParameter("jk");
		String jk1=request.getParameter("jk1");

		String sj=request.getParameter("sj");
		String sjtj[]=sj.split(",");
		session.setAttribute("bm4",sjtj[0]);
		session.setAttribute("zd4",sjtj[1]);
		String sql1="SELECT B.Item_Objjc item_xl,COUNT(b.Item_Objjc) item_counts FROM tlk_SHJCBBK_E a LEFT JOIN tlk_"+sjtj[0]+" b ON a.item_"+sjtj[1]+"=b.item_objid left join tlk_"+bm1+" c  on c.item_objjc='"+conditions+"'left join tlk_"+bm2+" d  on d.item_objjc='"+conditions1+"' WHERE item_dbType   ='1'AND item_"+zd+" IN ("+jk+")AND item_"+zd1+"=c.item_objid AND item_"+zd2+"=d.item_objid GROUP BY (B.Item_Objjc)";
		try {
			conn = dbc.getConnection();
			psts = conn.createStatement();
			qy=psts.executeQuery(sql1);
			while (qy.next()) {
				Map<String, Object> map2 = new HashMap<String, Object>();
				DataEntity de1 = new DataEntity();
					de1.setName(qy.getString("item_xl"));
					de1.setCounts(qy.getInt("item_counts"));
					map2.put("data", de1.getCounts());
					map2.put("name", de1.getName());
					dalist.add(map2);
			}
		} catch (Exception e) {
			e.getMessage();
			e.printStackTrace();
		} finally {
			close();
		}
		return dalist;
	}*/
	//网上信息采集关联分析
	public List<Map<String, Object>> Onlneglfx() throws UnsupportedEncodingException {
		List<Map<String, Object>> dalist = new ArrayList<Map<String, Object>>();
		HttpSession session =  request.getSession();
		String starttime=request.getParameter("starttime");
		String shendtime=request.getParameter("shendtime");
		String gxstarttime=request.getParameter("gxstarttime");
		String gxendtime=request.getParameter("gxendtime");
		String yys=request.getParameter("yys");
		String wpdl=request.getParameter("wpdl");//物品大类
		String wpzl=request.getParameter("wpzl");//物品中类
		String wpxl=request.getParameter("wpxl");//物品小类
		String wpname=request.getParameter("wpname");//物品名称
		String sheng=request.getParameter("sheng");//省
		String shi=request.getParameter("shi");//市
		String xian=request.getParameter("xian");//县
		String address=request.getParameter("address");//详细地址
		String xm=request.getParameter("xm");
		String xb=request.getParameter("xb");
		String dh=request.getParameter("dh");
		if(""!=xm&&null!=xm){
			 xm=java.net.URLDecoder.decode(xm,"utf-8");//对汉字进行解码
			}
		if(""!=wpname&&null!=wpname){
			wpname=java.net.URLDecoder.decode(wpname,"utf-8");//对汉字进行解码
			}
		if(""!=address&&null!=address){
			address=java.net.URLDecoder.decode(address,"utf-8");//对汉字进行解码
			}
		String checkss=request.getParameter("checks");
		String checks=java.net.URLDecoder.decode(checkss,"utf-8");//对汉字进行解码
		String  shuju[]=checks.split("::");
		String  table1[]=shuju[0].split(";");
		String  table2[]=shuju[1].split(";");
		String  bm="";//表名
		String  zd="";//字段名
		String  jk="";//条件
		String  bm1="";
		String  zd1="";
		String  jk1="";
		String  table4[]=table1[0].split(",");
		String  table5[]=table2[0].split(",");
		String fxk=table4[3];
		String fxk1=table5[3];
		for(int j=0;j<table1.length;j++){
			String  table3[]=table1[j].split(",");
			bm=table3[0];
			zd=table3[1];
			if(j==(table1.length-1)){
			jk+="'"+table3[2]+"'";
			}else{
			jk+="'"+table3[2]+"',";
			}
		}
		for(int j=0;j<table2.length;j++){
			String  table3[]=table2[j].split(",");
			bm1=table3[0];
			zd1=table3[1];
			if(j==(table2.length-1)){
			jk1+="'"+table3[2]+"'";
			}else{
			jk1+="'"+table3[2]+"',";
			}
		}
		session.setAttribute("sheng", sheng);
		session.setAttribute("shi", shi);
		session.setAttribute("xian", xian);
		session.setAttribute("address", address);
		session.setAttribute("wpdl", wpdl);
		session.setAttribute("wpzl", wpzl);
		session.setAttribute("wpxl", wpxl);
		session.setAttribute("wpname", wpname);
		session.setAttribute("xm", xm);
		session.setAttribute("dh", dh);
		session.setAttribute("xb", xb);
		session.setAttribute("bm", bm);
	    session.setAttribute("bm1", bm1);
		session.setAttribute("zd", zd);
	    session.setAttribute("zd1", zd1);
	    session.setAttribute("jk", jk);
	    session.setAttribute("jk1", jk1);
	    session.setAttribute("starttime", starttime);
	    session.setAttribute("shendtime", shendtime);
		session.setAttribute("gxstarttime", gxstarttime);
	    session.setAttribute("gxendtime", gxendtime);
	    session.setAttribute("yys", yys);
	    session.setAttribute("fxk", fxk);
	    session.setAttribute("fxk1", fxk1);
		String sql="";
		if(""!=starttime&&null!=starttime){
			sql += " and item_happen_time >= to_date('"+starttime +"','yyyy-mm-dd ') ";
		}
		if(""!=shendtime&&null!=shendtime){
			sql += " and item_happen_time <= to_date('"+shendtime +"','yyyy-mm-dd ')+1 ";
		}
		if(""!=gxstarttime&&null!=gxstarttime){
			sql += " and item_INTANALYSISDBTime >= to_date('"+gxstarttime +"','yyyy-mm-dd ') ";
		}
		if(""!=gxendtime&&null!=gxendtime){
			sql += " and item_INTANALYSISDBTime <= to_date('"+gxendtime +"','yyyy-mm-dd')+1 ";
		}
		if(""!=yys&&null!=yys){
			String  yyshuju[]=yys.split("::");
			String  yytj="";//条件
			for(int i=0;i<yyshuju.length;i++){
				String  yytl[]=yyshuju[i].split(";");

				for(int j=0;j<yytl.length;j++){
					if(j==(yytl.length-1)){
						yytj+="'"+yytl[j]+"'";
						}else{
						yytj+="'"+yytl[j]+"',";
						}

				}
			}
			 sql += " and ITEM_JCYY in("+ yytj+") ";

		}
		if(""!=wpdl&&null!=wpdl){
			String  yyshuju[]=wpdl.split("::");
			String  yytj="";//条件
			for(int i=0;i<yyshuju.length;i++){
					if(i==(yyshuju.length-1)){
						yytj+="'"+yyshuju[i]+"'";
						}else{
						yytj+="'"+yyshuju[i]+"',";
						}
			}
			   sql += " and ITEM_VC_WP1_DLDM in ("+yytj+") ";
			}
		if(""!=wpzl&&null!=wpzl){
			String  yyshuju[]=wpzl.split("::");
			String  yytj="";//条件
			for(int i=0;i<yyshuju.length;i++){
					if(i==(yyshuju.length-1)){
						yytj+="'"+yyshuju[i]+"'";
						}else{
						yytj+="'"+yyshuju[i]+"',";
						}
			}
			 sql += " and ITEM_VC_WP1_ZLDM in("+yytj+") ";
			}
		if(""!=wpxl&&null!=wpxl){
			String  yyshuju[]=wpxl.split("::");
			String  yytj="";//条件
			for(int i=0;i<yyshuju.length;i++){
					if(i==(yyshuju.length-1)){
						yytj+="'"+yyshuju[i]+"'";
						}else{
						yytj+="'"+yyshuju[i]+"',";
						}
			}
			   sql += " and ITEM_VC_WP1_XLDM in ("+yytj+") ";
			}
		if(""!=wpname&&null!=wpname){
			 sql += " and ITEM_product_name in  (select BMNAME from  wplist where WPNAME='"+wpname+"') ";
			}
		if(""!=sheng&&null!=sheng){
			   sql += " and ITEM_province = '"+sheng+"' ";
			}
		if(""!=shi&&null!=shi){
			   sql += " and ITEM_city = '"+shi+"' ";
			}
		if(""!=xian&&null!=xian){
			   sql += " and ITEM_area = '"+xian+"' ";
			}
		if(""!=address&&null!=address){
			   sql += " and ITEM_address_all like '%"+address+"%'  ";
			}
		if(""!=xm&&null!=xm){
			   sql += " and ITEM_name like '%"+xm+"%' ";
			}
		if(""!=xb&&null!=xb){
			   sql += " and ITEM_sex = '"+xb+"' ";
			}
		if("1".equals(dh)){
			   sql += " and ITEM_tel is not null ";
		}else if("2".equals(dh)){
			sql += " and ITEM_tel is  null ";
		}
		String sql1="SELECT B.Item_Objjc item_xl,count(C.Item_Objjc) item_counts,C.Item_Objjc item_zy FROM tlk_Online_zb_E a LEFT JOIN tlk_"+bm1+" b ON a.item_"+zd1+"=b.item_objid LEFT JOIN tlk_"+bm+" c ON c.item_objid=a.item_"+zd+" where   item_"+zd1+" in ("+jk1+")and item_"+zd+" in ("+jk+")"+sql+" group by rollup(B.Item_Objjc,C.Item_Objjc)";
		try {
			conn = dbc.getConnection();
			psts = conn.createStatement();
			qy=psts.executeQuery(sql1);
			while (qy.next()) {
				Map<String, Object> map2 = new HashMap<String, Object>();
				DataEntity de1 = new DataEntity();
				if((qy.getString("item_zy"))!=null){
					de1.setGlxl(qy.getString("item_xl"));
					de1.setName(qy.getString("item_zy"));
					de1.setCounts(qy.getInt("item_counts"));
					map2.put("data", de1.getCounts());
					map2.put("glgx", de1.getGlxl());
					map2.put("name", de1.getName());
					dalist.add(map2);
				}
			}
		} catch (Exception e) {
			e.getMessage();
			e.printStackTrace();
		} finally {
			close();
		}
		return dalist;

	}//网上信息采集关联继续分析
	public List<Map<String, Object>> Onlinecontinuegl() throws UnsupportedEncodingException {
		List<Map<String, Object>> dalist = new ArrayList<Map<String, Object>>();
		HttpSession session=request.getSession();
		String bm=(String)session.getAttribute("bm");
		String bm1=(String)session.getAttribute("bm1");
		String jk=(String)session.getAttribute("jk");
		String jk1=(String)session.getAttribute("jk1");
		String zd=(String)session.getAttribute("zd");
		String zd1=(String)session.getAttribute("zd1");
		String starttime=(String)session.getAttribute("starttime");
		String shendtime=(String)session.getAttribute("shendtime");
		String gxstarttime=(String)session.getAttribute("gxstarttime");
		String gxendtime=(String)session.getAttribute("gxendtime");
		String yys=(String)session.getAttribute("yys");
		String gg=(String)session.getAttribute("qy");
		String xm=(String)session.getAttribute("xm");
		String xb=(String)session.getAttribute("xb");
		String dh=(String)session.getAttribute("dh");
		String wpdl=(String)session.getAttribute("wpdl");//物品大类
		String wpzl=(String)session.getAttribute("wpzl");//物品中类
		String wpxl=(String)session.getAttribute("wpxl");//物品小类
		String wpname=(String)session.getAttribute("wpname");//物品名称
		String sheng=(String)session.getAttribute("sheng");//省
		String shi=(String)session.getAttribute("shi");//市
		String xian=(String)session.getAttribute("xian");//县
		String address=(String)session.getAttribute("address");//详细地址

		String conditions=request.getParameter("conditions");
		conditions=java.net.URLDecoder.decode(conditions,"utf-8");//对汉字进行解码
		String seriesname=request.getParameter("seriesname");
		seriesname=java.net.URLDecoder.decode(seriesname,"utf-8");
		String sjsz=request.getParameter("sjsz");
		String tjsj=request.getParameter("tjsj");
		if(""!=tjsj&&null!=tjsj){
			tjsj=java.net.URLDecoder.decode(tjsj,"utf-8");//对汉字进行解码
			}
		String[] sj2=sjsz.split(";");
		String sql2="";
		String sql="";
		for(int i=0;i<sj2.length;i++){
			String[] tj=sj2[i].split(",");
			if(i==(sj2.length-1)){
			}else{
				sql2+="LEFT JOIN tlk_"+tj[0]+" b"+i+" ON b"+i+".item_objjc='"+tjsj+"' ";
				sql+="and item_"+tj[1]+"= b"+i+".item_objid ";
			}

		}
		String sj=request.getParameter("sj");
		String sjtj[]=sj.split(",");
		if(""!=starttime&&null!=starttime){
			sql += " and item_happen_time >= to_date('"+starttime +"','yyyy-mm-dd ') ";
		}
		if(""!=shendtime&&null!=shendtime){
			sql += " and item_happen_time <= to_date('"+shendtime +"','yyyy-mm-dd ') ";
		}
		if(""!=gxstarttime&&null!=gxstarttime){
			sql += " and item_INTANALYSISDBTime >= to_date('"+gxstarttime +"','yyyy-mm-dd') ";
		}
		if(""!=gxendtime&&null!=gxendtime){
			sql += " and item_INTANALYSISDBTime <= to_date('"+gxendtime +"','yyyy-mm-dd')+1 ";
		}
		if(""!=yys&&null!=yys){
			String  yyshuju[]=yys.split("::");
			String  yytj="";//条件
			for(int i=0;i<yyshuju.length;i++){
				String  yytl[]=yyshuju[i].split(";");

				for(int j=0;j<yytl.length;j++){
					if(j==(yytl.length-1)){
						yytj+="'"+yytl[j]+"'";
						}else{
						yytj+="'"+yytl[j]+"',";
						}

				}
			}
			 sql += " and ITEM_JCYY in("+ yytj+") ";

		}
		if(""!=wpdl&&null!=wpdl){
			String  yyshuju[]=wpdl.split("::");
			String  yytj="";//条件
			for(int i=0;i<yyshuju.length;i++){
					if(i==(yyshuju.length-1)){
						yytj+="'"+yyshuju[i]+"'";
						}else{
						yytj+="'"+yyshuju[i]+"',";
						}
			}
			   sql += " and ITEM_VC_WP1_DLDM in ("+yytj+") ";
			}
		if(""!=wpzl&&null!=wpzl){
			String  yyshuju[]=wpzl.split("::");
			String  yytj="";//条件
			for(int i=0;i<yyshuju.length;i++){
					if(i==(yyshuju.length-1)){
						yytj+="'"+yyshuju[i]+"'";
						}else{
						yytj+="'"+yyshuju[i]+"',";
						}
			}
			 sql += " and ITEM_VC_WP1_ZLDM in("+yytj+") ";
			}
		if(""!=wpxl&&null!=wpxl){
			String  yyshuju[]=wpxl.split("::");
			String  yytj="";//条件
			for(int i=0;i<yyshuju.length;i++){
					if(i==(yyshuju.length-1)){
						yytj+="'"+yyshuju[i]+"'";
						}else{
						yytj+="'"+yyshuju[i]+"',";
						}
			}
			   sql += " and ITEM_VC_WP1_XLDM in ("+yytj+") ";
			}
		if(""!=wpname&&null!=wpname){
			 sql += " and ITEM_product_name in  (select BMNAME from  wplist where WPNAME='"+wpname+"') ";
			}
		if(""!=sheng&&null!=sheng){
			   sql += " and ITEM_province = '"+sheng+"' ";
			}
		if(""!=shi&&null!=shi){
			   sql += " and ITEM_city = '"+shi+"' ";
			}
		if(""!=xian&&null!=xian){
			   sql += " and ITEM_area = '"+xian+"' ";
			}
		if(""!=address&&null!=address){
			   sql += " and ITEM_address_all like '%"+address+"%'  ";
			}
		if(""!=xm&&null!=xm){
			   sql += " and ITEM_name like '%"+xm+"%' ";
			}
		if(""!=xb&&null!=xb){
			   sql += " and ITEM_sex = '"+xb+"' ";
			}
		if("1".equals(dh)){
			   sql += " and ITEM_tel is not null ";
		}else if("2".equals(dh)){
			sql += " and ITEM_tel is  null ";
		}
		String sql1="SELECT B.Item_Objjc item_xl,COUNT(b.Item_Objjc) item_counts FROM tlk_Online_zb_E a LEFT JOIN tlk_"+sjtj[0]+" b on a.item_"+sjtj[1]+"=b.item_objid  "+sql2+" left join tlk_"+bm1+" c  on c.item_objjc='"+conditions+"' left join tlk_"+bm+" d  on d.item_objjc='"+seriesname+"' WHERE  item_"+zd+"=d.item_objid AND item_"+zd1+"=c.item_objid "+sql+" GROUP BY (B.Item_Objjc)";
		try {
			conn = dbc.getConnection();
			psts = conn.createStatement();
			qy=psts.executeQuery(sql1);
			while (qy.next()) {
				Map<String, Object> map2 = new HashMap<String, Object>();
				DataEntity de1 = new DataEntity();
					de1.setName(qy.getString("item_xl"));
					de1.setCounts(qy.getInt("item_counts"));
					map2.put("data", de1.getCounts());
					map2.put("name", de1.getName());
					dalist.add(map2);

			}
		} catch (Exception e) {
			e.getMessage();
			e.printStackTrace();
		} finally {
			close();
		}
		return dalist;

	}
	//	CDC物品统计分析
	public List<Map<String, Object>> Wptj() {
		List<Map<String, Object>> dalist = new ArrayList<Map<String, Object>>();
		HttpServletRequest request = ServletActionContext.getRequest();
		String starttime=request.getParameter("starttime");
		String shendtime=request.getParameter("shendtime");
		String gxstarttime=request.getParameter("gxstarttime");
		String gxendtime=request.getParameter("gxendtime");
		String sql="";
		if(""!=starttime&&null!=starttime){
			sql += " and item_VC_SHFSSJ >= to_date('"+starttime +"','yyyy-mm-dd') ";
		}
		if(""!=shendtime&&null!=shendtime){
			sql += " and item_VC_SHFSSJ <= to_date('"+shendtime +"','yyyy-mm-dd ')+1 ";
		}
		if(""!=gxstarttime&&null!=gxstarttime){
			sql += " and item_INTANALYSISDBTime >= to_date('"+gxstarttime +"','yyyy-mm-dd ') ";
		}
		if(""!=gxendtime&&null!=gxendtime){
			sql += " and item_INTANALYSISDBTime <= to_date('"+gxendtime +"','yyyy-mm-dd ')+1 ";
		}
		String SQL1="select count(b.wpname) item_counts,b.wpname item_objjc from tlk_SHJCBBK_E a,wplist b where a.item_VC_SHSJWPMC1=b.bmname "+sql+"Group By b.wpname Order By item_counts desc";
		try {
			conn = dbc.getConnection();
			psts = conn.createStatement();
			rs = psts.executeQuery(SQL1);

			while (rs.next()) {
				Map<String, Object> map = new HashMap<String, Object>();
				DataEntity de = new DataEntity();
				de.setName(rs.getString("item_objjc"));
				de.setCounts(rs.getInt("item_counts"));
				map.put("data", de.getCounts());
				map.put("name", de.getName());
				dalist.add(map);
			}
		} catch (Exception e) {
			e.getMessage();
			e.printStackTrace();
		} finally {
			close();
		}
		return dalist;

	}
	//网上信息采集分析(包含排名分析)
	public List<Map<String, Object>> online() throws UnsupportedEncodingException {
		List<Map<String, Object>> dalist = new ArrayList<Map<String, Object>>();
		HttpServletRequest request = ServletActionContext.getRequest();
		String starttime=request.getParameter("starttime");
		String shendtime=request.getParameter("shendtime");
		String gxstarttime=request.getParameter("gxstarttime");
		String gxendtime=request.getParameter("gxendtime");
		String yys=request.getParameter("yys");
		String wpdl=request.getParameter("wpdl");//物品大类
		String wpzl=request.getParameter("wpzl");//物品中类
		String wpxl=request.getParameter("wpxl");//物品小类
		String wpname=request.getParameter("wpname");//物品名称
		String sheng=request.getParameter("sheng");//省
		String shi=request.getParameter("shi");//市
		String xian=request.getParameter("xian");//县
		String address=request.getParameter("address");//详细地址
		String gy=request.getParameter("datatime");
		String pm=request.getParameter("pm");
		String xm=request.getParameter("xm");
		String xb=request.getParameter("xb");
		String dh=request.getParameter("dh");
		if(""!=xm&&null!=xm){
			 xm=java.net.URLDecoder.decode(xm,"utf-8");//对汉字进行解码
			}
		if(""!=wpname&&null!=wpname){
			wpname=java.net.URLDecoder.decode(wpname,"utf-8");//对汉字进行解码
			}
		if(""!=address&&null!=address){
			address=java.net.URLDecoder.decode(address,"utf-8");//对汉字进行解码
			}
		String checkss=request.getParameter("checks");//所选中复选框的值
		String sql="";
		if(""!=checkss&&null!=checkss){
				String checks=java.net.URLDecoder.decode(checkss,"utf-8");//对汉字进行解码
				String  shuju[]=checks.split("::");
				for(int i=0;i<shuju.length;i++){
					String  table1[]=shuju[i].split(";");
					String  zd="";//字段名
					String  jk="";//条件
					for(int j=0;j<table1.length;j++){
						String  table3[]=table1[j].split(",");

						zd=table3[1];
						if(j==(table1.length-1)){
						jk+="'"+table3[2]+"'";
						sql+=" and item_"+zd+" in ("+jk+") ";
						}else{
						jk+="'"+table3[2]+"',";
						}
					}
				}
		}

		if(""!=starttime&&null!=starttime){
			sql += " and item_happen_time >= to_date('"+starttime +"','yyyy-mm-dd ') ";
		}
		if(""!=shendtime&&null!=shendtime){
			sql += " and item_happen_time <= to_date('"+shendtime +"','yyyy-mm-dd ') ";
		}
		if(""!=gxstarttime&&null!=gxstarttime){
			sql += " and item_INTANALYSISDBTime >= to_date('"+gxstarttime +"','yyyy-mm-dd ') ";
		}
		if(""!=gxendtime&&null!=gxendtime){
			sql += " and item_INTANALYSISDBTime <= to_date('"+gxendtime +"','yyyy-mm-dd ')+1 ";
		}
		if(""!=yys&&null!=yys){
			String  yyshuju[]=yys.split("::");
			String  yytj="";//条件
			for(int i=0;i<yyshuju.length;i++){
				String  yytl[]=yyshuju[i].split(";");

				for(int j=0;j<yytl.length;j++){
					if(j==(yytl.length-1)){
						yytj+="'"+yytl[j]+"'";
						}else{
						yytj+="'"+yytl[j]+"',";
						}

				}
			}
			 sql += " and ITEM_JCYY in("+ yytj+") ";

		}
		if(""!=wpdl&&null!=wpdl){
			String  yyshuju[]=wpdl.split("::");
			String  yytj="";//条件
			for(int i=0;i<yyshuju.length;i++){
					if(i==(yyshuju.length-1)){
						yytj+="'"+yyshuju[i]+"'";
						}else{
						yytj+="'"+yyshuju[i]+"',";
						}
			}
			   sql += " and ITEM_VC_WP1_DLDM in ("+yytj+") ";
			}
		if(""!=wpzl&&null!=wpzl){
			String  yyshuju[]=wpzl.split("::");
			String  yytj="";//条件
			for(int i=0;i<yyshuju.length;i++){
					if(i==(yyshuju.length-1)){
						yytj+="'"+yyshuju[i]+"'";
						}else{
						yytj+="'"+yyshuju[i]+"',";
						}
			}
			 sql += " and ITEM_VC_WP1_ZLDM in("+yytj+") ";
			}
		if(""!=wpxl&&null!=wpxl){
			String  yyshuju[]=wpxl.split("::");
			String  yytj="";//条件
			for(int i=0;i<yyshuju.length;i++){
					if(i==(yyshuju.length-1)){
						yytj+="'"+yyshuju[i]+"'";
						}else{
						yytj+="'"+yyshuju[i]+"',";
						}
			}
			   sql += " and ITEM_VC_WP1_XLDM in ("+yytj+") ";
			}
		if(""!=wpname&&null!=wpname){
			 sql += " and ITEM_product_name in  (select BMNAME from  wplist where WPNAME='"+wpname+"') ";
			}
		if(""!=sheng&&null!=sheng){
			   sql += " and ITEM_province = '"+sheng+"' ";
			}
		if(""!=shi&&null!=shi){
			   sql += " and ITEM_city = '"+shi+"' ";
			}
		if(""!=xian&&null!=xian){
			   sql += " and ITEM_area = '"+xian+"' ";
			}
		if(""!=address&&null!=address){
			   sql += " and ITEM_address_all like '%"+address+"%'  ";
			}
		if(""!=xm&&null!=xm){
			   sql += " and ITEM_name like '%"+xm+"%' ";
			}
		if(""!=xb&&null!=xb){
			   sql += " and ITEM_sex = '"+xb+"' ";
			}
		if("1".equals(dh)){
			   sql += " and ITEM_tel is not null ";
		}else if("2".equals(dh)){
			sql += " and ITEM_tel is  null  ";
		}
		String[] datas;
		String SQL1="";
		datas=gy.split(",");
		if("wplist".endsWith(datas[0])){
			SQL1="select count(item_"+datas[1]+")as item_counts,b.bmname as item_objjc from tlk_Online_zb_E a, "+datas[0]+" b where a.item_"+datas[1]+"=b.bmname "+sql+"group by a.item_"+datas[1]+",b.bmname order by item_counts desc";
		}else{
			SQL1="select count(item_"+datas[1]+")as item_counts,b.item_objjc from tlk_Online_zb_E a, TLK_"+datas[0]+" b where a.item_"+datas[1]+"=b.item_objid "+sql+"group by a.item_"+datas[1]+",b.item_objjc order by item_counts desc";
		}
		try {
			conn = dbc.getConnection();
			psts = conn.createStatement();
			if(""!=pm){
				 String slq2="select * from ("+SQL1+") where rownum<="+pm;
				 rs = psts.executeQuery(slq2);
			  }else{
					rs = psts.executeQuery(SQL1);
					}

			while (rs.next()) {
				Map<String, Object> map = new HashMap<String, Object>();
				DataEntity de = new DataEntity();
				de.setName(rs.getString("item_objjc"));
				de.setCounts(rs.getInt("item_counts"));
				map.put("data", de.getCounts());
				map.put("name", de.getName());
				dalist.add(map);
			}
		} catch (Exception e) {
			e.getMessage();
			e.printStackTrace();
		} finally {
			close();
		}
		return dalist;

	}
	//网上信息采集物品统计分析
	public List<Map<String, Object>> onlineWptj() {
		List<Map<String, Object>> dalist = new ArrayList<Map<String, Object>>();
		HttpServletRequest request = ServletActionContext.getRequest();
		String starttime=request.getParameter("starttime");
		String shendtime=request.getParameter("shendtime");
		String gxstarttime=request.getParameter("gxstarttime");
		String gxendtime=request.getParameter("gxendtime");
		String sql="";
		if(""!=starttime&&null!=starttime){
			sql += " and item_happen_time >= to_date('"+starttime +"','yyyy-mm-dd ')";
		}
		if(""!=shendtime&&null!=shendtime){
			sql += " and item_happen_time <= to_date('"+shendtime +"','yyyy-mm-dd ')";
		}
		if(""!=gxstarttime&&null!=gxstarttime){
			sql += " and item_INTANALYSISDBTime >= to_date('"+gxstarttime +"','yyyy-mm-dd')";
		}
		if(""!=gxendtime&&null!=gxendtime){
			sql += " and item_INTANALYSISDBTime <= to_date('"+gxendtime +"','yyyy-mm-dd ')+1";
		}
		String SQL1="select count(b.wpname) item_counts,b.wpname item_objjc from tlk_Online_zb_E a,wplist b where a.item_product_name=b.bmname "+sql+"Group By b.wpname Order By item_counts desc";
		try {
			conn = dbc.getConnection();
			psts = conn.createStatement();
			rs = psts.executeQuery(SQL1);

			while (rs.next()) {
				Map<String, Object> map = new HashMap<String, Object>();
				DataEntity de = new DataEntity();
				de.setName(rs.getString("item_objjc"));
				de.setCounts(rs.getInt("item_counts"));
				map.put("data", de.getCounts());
				map.put("name", de.getName());
				dalist.add(map);
			}
		} catch (Exception e) {
			e.getMessage();
			e.printStackTrace();
		} finally {
			close();
		}
		return dalist;

	}
	//数量统计highschart
	public List<Map<String, Object>> WpNumber() {
		List<Map<String, Object>> dalist = new ArrayList<Map<String, Object>>();
		HttpServletRequest request = ServletActionContext.getRequest();
		String nl=request.getParameter("nl");
		String xb=request.getParameter("xb");
		String qy=request.getParameter("qy");
		String wpname=request.getParameter("wpname");
		String sql="";
		if(""!=nl&&null!=nl){
			sql += "and item_nl='"+nl+"'";
		}
		if(""!=xb&&null!=xb){
			sql += " and item_xb='"+xb+"'";
		}
		if(""!=qy&&null!=qy){
			sql += " and item_qy ='"+qy+"'";
		}
		if(""!=wpname&&null!=wpname){
			sql += " and wid='"+wpname+"'";
		}
		String SQL1="select count(b.wpname) item_counts,b.wpname item_objjc from wpnumber a,wplist b where a.item_wpname=b.bmname "+sql+"Group By b.wpname Order By item_counts desc";
		try {
			conn = dbc.getConnection();
			psts = conn.createStatement();
			rs = psts.executeQuery(SQL1);

			while (rs.next()) {
				Map<String, Object> map = new HashMap<String, Object>();
				DataEntity de = new DataEntity();
				de.setName(rs.getString("item_objjc"));
				de.setCounts(rs.getInt("item_counts"));
				map.put("data", de.getCounts());
				map.put("name", de.getName());
				dalist.add(map);
			}
		} catch (Exception e) {
			e.getMessage();
			e.printStackTrace();
		} finally {
			close();
		}
		return dalist;

	}

	//数量统计产品名称的下拉项
	public List<Map<String, Object>> wpdic() {
		List<Map<String, Object>> dalist = new ArrayList<Map<String, Object>>();
		String sql="select distinct(b.wpname),wid from wpnumber a,wplist b where A.Item_Wpname=b.bmname";
		try {
			conn = dbc.getConnection();
			psts = conn.createStatement();
			qy=psts.executeQuery(sql);
			while (qy.next()) {
				Map<String, Object> map2 = new HashMap<String, Object>();
				DataEntity de1 = new DataEntity();
				de1.setWpname(qy.getString("wpname"));
				de1.setWpid(qy.getString("wid"));
				map2.put("wpname", de1.getWpname());
				map2.put("wpid", de1.getWpid());
				dalist.add(map2);
			}
		} catch (Exception e) {
			e.getMessage();
			e.printStackTrace();
		} finally {
			close();
		}
		return dalist;

	}
	//区域的下拉项
	public List<Map<String, Object>> aredic() {
		List<Map<String, Object>> dalist = new ArrayList<Map<String, Object>>();
		String sql="select a.ITEM_OBJID,a.ITEM_OBJJC,b.ITEM_OBJJC qy from tlk_YY_dic a inner join tlk_QY_dic b on a.ITEM_OBJQY=b.ITEM_OBJID";
		try {
			conn = dbc.getConnection();
			psts = conn.createStatement();
			qy=psts.executeQuery(sql);
			while (qy.next()) {
				Map<String, Object> map1 = new HashMap<String, Object>();
				map1.put("code", qy.getString("ITEM_OBJID"));
				map1.put("ares", qy.getString("ITEM_OBJJC"));
				map1.put("qy", qy.getString("qy"));
				dalist.add(map1);
			}
		} catch (Exception e) {
			e.getMessage();
			e.printStackTrace();
		} finally {
			close();
		}
		return dalist;

	}
	/*public List<Map<String, Object>> aredic() {
		List<Map<String, Object>> dalist = new ArrayList<Map<String, Object>>();
		String sql="select ITEM_OBJID,ITEM_OBJJC from tlk_QY_dic";
		try {
			conn = dbc.getConnection();
			psts = conn.createStatement();
			qy=psts.executeQuery(sql);
			while (qy.next()) {
				Map<String, Object> map1 = new HashMap<String, Object>();
				DataEntity de1 = new DataEntity();
				de1.setNumberingArea(qy.getString("ITEM_OBJID"));
				de1.setAres(qy.getString("ITEM_OBJJC"));
				map1.put("code", de1.getNumberingArea());
				map1.put("ares", de1.getAres());
				dalist.add(map1);
			}
		} catch (Exception e) {
			e.getMessage();
			e.printStackTrace();
		} finally {
			close();
		}
		return dalist;

	}*/
	//物品中类
	public List<Map<String, Object>> wpzldic() {
		List<Map<String, Object>> dalist = new ArrayList<Map<String, Object>>();
		HttpServletRequest request = ServletActionContext.getRequest();
		String gy=request.getParameter("id");

		if(""!=gy&&null!=gy){
			String  yyshuju[]=gy.split("::");
			String  yytj="";//条件
			for(int i=0;i<yyshuju.length;i++){
					if(i==(yyshuju.length-1)){
						yytj+="'"+yyshuju[i]+"'";
						}else{
						yytj+="'"+yyshuju[i]+"',";
						}

				}
			String sql="select ITEM_OBJID,ITEM_OBJJC,ITEM_OBJDLID from tlk_WPZL_dic where ITEM_OBJDLID in("+yytj+")";
			try {
				conn = dbc.getConnection();
				psts = conn.createStatement();
				qy=psts.executeQuery(sql);
				while (qy.next()) {
					Map<String, Object> map2 = new HashMap<String, Object>();
					map2.put("zlid", qy.getString("ITEM_OBJID"));
					map2.put("zlname",qy.getString("ITEM_OBJJC"));
					map2.put("dlid", qy.getString("ITEM_OBJDLID"));
					dalist.add(map2);
				}
			} catch (Exception e) {
				e.getMessage();
				e.printStackTrace();
			} finally {
				close();
			}
			}

		return dalist;

	}
	//物品小类
		public List<Map<String, Object>> wpxldic() {
			List<Map<String, Object>> dalist = new ArrayList<Map<String, Object>>();
			HttpServletRequest request = ServletActionContext.getRequest();
			String gy=request.getParameter("id");
			if(""!=gy&&null!=gy){
				String  yyshuju[]=gy.split("::");
				String  yytj="";//条件
				for(int i=0;i<yyshuju.length;i++){
						if(i==(yyshuju.length-1)){
							yytj+="'"+yyshuju[i]+"'";
							}else{
							yytj+="'"+yyshuju[i]+"',";
							}

					}
				String sql="select ITEM_OBJID,ITEM_OBJJC,ITEM_OBJZLID from tlk_WPXL_dic where ITEM_OBJZLID in("+yytj+")";
				try {
					conn = dbc.getConnection();
					psts = conn.createStatement();
					qy=psts.executeQuery(sql);
					while (qy.next()) {
						Map<String, Object> map2 = new HashMap<String, Object>();
						map2.put("xlid", qy.getString("ITEM_OBJID"));
						map2.put("xlname",qy.getString("ITEM_OBJJC"));
						map2.put("zlid",qy.getString("ITEM_OBJZLID"));
						dalist.add(map2);
					}
				} catch (Exception e) {
					e.getMessage();
					e.printStackTrace();
				} finally {
					close();
				}
			}
			return dalist;

		}
	//物品大类
	public List<Map<String, Object>> wpdldic() {
		List<Map<String, Object>> dalist = new ArrayList<Map<String, Object>>();
		HttpServletRequest request = ServletActionContext.getRequest();
		String gy=request.getParameter("id");
		String sql="select ITEM_OBJID,ITEM_OBJJC from tlk_WPDL_dic ";
		try {
			conn = dbc.getConnection();
			psts = conn.createStatement();
			qy=psts.executeQuery(sql);
			while (qy.next()) {
				Map<String, Object> map2 = new HashMap<String, Object>();
				DataEntity de1 = new DataEntity();
				map2.put("dlid", qy.getString("ITEM_OBJID"));
				map2.put("dlname",qy.getString("ITEM_OBJJC"));
				dalist.add(map2);
			}
		} catch (Exception e) {
			e.getMessage();
			e.printStackTrace();
		} finally {
			close();
		}
		return dalist;

	}
	//县
	public List<Map<String, Object>> Xiandic() {
		List<Map<String, Object>> dalist = new ArrayList<Map<String, Object>>();
		HttpServletRequest request = ServletActionContext.getRequest();
		String gy=request.getParameter("id");
		String sql="select item_areaname,item_areaid from tlk_area_dic where ITEM_CITYID='"+gy+"'";
		try {
			conn = dbc.getConnection();
			psts = conn.createStatement();
			qy=psts.executeQuery(sql);
			while (qy.next()) {
				Map<String, Object> map2 = new HashMap<String, Object>();
				DataEntity de1 = new DataEntity();
				de1.setHospitalBh(qy.getString("item_areaid"));
				de1.setHospital(qy.getString("item_areaname"));
				map2.put("xlid", de1.getHospitalBh());
				map2.put("xlname", de1.getHospital());
				dalist.add(map2);
			}
		} catch (Exception e) {
			e.getMessage();
			e.printStackTrace();
		} finally {
			close();
		}
		return dalist;

	}
	//市
		public List<Map<String, Object>> Shidic() {
			List<Map<String, Object>> dalist = new ArrayList<Map<String, Object>>();
			HttpServletRequest request = ServletActionContext.getRequest();
			String gy=request.getParameter("id");
			String sql="select item_cityname,item_cityid from tlk_city_dic where ITEM_PROVINCEID='"+gy+"'";
			try {
				conn = dbc.getConnection();
				psts = conn.createStatement();
				qy=psts.executeQuery(sql);
				while (qy.next()) {
					Map<String, Object> map2 = new HashMap<String, Object>();
					DataEntity de1 = new DataEntity();
					de1.setHospitalBh(qy.getString("item_cityid"));
					de1.setHospital(qy.getString("item_cityname"));
					map2.put("zlid", de1.getHospitalBh());
					map2.put("zlname", de1.getHospital());
					dalist.add(map2);
				}
			} catch (Exception e) {
				e.getMessage();
				e.printStackTrace();
			} finally {
				close();
			}
			return dalist;

		}
	//省
	public List<Map<String, Object>> Shengdic() {
		List<Map<String, Object>> dalist = new ArrayList<Map<String, Object>>();
		HttpServletRequest request = ServletActionContext.getRequest();
		String gy=request.getParameter("id");
		String sql="select ITEM_provinceID,ITEM_provincename from tlk_province_dic ";
		try {
			conn = dbc.getConnection();
			psts = conn.createStatement();
			qy=psts.executeQuery(sql);
			while (qy.next()) {
				Map<String, Object> map2 = new HashMap<String, Object>();
				DataEntity de1 = new DataEntity();
				map2.put("dlid", qy.getString("ITEM_provinceID"));
				map2.put("dlname",qy.getString("ITEM_provincename"));
				dalist.add(map2);
			}
		} catch (Exception e) {
			e.getMessage();
			e.printStackTrace();
		} finally {
			close();
		}
		return dalist;

	}
	//排名次数下拉项
	public List<Map<String, Object>> pm() {
		List<Map<String, Object>> dalist = new ArrayList<Map<String, Object>>();
		HttpServletRequest request = ServletActionContext.getRequest();
		String gy=request.getParameter("datatime");
		String[] datas;
		datas=gy.split(",");
		String sql="";
		if("wplist".endsWith(datas[0])){
			 sql="select count(distinct(bmname))as item_pm from  "+datas[0];

		}else{
			 sql="select count(distinct(item_objjc))as item_pm from  TLK_"+datas[0];

		}
		try {
			conn = dbc.getConnection();
			psts = conn.createStatement();
			qy=psts.executeQuery(sql);
			while (qy.next()) {
				Map<String, Object> map2 = new HashMap<String, Object>();
				DataEntity de1 = new DataEntity();
				de1.setPm(qy.getInt("item_pm"));
				map2.put("pm", de1.getPm());
				dalist.add(map2);
			}
		} catch (Exception e) {
			e.getMessage();
			e.printStackTrace();
		} finally {
			close();
		}
		return dalist;

	}
	/**
	 * 关闭链接
	 */
	public void close() {
		try {
			if (rs != null) {
				rs.close();
			}
			if (psts != null) {
				psts.close();
			}
			if (conn != null) {
				conn.close();
			}
		} catch (SQLException e) {

			e.printStackTrace();
		}
	}

}
package net.e_lian.bpm.custom.highcharts.action;

public class DataEntity {
	private String id;
	private String name;
	private int counts;
	private String ares;
	private String numberingArea;
	private String hospital;
	private String hospitalBh;
	private int pm;
	private String wpid;//物品id
	private String glxl;
	public String getGlxl() {
		return glxl;
	}
	public void setGlxl(String glxl) {
		this.glxl = glxl;
	}
	public String getWpid() {
		return wpid;
	}
	public void setWpid(String wpid) {
		this.wpid = wpid;
	}
	private String wpname;
	public String getWpname() {
		return wpname;
	}
	public void setWpname(String wpname) {
		this.wpname = wpname;
	}
	public int getPm() {
		return pm;
	}
	public void setPm(int pm) {
		this.pm = pm;
	}
	public String getHospital() {
		return hospital;
	}
	public void setHospital(String hospital) {
		this.hospital = hospital;
	}
	public String getHospitalBh() {
		return hospitalBh;
	}
	public void setHospitalBh(String hospitalBh) {
		this.hospitalBh = hospitalBh;
	}
	public String getId() {
		return id;
	}
	public String getNumberingArea() {
		return numberingArea;
	}
	public void setNumberingArea(String numberingArea) {
		this.numberingArea = numberingArea;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getCounts() {
		return counts;
	}
	public void setCounts(int counts) {
		this.counts = counts;
	}
	public String getAres() {
		return ares;
	}
	public void setAres(String ares) {
		this.ares = ares;
	}
}
时间: 2024-10-07 22:21:17

highcharts图形界面(Java从数据库获取值)的相关文章

django 数据库获取值

数据库表中的内容如下: models.Step_Type.objects.values()获取model中的符合条件的值, 实际为把表中的所有值都查询出来,如查询结果为:<QuerySet [{'id': 1, 'step_type': '注释'}, {'id': 2, 'step_type': '调用'}, {'id': 3, 'step_type': '日志'}]> models.Step_Type.objects.values().filter(id=1)[0] 获取符合条件的第一个值

基于jquery的表格动态创建,自动绑定,自动获取值

最近刚加入GUT项目,学习了很多其他同事写的代码,感觉受益匪浅. 在GUT项目中,经常会碰到这样一个问题:动态生成表格,包括从数据库中读取数据,并绑定在表格中,以及从在页面上通过jQuery新增删除表格.如下所示: 在实现过程中,开发人员经常采用如下方式来实现: 1)          在前台,通过js生成表格行的html字符串,然后通过jquery的after方法加到表格底部. 2)          在后台,读取数据库,然后生成表格的html字符串,然后传递给前台渲染 3)         

Java 图形界面开发--图文并茂建立学生管理系统

图形用户界面(Graphics User Interface,GUI)是用户与程序交互的窗口,比命令行的界面更加直观并且更好操作. 这是本人在学习java图形界面开发阶段一步一步实现的超级简易的学生管理系统.虽然说不入大神法眼,但这确实是费了自己不少心血.对于我这样的菜鸟来说,考虑不周到,一不小心就Exception,然后就是自己调呀调.在此分享出来希望对和我一样的菜鸟有帮助. 程序完整代码下载地址见: https://github.com/chaohuangtianjie994/The-Sys

NJUPT JAVA语言 综合图形界面程序设计

一. 实验目的和要求 学习和理解JAVA SWING中的容器,部件,布局管理器和部件事件处理方法. 通过编写和调试程序,掌握JAVA图形界面程序设计的基本方法. 实验内容: 设计和编写一个用于将人民币转换为等值的美元的程序,界面要求可以输入人民币的金额并可以得到转换后的结果. 附:程序使用的人民币外汇牌价参考 每100元美元等值买入人民币数:619.72 (2015/5/23 数据) 二.实验代码 package think; import java.awt.Color; import java

数据库的值获取过来转换成Json数组的方法

原文出处:http://www.cnblogs.com/jianglan/archive/2011/08/22/2149834.html .cs文件的主要代码: public class User_List //这个类是对应是Extjs的Grid的field里面的,field有几项就写几项 { public int VoteID = 0; public string VoteName = ""; public DateTime SystemDateTime = DateTime.Par

Java知多少(84)图形界面之布局设计

在界面设计中,一个容器要放置许多组件,为了美观,为组件安排在容器中的位置,这就是布局设计.java.awt中定义了多种布局类,每种布局类对应一种布局的策略.常用的有以下布局类: FlowLayout,依次放置组件. BoarderLayout,将组件放置在边界上. CardLayout,将组件像扑克牌一样叠放,而每次只能显示其中一个组件. GridLayout,将显示区域按行.列划分成一个个相等的格子,组件依次放入这些格子中. GridBagLayout,将显示区域划分成许多矩形小单元,每个组件

多线程编程、Java I/O系统和Java图形界面编程

多线程编程: 一个正在运行的程序通常称为一个进程,每一个任务称为一个线程,中能够在一个程序内运行多线程的程序称为多线程程序. 线程与进程的区别:①每个进程都需要操作系统为其分配独立的内存空间: ②而同一个进程中的所有线程都在同一内存空间工作,这些线程可以共享同一块内存和系统资源. 线程的创建: 1)通过继承Thread类来创建线程: ①创建一个继承Thread类的类: ②在创建的Thread子类中重写run()方法,在方法中写入想要线程运行的代码: ③创建Thread子类的实例: ④通过调用该实

非专业码农 JAVA学习笔记 用户图形界面设计与实现-所有控件的监听事件

用户图形界面设计与实现-监听事件 System.applet.Applet (一)用户自定义成分 1.绘制图形 Public voit piant(Ghraphics g){  g.drawLine等图形名称(坐标1234);g.file图形名(坐标123)} 2.设置字体-Font类 (1)定义font:Font myfont=new Font(“字体”,”样式”,字号); 例如:Font myfont=new Font(“宋体”,Font.BOLD,12); (2)引用定义的Font:类/容

Java图形界面实战案例——实现打字母游戏

实现打字母的游戏 这次这个案例可以说是头几次所讲的内容的一个技术汇总,主要是 运用了几大块的知识.我们先来定义一下案例的背景:在一个300*400的窗体上,有10个随机产生的字母下落,在键盘上敲击字母,若是敲对了就消掉,初始化的成绩为1000分,每次敲对一个字母就加上10分,如果在字母落到了屏幕的下方还没有敲对的话则判定为失败,就扣除100分. 我们还是老样子,先来进行步骤的划分 1.做满天星 2.把星星改成随机的10个字母 3.让字母落下,如果字母落出了屏幕就生成新的字母,并从屏幕的上方重新出