展示 增 删 改 查功能

增 删 改 查的展示最终展示图片

展示 包含查询

在这里插入图片描述

增加

在这里插入图片描述

修改

在这里插入图片描述

删除

在这里插入图片描述

jsp页面

showResearchReport.jsp

<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<html>
<!--<![endif]-->
<!-- BEGIN HEAD -->

<head>
<meta charset="utf-8" />
<title>服务企业维护</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1" name="viewport" />
<meta content="" name="description" />
<meta content="" name="author" />
<link href="<%=basePath%>assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" /> 
<%-- <link href="<%=basePath%>assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css" /> 201811414:54:37 --%>
<link href="<%=basePath%>assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<%-- <link href="<%=basePath%>assets/global/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css" /> 201811415:10:56--%>
<%-- <link href="<%=basePath%>assets/global/plugins/bootstrap-switch/css/bootstrap-switch.min.css" rel="stylesheet" type="text/css" /> --%>
<link href="<%=basePath%>assets/global/css/components.min.css" rel="stylesheet" id="style_components" type="text/css" />
<link href="<%=basePath%>assets/global/css/plugins.min.css" rel="stylesheet" type="text/css" />
<%-- <link href="<%=basePath%>assets/apps/css/inbox.min.css" rel="stylesheet" type="text/css" /> 201811414:55:10 --%>
<link href="<%=basePath%>assets/layouts/layout4/css/layout.min.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath%>assets/layouts/layout4/css/themes/light.min.css" rel="stylesheet" type="text/css" id="style_color" />
<%-- <link href="<%=basePath%>assets/layouts/layout4/css/custom.min.css" rel="stylesheet" type="text/css" />201811415:08:19 --%>
<link rel="shortcut icon" href="favicon.ico" />
<link href="<%=basePath%>assets/global/plugins/jstree/dist/themes/default/style.min.css" rel="stylesheet" type="text/css" />
<script src="<%=basePath%>assets/global/plugins/jquery.min.js" type="text/javascript"></script>
<script src="<%=basePath%>assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>

<%-- <script src="<%=basePath%>assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js" type="text/javascript"></script> 201811415:09:00--%>
<%-- <script src="<%=basePath%>assets/global/plugins/uniform/jquery.uniform.min.js" type="text/javascript"></script> 201811415:11:33--%>
<%-- <script src="<%=basePath%>assets/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js" type="text/javascript"></script>201811415:08:44 --%>
<script src="<%=basePath%>assets/global/scripts/app.min.js" type="text/javascript"></script> 
<%-- <script src="<%=basePath%>assets/apps/scripts/inbox.min.js" type="text/javascript"></script> 201811415:05:28--%>
<%-- <script src="<%=basePath%>assets/layouts/layout4/scripts/layout.min.js" type="text/javascript"></script> 201811415:06:16--%>
<%-- <script src="<%=basePath%>assets/layouts/layout4/scripts/demo.min.js" type="text/javascript"></script>201811415:06:26 --%>
<%-- <script src="<%=basePath%>assets/layouts/global/scripts/quick-sidebar.min.js" type="text/javascript"></script>201811415:06:42 --%>

<script src="<%=basePath%>assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js" type="text/javascript"></script>
<script src="<%=basePath%>assets/global/plugins/uniform/jquery.uniform.min.js" type="text/javascript"></script>
<%-- <script src="<%=basePath%>assets/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js" type="text/javascript"></script> --%>
<!-- END CORE PLUGINS -->

<!-- BEGIN THEME GLOBAL SCRIPTS -->
<script src="<%=basePath%>assets/global/scripts/app.min.js" type="text/javascript"></script>
<!-- END THEME GLOBAL SCRIPTS -->
<!-- BEGIN PAGE LEVEL SCRIPTS -->
<script src="<%=basePath%>assets/apps/scripts/inbox.min.js" type="text/javascript"></script>
<!-- END PAGE LEVEL SCRIPTS -->
<!-- BEGIN THEME LAYOUT SCRIPTS -->
<script src="<%=basePath%>assets/layouts/layout4/scripts/layout.min.js" type="text/javascript"></script>
<%-- <script src="<%=basePath%>assets/layouts/layout4/scripts/demo.min.js" type="text/javascript"></script> --%>
<%-- <script src="<%=basePath%>assets/layouts/global/scripts/quick-sidebar.min.js" type="text/javascript"></script> --%>
<!-- END THEME LAYOUT SCRIPTS -->


<!-- BEGIN PAGE LEVEL PLUGINS -->

<link rel="stylesheet" href="<%=basePath%>css/bootstrap/bootstrap-table.min.css" />
<script src="<%=basePath%>js/bootstrap/bootstrap-table.min.js"></script>
<script src="<%=basePath%>js/bootstrap/bootstrap-table-zh-CN.min.js"></script>
<!-- easyui -->
<%-- <script src="<%=basePath%>easyui/jquery.easyui.min.js"></script> --%>
<%-- <link rel="stylesheet" type="text/css" href="<%=basePath%>easyui/themes/default/easyui.css"> --%>
<%-- <link type="text/css" rel="stylesheet" href="<%=basePath%>jeDate/test/jeDate-test.css"> --%>
<link type="text/css" rel="stylesheet" href="<%=basePath%>jeDate/skin/jedate.css">
<script type="text/javascript" src="<%=basePath%>jeDate/src/jedate.js"></script>
<%-- <script type="text/javascript" src="<%=basePath%>js/bootstrap/bootstrap-select.js"></script> --%>
<%-- <link type="text/css" rel="stylesheet" href="<%=basePath%>css/bootstrap/bootstrap-select.css"> --%>
<script src="<%=basePath%>js/bootstrap/center-loader.js"></script>

<link href="<%=basePath%>css/ySelect.css" rel="stylesheet" type="text/css">

<%-- <script src="<%=basePath%>js/jquery-1.11.3.min.js"></script> --%>
<%-- <script src="<%=basePath%>js/bootstrap.min.js"></script> --%>
<script src="<%=basePath%>js/ySelect.js"></script>

</head>

<style>
/* * {
	font-family: "微软雅黑";
	font-size: 14px;
	letter-spacing: 2px;
} */
*{font-family:"微软雅黑";font-size: 14px;letter-spacing:2px;}
		.mb{
		margin-bottom:10px 
		}
</style>



<body
	class="page-container-bg-solid page-header-fixed page-sidebar-closed-hide-logo">
	<div class="clearfix"></div>
	<div class="page-content">
		<ul class="page-breadcrumb breadcrumb">
			<li class="active"><span
				style="color: #5e738b; font-size: 16px;">港口填报</span> 
					<i class="fa fa-circle">
				</i>
				<li><span class="active">服务企业维护</span></li>
		</ul>
		<!-- END PAGE BREADCRUMB -->

		<div class="row">
			<div class="col-md-12">
				<div class="portlet light bordered" style="height: 866px;">

					<div class="portlet-body">
						<ul class="nav nav-tabs">
							<c:forEach items="${allPollutantDeliveryBtn}"
								var="allPollutantDeliveryBtn" varStatus="status_index">
								<li>
								<li <c:if test="${status_index.index==0}">class="active"</c:if>>
									<a href="#${allPollutantDeliveryBtn.FBI_URL}" data-toggle="tab"
									style="font-size: 16px;">${allPollutantDeliveryBtn.FBI_NAME}</a>
								</li>
							</c:forEach>
						</ul>



						<div class="tab-content">
							<div class="tab-pane fade active in" id="tab_1_1">
								<div>
								<!--                      <div class="container" style="margin-top: 25px"> -->
								<div class="" style="margin-top: 25px">
									<div class="row clearfix" >
										<div class="col-md-4 col-sm-4 col-lg-4 column mb ">
											<div class="form-group">
												<label class="col-md-5 col-sm-6 col-lg-4 control-label">服务企业名称</label>
												<div class="col-md-7 col-sm-6 col-lg-6">
													<select  id="RR_SERVICE_COMPANY" class="demo1" multiple="multiple">
<!-- 															<option  value="" >请选择</option> -->
															<c:forEach var="hc" items="${hc}">
																<option  value="${hc.HC_FID}">${hc.HC_NAME}</option>
															</c:forEach>
													</select>
												</div>
											</div>
										</div>
										<div class="col-md-4 col-sm-4 col-lg-4 column mb ">
											<label class="col-md-5 col-sm-6 col-lg-4 column mb">接收污染类型</label>
										<!-- 	<div class="col-md-7 col-sm-6 col-lg-6">
											<input   type="text"  id="MO_FID"  name="MO_FID"    class="easyui-combotree form-control input-inline" style="width:100%;height: 34px" />
											</div> -->
											<div class="col-md-7 col-sm-6 col-lg-6">
												<select  id="RR_RECEIVING_POLLUTANTS" name="RR_RECEIVING_POLLUTANTS" class="form-control">
														<option  value="" >请选择</option>
														<c:forEach var="sys" items="${sys}">
															<option  value="${sys.SDD_DICTIONARY_CODE}">${sys.SDD_DICTIONARY_CNAME}</option>
														</c:forEach>
														
												</select>
											</div>
										</div>

										<div class="col-md-4 col-sm-4 col-lg-4 column mb">
											<div class="row clearfix">
												<c:forEach var="pdBtnSecond0" items="${pollutantDeliverySecondtab_1_1}">
													<c:if test="${pdBtnSecond0.FBI_TYPE==1}">
														<a class="btn green" onclick="initResearchReportTable()" id="searchBtn" style="font-size: 16px; font-family: '微软雅黑';">${pdBtnSecond0.FBI_NAME}
															<i class="fa fa-search"></i>
														</a>
													</c:if>
												</c:forEach>
												<c:forEach var="pdBtnSecond0" items="${pollutantDeliverySecondtab_1_1}">
													<c:if test="${pdBtnSecond0.FBI_TYPE==2}">
														<a href="javascript:;" id="addBtn" class="btn yellow" style="font-size: 16px; font-family: '微软雅黑';">${pdBtnSecond0.FBI_NAME}
															<i class="fa fa-plus"></i>
														</a>
													</c:if>
												</c:forEach>
											</div>
										</div>
									</div>
									<div class="row clearfix">
										<div class="col-md-4 col-sm-4 col-lg-4 column mb">
										</div>
										<div class="col-md-4 col-sm-4 col-lg-4  column mb">
										</div>
										<div class="col-md-4 col-sm-4 col-lg-4  column mb">
											<div class="row clearfix">
												<c:forEach var="pdBtnSecond0" items="${pollutantDeliverySecondtab_1_1}">
													<c:if test="${pdBtnSecond0.FBI_TYPE==3}">
														<a class="btn blue" id="updateBtn" style="font-size: 16px; font-family: '微软雅黑';">${pdBtnSecond0.FBI_NAME}
															<i class="fa fa-eraser"></i>
														</a>
													</c:if>
												</c:forEach>
												<c:forEach var="pdBtnSecond0" items="${pollutantDeliverySecondtab_1_1}">
													<c:if test="${pdBtnSecond0.FBI_TYPE==4}">
														<a href="javascript:;" id="deleteBtn" class="btn red" style="font-size: 16px; font-family: '微软雅黑';">${pdBtnSecond0.FBI_NAME}
															<i class="fa fa-times"></i>
														</a>
													</c:if>
												</c:forEach>
											</div>
										</div>
									</div>
								</div>
							</div>
							</div>
							<div class="row">
							<input id="updateHoldFid" type="hidden" name="RR_FID">
								<div class="col-md-12">
									<div class="portlet-body" style="height: 500px;">
										<div class="table-scrollable table-responsive">
											<table id="initResearchReportTable" class="table table-striped table-bordered table-hover table-checkable order-column ">
											</table>
										</div>
									</div>
									<div></div>
								</div>
							</div>
						</div>

					</div>
					<div class="clearfix margin-bottom-20"></div>
				</div>

			</div>

		</div>


	</div>

        
        
<script type="text/javascript">

    
		var search_pollutants;//查询条件rr_receiving_pollutants
 		var search_company;//查询条件rr_service_company

    	
	initResearchReportTable();
		function initResearchReportTable(){
			//防止表单重复提交
	        $('body').loader('show','<img src="<%=basePath %>images/loading1.gif">');
	  		$('#initResearchReportTable').bootstrapTable('destroy');
		    $('#initResearchReportTable').bootstrapTable({
		    	method: 'post',
		        contentType: "application/x-www-form-urlencoded",
		    	url : '<%=basePath%>researchReport/initResearchReport.te',
		        cache: false,
		        pagination: true,
			    paginationHAlign:'right',
			    queryParamsType:'', //默认值为 'limit' ,在默认情况下 传给服务端的参数为:offset,limit,sort
		                               // 设置为 ''  在这种情况下传给服务器的参数为:pageSize,pageNumber
		        queryParams:queryParams,//带参数查询
		        singleSelect: false,
			    pageSize: 10, 
			    pageList: [10, 20,30],
			    search: false, //不显示 搜索框
			    showColumns: false, //不显示下拉框(选择显示的列)
			    sidePagination: "server", //服务端请求
			    striped:true, //隔行变色
		        clickToSelect:true, //整行点击
		        columns: [{	
                    checkbox: true,  
                    visible: true                  //是否显示复选框  
                }, 
	                {
				    	field: 'rr_FID',
				        visible:false,
		                valign:'middle',
		                align: 'center',
				    },
					{
				    field: 'rownum_',
				    title: '序号',
				    valign:'middle',
				    align: 'center',
// 				    formatter:function(value,row,index){
// 	                	return (index+1);
// 	                }
					},
					{
				    field: 'rr_SERVICE_COMPANY',
				    title: '服务企业名称',
				    valign:'middle',
				    align: 'center',
				  /*   formatter:function(value,row,index){
				    	var temp=value;
				    	if(value==null || value.length<=0){
				    		value="";
				    	}
						if( value != null && value.length>5){
							value=value.substring(0,5)+"..";
						}
						return '<div title="'+temp+'">'+value+'</div>' ;
					} */
				},
				{
				    field: 'rr_RECEIVING_POLLUTANTS',
				    title: '接收污染物类型',
				    valign:'middle',
				    align: 'center',
				  /*   formatter:function(value,row,index){
				    	var temp=value;
				    	if(value==null || value.length<=0){
				    		value="";
				    	}
						if( value != null && value.length>8){
							value=value.substring(0,8)+"..";
						}
						return '<div title="'+temp+'">'+value+'</div>' ;
					} */
				},			    			    
				{
				    field: 'rr_DEADLINE',
				    title: '服务截止日期',
				    valign:'middle',
				    align: 'center',	 
				   /*  formatter:function(value,row,index){
				    	var temp=value;
						if( value != null && value.length>5){
							value=value.substring(0,5)+"..";
						}
						return '<div title="'+temp+'">'+value+'</div>' ;
					} */
				},		
				{
				    field: 'rr_TIME_REQUIRED',
				    title: '到达港口企业所需时间(h)',
				    valign:'middle',
				    align: 'center',
// 				    formatter:function(value,row,index){
// 				    	var temp=value;
// 				    	if(value==null || value.length<=0){
// 				    		value="";
// 				    	}
// 						if( value != null && value.length>3){
// 							value=value.substring(0,3)+"..";
// 						}
// 						return '<div title="'+temp+'">'+value+'</div>' ;
// 					}
				   
				}],
		        onLoadSuccess:function(){

		        	//防止表单重复提交(查询出数据之后把遮罩进行隐藏)
		        	$('body').loader('hide');
		        	
		        	search_pollutants=$("#RR_RECEIVING_POLLUTANTS").val();
		        	search_company=$("#RR_SERVICE_COMPANY").val();
		   
			 		
// 			 	   	var node=$tree.tree("getSelected");
// 					if(node !=null){
// 						search_type=node.id;//查询条件			
// 					var children = $tree.tree('getChildren',node.target);
// 					for(var i=0;i<children.length;i++ ){
// 		     	      var node1=children[i];
// 		     	     search_type+=","+node1.id; 
// 		     	 	}
// 				}
				},
			    onLoadError: function () {
	//		            bootbox.alert("数据加载失败!");
		            window.parent.modalOutError("数据加载失败!");
		        }
		    });
		};
		
	
			
		
		function queryParams(params){
			var RR_SERVICE_COMPANY = $("#RR_SERVICE_COMPANY").ySelectedValues(",");
	  		var RR_RECEIVING_POLLUTANTS=$("#RR_RECEIVING_POLLUTANTS").val();
// 	  		var RR_SERVICE_COMPANY=$("#RR_SERVICE_COMPANY").val();

// 			$tree=$('#EA_EFID').combotree("tree");
			
// 	  		var node=$tree.tree("getSelected");
// 			if(node !=null){
// 			var EA_EFID=node.id;			
// 			var children = $tree.tree('getChildren',node.target);
// 			for(var i=0;i<children.length;i++ ){
//      	      var node1=children[i];
//      	     EA_EFID+=","+node1.id; 
//      	 	}	  
// 		}
	  		var temp = {
	  			pageSize:params.pageSize,
	  			pageNumber:params.pageNumber,
	  			//查询条件ResearchReport
	  			RR_SERVICE_COMPANY:RR_SERVICE_COMPANY,
				//后台的值      :前台的值
	  			RR_RECEIVING_POLLUTANTS:RR_RECEIVING_POLLUTANTS,
	  		};
	  		return temp;
	  	}
		//查询
		initResearchReportTable();
	  	$("#searchBtn").click(function(){
	  		initResearchReportTable();
	  	});

	  
	  	//添加
	  	$("#addBtn").on("click",function(){
	  		window.parent.modalOut('<%=basePath%>researchReport/insertResearchReportInfo.te?auditFid=${auditFid}');
	  	})
	  	
	  	
	  	$("#updateBtn").click(function(){
	  		var row=$("#initResearchReportTable").bootstrapTable('getSelections');
  			if(row==null || row=='' ||  row.length>1){
				window.parent.modalOutError("请选择一条修改记录。");
			}else{
				window.parent.modalOut('<%=basePath%>researchReport/updateInfo.te?fid='+row[0].rr_FID);
			}
		});
	  	
	  //是否删除成功
		function delResearchReportInfo(){
			var rows=$('#initResearchReportTable').bootstrapTable("getSelections");
			var INEM_ID="";
			$.each(rows,function(i,n){
				if(i==0){
					INEM_ID+="'"+n.rr_FID+"'";
				}else{
					INEM_ID+=",'"+n.rr_FID+"'";
				}
			})
			 $.ajax({
				 cache: true,
		         type: "POST",
		         url:"<%=basePath%>researchReport/delResearchReport.te",
		     	 data : {
		     		INEM_ID:INEM_ID
		     	 },
		         success: function(data) {
		        	 console.log(data.result);
		        	 if(data.result=='success'){
						 window.parent.modalOutError("删除成功");
						 initResearchReportTable();//删除完成功之后调用再次调用查询方法刷新页面。
		        	 }else {
						 window.parent.modalOutError("删除数据产生错误!!");
		        	 }
		         },
		         error: function(request) {
					 window.parent.modalOutError("操作超时,请重新登录!!");
		         }
			});		
		}
		
		
		//删除
			$("#deleteBtn").on("click",function(){
				var rowarray = $('#initResearchReportTable').bootstrapTable('getSelections');
				if(rowarray==null || rowarray==''){
					window.parent.modalOutError("至少选中一条需要删除的信息。");
				}else{
					var showInfo ="";
					for(var i=0;i<rowarray.length;i++){
				    var tempstr=rowarray[i].rr_FID;
					    if(tempstr!=null && tempstr!=''){
					    	showInfo = showInfo+tempstr+",";
					    }
					}
					$("#initResearchReportTable").val(showInfo);
					window.parent.modalDeleteInfoShow('6');
				}
			})
		
	  	$(function() {
        $('.demo1').ySelect(
          {
            placeholder: '请选择',
            searchText: '搜索',
            showSearch: true,
            numDisplayed: 4,
            overflowText: '已选中 {n}项',
            isCheck:false
          }
        );

});
</script>	
</body>

</html>

insertResearchReport.jsp

<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>新增</title>
		<!-- 		CSS -->
<%-- 		<script src="<%=basePath%>js/jquery-1.11.3.min.js"></script> --%>
<%-- 		<link rel="stylesheet" type="text/css" href="<%=basePath%>easyui/themes/default/easyui.css"> --%>
<%--         <script src="<%=basePath%>easyui/jquery.easyui.min.js"></script> --%>
   		<link type="text/css" rel="stylesheet" href="<%=basePath%>jeDate/skin/jedate.css">
   		<script type="text/javascript" src="<%=basePath%>jeDate/src/jedate.js"></script>
   		<script src="<%=basePath %>js/bootstrap/center-loader.js"></script>
   		
       
<%-- 		<script src="<%=basePath%>js/bootstrap.min.js"></script> --%>
<%-- 		<script src="<%=basePath%>js/ySelect.js"></script> --%>
<%--        <link href="<%=basePath%>css/ySelect.css" rel="stylesheet" type="text/css"> --%>
<link type="text/css" rel="stylesheet" href="<%=basePath%>css/bootstrap/bootstrap-select.css">
<script src="<%=basePath%>js/bootstrap/bootstrap-select.js"></script>

</head>
<style>
* {
	font-family: "微软雅黑";
	font-size: 16px;
	letter-spacing: 2px;
}


</style>
<body class="page-container-bg-solid page-header-fixed page-sidebar-closed-hide-logo">
	
     	  <div class="row">
     	  		 <form class="form-horizontal" role="form" id="initFormUserAdd">
                        <div class="col-md-12">
                            <div class="portlet light bordered">
                           
                                <div class="portlet-body">
                                    <ul class="nav nav-tabs" id="allTab">
                                        <li class="active">
                                            <a href="#tab_1_1" id="t_1" data-toggle="tab" lang="0" style="font-size: 16px;">服务企业维护</a>
                                        </li>
                                    </ul>
                                    <div class="tab-content">
                                    
                                    
                    <div class="tab-pane fade active in" id="tab_1_1">                              
					<div class="row">
                  
                        <div class="col-md-12">
                      		  <div class="portlet-body form">
                                   
                                        <div class="form-body">
                                          <div class="form-group">
                                           <label class="col-md-3 control-label">服务企业名称</label>
                                           <div class="col-md-9" id="temp">
<!--                                            <input class="form-control easyui-combobox" id="rCompany" name="rrr" style="width:250px;height: 30px;"/> -->
<!--                                            <input class="form-control" id="rCompany" name="RR_SERVICE_COMPANY" style="width:250px;height: 30px;"/> -->
												<select style="margin-bottom: 0px;color:#8E8E8E;width:auto" class="form-control m-b selectpicker input-inline input-medium" data-live-search="true" name="RR_SERVICE_COMPANY" id="RR_SERVICE_COMPANY" >
<!-- 												<select style="display: block;" class="demo1" id="RR_SERVICE_COMPANY" name="RR_SERVICE_COMPANY"> -->
															<option>请选择</option>
															<c:forEach var="hc" items="${hcRtdType}">
																<option  value="${hc.HC_FID}">${hc.HC_NAME}</option>
															</c:forEach>
								                 </select>
												<span style="color: red" >*</span>   
                                           </div>
                                         </div>
                                       <div class="form-group">
                                           <label class="col-md-3 control-label">接收污染类型</label>
                                           <div class="col-md-9">

												<select id="RR_RECEIVING_POLLUTANTS" name="RR_RECEIVING_POLLUTANTS" class="form-control input-inline input-medium">
									                       <option value="">请选择</option>
					                                 <c:forEach items="${sysRtdType}" var="sysRtdType">
					                                       <option value="${sysRtdType.SDD_DICTIONARY_CODE}">${sysRtdType.SDD_DICTIONARY_CNAME}</option>
					                                 </c:forEach>  
								                 </select>
												<span style="color: red" >*</span>   
                                           </div>
                                       </div>
                                            
                                       <div class="form-group">
                                           <label class="col-md-3 control-label">服务截止时间</label>
                                           <div class="col-md-9">
												<input type="text" class="form-control input-inline input-medium" maxlength="50"  name="RR_DEADLINE" id="RR_DEADLINE" >
												<span style="color: red" >*</span>   
                                           </div>
                                       </div>
                                        
                                                <div class="form-group">
                                           <label class="col-md-3 control-label">到达港口所需时间(h)</label>
                                           <div class="col-md-9">
												<input type="text" class="form-control input-inline input-medium" maxlength="50"  onkeyup="onTimeRe()" name="RR_TIME_REQUIRED" id="RR_TIME_REQUIRED" >
												<span style="color: red" >输入数字*</span>   
                                           </div>
                                       </div>
                                              
                                        </div>
                                        <div class="form-actions">
                                            <div class="row">
                                                <div class="col-md-offset-3 col-md-9">
                                                   <button type="button" class="btn green" id="saveUserInfo">保存</button>
<!--                                           		   <button type="reset" class="btn default" id="shangyibu3">重置</button> -->
                                                </div>
                                            </div>
                                        </div>
                                </div>	
                        </div>
                    </div>                  
                   </div>   
                                    </div>
                                    <div class="clearfix margin-bottom-20"> </div>
                                  
                                </div>
                 
                        </div>
                        
                    </div>
                    <!-- END PAGE BASE CONTENT -->
                </form>
                </div>
<script type="text/javascript">
function onTimeRe(){
//	 alert(1);
	 var timeRequired = $("#RR_TIME_REQUIRED").val();//到达港口企业所需时间
	 var cs = 0;
	 var ns = 0;
    var number = "";
	 for(var i = 0 ; i<timeRequired.length;i++){
		 var dsd = (/^[.]$/.test(timeRequired.charAt(i)));
		 var numberCount =  (/^(\-|\+)?\d+(\.\d{0,2})?$/g.test(timeRequired.charAt(i)));
		 if (dsd) {
	            cs++;
	     }
		 if(!numberCount && timeRequired.charAt(i) != "."){
			 ns++;
		 }
		 if(ns>0){
			 timeRequired =  timeRequired.substring(0, timeRequired.length-1);
		 }
		 if(cs>1){
			 timeRequired =  timeRequired.substring(0, timeRequired.length-1);
		 }
	 }
	    if (timeRequired.indexOf(".") != -1) {
	        if (timeRequired.length < 2) {
	        	 $("#RR_TIME_REQUIRED").val("0.");
//	        	this.setData({ manualSum: "0.", manualSum: "0." });
      		} else if (timeRequired.substring(timeRequired.indexOf(".")).length > 3) {
        
        		 var polltemk = timeRequired.substring(0, timeRequired.indexOf(".") + 3)
       		 $("#RR_TIME_REQUIRED").val(polltemk)
//         this.setData({ manualSum: polltemk });
//         } else {
//         this.setData({ manualSum: manualSum });
        }else{
       	 $("#RR_TIME_REQUIRED").val(timeRequired);
        }
      } else {
	       for (let i = 0; i < timeRequired.length; ++i) {
	         var dsd = timeRequired.charAt(i);
	         if (i == 0) {
	           number = dsd;
	         } else {
	           if (number == "0") {
	           	timeRequired = timeRequired.substring(1, timeRequired.length);
	           }
	         }
	       }
	       if (timeRequired == '00') {
	       	timeRequired = '0';
	       }
	       $("#RR_TIME_REQUIRED").val(timeRequired);
	  }
}

                //  时间格式化
                    function timeFormat(date) {
                    	   if (!date || typeof(date) === "string") {
                    	          this.error("参数异常,请检查...");
                    	     }
                    	    var y = date.getFullYear(); //年
                    	    var m = date.getMonth() + 1; //月
                    	    var d = date.getDate(); //日
                    		
                    	    return y + "-" + (m<10? ('0'+m) :m) + "-" + (d<10? ('0'+d) :d);
                    	 }
//                     	 获取当月第一天
                    function getFirstDayOfMonth (date) {
                    	    date.setDate(1);
                    	return timeFormat(date);
                    	}
					
					
                    $(function(){

                	//蓝色主题色
                	jeDate("#RR_DEADLINE", {
                		theme : {
                			bgcolor : "#00A1CB",
                			color : "#ffffff",
                			pnColor : "#00CCFF"
                		},
                		format : "YYYY-MM-DD "
                	});
                	
                	
                  if($("#RR_DEADLINE").val()=="")
                	$("#RR_DEADLINE").val(timeFormat(new Date()))//初始化为当前时间
                	
                    })
                    
                    $(function(){

                	//蓝色主题色
                	jeDate("#RR_DEADLINE", {
                		theme : {
                			bgcolor : "#00A1CB",
                			color : "#ffffff",
                			pnColor : "#00CCFF"
                		},
                		format : "YYYY-MM-DD "
                	});
                  if($("#RR_DEADLINE").val()=="")
                		$("#RR_DEADLINE").val(timeFormat(new Date()))//初始化为当前时间                	
                    })
                    
                
//                      $('#mainmodal').on('hide.bs.modal', function () {
// 							if($("#cancelBtn,#closeBtn").length!=0){
// 								delPic()
// 							}
// 						})	
                        $("#saveUserInfo").click(function(){
                        	//增加相应的表单验证,否则无法进行保存处理
                        	//增加相应的验证信息
//                         	var serviceCompany = $("#RR_SERVICE_COMPANY").ySelectedValues(",");
	                       	 var serviceCompany = $("#RR_SERVICE_COMPANY").val();//服务企业名称
// 	                       	 alert(serviceCompany)
	                       	 var receivingPollutants = $("#RR_RECEIVING_POLLUTANTS").val();//接收污染物类型
	                       	 var deadline = $("#RR_DEADLINE").val();//服务截止日期
	                       	 var timeRequired = $("#RR_TIME_REQUIRED").val();//到达港口企业所需时间
	                       	
	                       	 
	                     	 if(serviceCompany==null ||serviceCompany=="" || serviceCompany=="请选择"){
	                       		 window.parent.modalOutError("服务企业名称不能为空!");
	                       		 return;
	                       	 }
							 if(receivingPollutants==null ||receivingPollutants==""){
								 window.parent.modalOutError("接收污染物类型不能为空!");
                       			 return;
	                       	 }
	                       	 if(deadline==null ||deadline==""){
	                       		 window.parent.modalOutError("服务截止日期不能为空!");
	                       		 return;
	                       	 }	 
						     var tel=/^\d{4}-\d{1,2}-\d{1,2}/;//
	                         if (!tel.test(deadline)) {     //
	                      	   window.parent.modalOutError("时间格式有误请输入正确的时间");        
	                                return;
	                          }

	                         if(timeRequired=="" || timeRequired==null){
	                      	    window.parent.modalOutError("到达港口企业所需时间不能为空");
	                      	   return;
	                         } 
	                         var row=/^(\-|\+)?\d+(\.\d{0,2})?$/g;//
	                         if (!row.test(timeRequired) || timeRequired==0 ) {     //
	                      	   window.parent.modalOutError("到达港口企业格式有误请输入正确的时间");        
	                                return;
	                          }
	                       	 
							 
	                        	$.ajax({
	       						 cache: true,
	       				         type: "POST",
	       				         url:"<%=basePath%>researchReport/PanduanResearchReport.te",
	       				     	 data :  $("#initFormUserAdd").serialize(),
	       				      beforeSend:function(){
	       			            //防止表单重复提交
	       			           $('.form-horizontal').loader('show','<img src="<%=basePath%>images/loading1.gif">');
	       			                    },
	       				         success: function(data) {
	       				        	 if(data.result==0){
	       				        		 
	       				        		window.parent.modalOutError("该单位该类型已有数据"); 
	       				        	 $('.form-horizontal').loader('hide');
	       				        	 }else if(data.result==1){
	       				        		$.ajax({
	       	       						 cache: true,
	       	       				         type: "POST",
	       	       				         url:"<%=basePath%>researchReport/insertResearchReport.te",
	       	       				     	 data :  $("#initFormUserAdd").serialize(),
	       	       				      beforeSend:function(){
	       	       			            //防止表单重复提交
	       	       			           $('.form-horizontal').loader('show','<img src="<%=basePath%>images/loading1.gif">');
	       	       			                    },
	       	       				         success: function(data) {
	       	       				        	 if(data.result==0){
	       	       				        		window.parent.modalOutError("插入成功"); 
	       	       				        	 	window.parent.modalOutClose();
	       	       				         		 document.getElementById("mainiframe").contentWindow.initResearchReportTable();
	       	       				        	 }else if(data.result==1){
	       	       				        		window.parent.modalOutError("插入失败");
	       	       				      			window.parent.modalOutClose();	 
	       	       				      	 		 document.getElementById("mainiframe").contentWindow.initResearchReportTable();
	       	       				        	 }
	       	       				        	 $('.form-horizontal').loader('hide');
	       	       				        	 window.parent.modalOutClose();
	       	              		        	 $(".modal-backdrop").remove();
	       	       				         },
	       	       				         error: function(request) {
	       	       				        	 $('.form-horizontal').loader('hide');
	       	       				        	 window.parent.modalOutErrorClose();//关闭添加谈框
	       	       							 window.parent.modalOutError("操作超时,请重新登录!!");
	       	       				         }
	       	       					});
	       				        	 }	       				        	 	       				        	   				        	 	       				        	 
	       				         },
	       				         error: function(request) {
	       				        	 $('.form-horizontal').loader('hide');
	       				        	 window.parent.modalOutErrorClose();//关闭添加谈框
	       							 window.parent.modalOutError("操作超时,请重新登录!!");
	       				         }
	       					});
                        });
            	  	$(function() {
 					$('.selectpicker').selectpicker({  
							'noneSelectedText':'请选择',
							'noneResultsText':"没有匹配到 {0}",
		                });  
						$(".dropdown-menu").width("245px")
						$(".dropdown-menu").height("400px")
            		});
//             	  	$('.selectpicker').selectpicker('val', 'HC201808071440004B1C0C1E');
            	  	 
</script>
	
</body>
</html>

updateResearchReport.jsp

<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>修改</title>
		<!-- 		CSS -->
<%-- 		<script src="<%=basePath%>js/jquery-1.11.3.min.js"></script> --%>
<%-- 		<link rel="stylesheet" type="text/css" href="<%=basePath%>easyui/themes/default/easyui.css"> --%>
<%--         <script src="<%=basePath%>easyui/jquery.easyui.min.js"></script> --%>
   		<link type="text/css" rel="stylesheet" href="<%=basePath%>jeDate/skin/jedate.css">
   		<script type="text/javascript" src="<%=basePath%>jeDate/src/jedate.js"></script>
   		<script src="<%=basePath %>js/bootstrap/center-loader.js"></script>
   		
       
<%-- 		<script src="<%=basePath%>js/bootstrap.min.js"></script> --%>
<%-- 		<script src="<%=basePath%>js/ySelect.js"></script> --%>
<%--        <link href="<%=basePath%>css/ySelect.css" rel="stylesheet" type="text/css"> --%>
<link type="text/css" rel="stylesheet" href="<%=basePath%>css/bootstrap/bootstrap-select.css">
<script src="<%=basePath%>js/bootstrap/bootstrap-select.js"></script>
     
</head>
<style>
* {
	font-family: "微软雅黑";
	font-size: 16px;
	letter-spacing: 2px;
}
</style>
<body>
<body
	class="page-container-bg-solid page-header-fixed page-sidebar-closed-hide-logo">
	
     	  <div class="row">
     	  		 <form class="form-horizontal" role="form" id="initFormUserAdd">
                      <input type="hidden" name="fid" value="${fid}"> 
                        <div class="col-md-12">
                            <div class="portlet light bordered">
                           
                                <div class="portlet-body">
                                    <ul class="nav nav-tabs" id="allTab">
                                        <li class="active">
                                            <a href="#tab_1_1" id="t_1" data-toggle="tab" lang="0" style="font-size: 16px;">修改信息</a>
                                        </li>
                                    </ul>
                                    <div class="tab-content">
                                    
                                    
                    <div class="tab-pane fade active in" id="tab_1_1">                              
					<div class="row">
                  
                        <div class="col-md-12">
                      		  <div class="portlet-body form">
                                   
                                        <div class="form-body">
                                          <div class="form-group">
                                           <label class="col-md-3 control-label">服务企业名称</label>
                                           <div class="col-md-9">				
<%-- 													<c:forEach var="hc" items="${hcRtdType}"> --%>
<%-- 														<option  value="${hc.HC_FID}">${hc.HC_NAME}</option> --%>
<%-- 			                                        	   	<c:if test="${hc.HC_FID == rr.RR_SERVICE_COMPANY}"> --%>
			                                        	   	  <input value="${rr.company}" class="form-control input-inline input-medium" readonly="readonly"  maxlength="50">
<%-- 			                                        	   	</c:if> --%>
<%-- 													</c:forEach> --%>
                                           </div>
                                         </div>
                                       <div class="form-group">
                                           <label class="col-md-3 control-label">接收污染类型</label>
                                           <div class="col-md-9">
                                           <c:forEach items="${sysRtdType}" var="sysRtdType">
	                                           	<c:if test="${sysRtdType.SDD_DICTIONARY_CODE == rr.RR_RECEIVING_POLLUTANTS}">
	                                           		<input value="${sysRtdType.SDD_DICTIONARY_CNAME}" class="form-control input-inline input-medium" readonly="readonly" maxlength="50">
												</c:if>
                                           </c:forEach>
<!-- 												<select id="RR_RECEIVING_POLLUTANTS" name="RR_RECEIVING_POLLUTANTS" class="form-control input-inline input-medium"> -->
<%-- 					                                 <c:forEach items="${sysRtdType}" var="sysRtdType"> --%>
<%-- 					                                       <option value="${sysRtdType.SDD_DICTIONARY_CODE}"  <c:if test="${sysRtdType.SDD_DICTIONARY_CODE == rr.RR_RECEIVING_POLLUTANTS}">checked='checked'</c:if>>${sysRtdType.SDD_DICTIONARY_CNAME}</option> --%>
<%-- 					                                 </c:forEach>   --%>
<!-- 								                 </select> -->
                                           </div>
                                       </div>
                                            
                                       <div class="form-group">
                                           <label class="col-md-3 control-label">服务截止时间</label>
                                           <div class="col-md-9">
												<input type="text" class="form-control input-inline input-medium" maxlength="50"  name="RR_DEADLINE" id="RR_DEADLINE" value="${rr.RR_DEADLINE}">
												<span style="color: red" >*</span>   
                                           </div>
                                       </div>
                                        
                                                <div class="form-group">
                                           <label class="col-md-3 control-label">到达港口所需时间(h)</label>
                                           <div class="col-md-9">
												<input type="text" class="form-control input-inline input-medium" maxlength="50"  onkeyup="onTimeRe()" name="RR_TIME_REQUIRED" id="RR_TIME_REQUIRED" value="${rr.RR_TIME_REQUIRED}">
												<span style="color: red" >输入数字*</span>   
                                           </div>
                                       </div>
                                              
                                        </div>
                                        <div class="form-actions">
                                            <div class="row">
                                                <div class="col-md-offset-3 col-md-9">
                                                   <button type="button" class="btn green" id="saveUserInfo">保存</button>
                                                </div>
                                            </div>
                                        </div>
                                    
                                </div>	
                        </div>
                    </div>                  
                   </div>   
                                    </div>
                                    <div class="clearfix margin-bottom-20"> </div>
                                  
                                </div>
                 
                        </div>
                        
                    </div>
                    <!-- END PAGE BASE CONTENT -->
                </form>
                </div>
<script type="text/javascript">
function onTimeRe(){
//	 alert(1);
	 var timeRequired = $("#RR_TIME_REQUIRED").val();//到达港口企业所需时间
	 var cs = 0;
	 var ns = 0;
    var number = "";
	 for(var i = 0 ; i<timeRequired.length;i++){
		 var dsd = (/^[.]$/.test(timeRequired.charAt(i)));
		 var numberCount =  (/^(\-|\+)?\d+(\.\d{0,2})?$/g.test(timeRequired.charAt(i)));
		 if (dsd) {
	            cs++;
	     }
		 if(!numberCount && timeRequired.charAt(i) != "."){
			 ns++;
		 }
		 if(ns>0){
			 timeRequired =  timeRequired.substring(0, timeRequired.length-1);
		 }
		 if(cs>1){
			 timeRequired =  timeRequired.substring(0, timeRequired.length-1);
		 }
	 }
	    if (timeRequired.indexOf(".") != -1) {
	        if (timeRequired.length < 2) {
	        	 $("#RR_TIME_REQUIRED").val("0.");
//	        	this.setData({ manualSum: "0.", manualSum: "0." });
      		} else if (timeRequired.substring(timeRequired.indexOf(".")).length > 3) {
        
        		 var polltemk = timeRequired.substring(0, timeRequired.indexOf(".") + 3)
       		 $("#RR_TIME_REQUIRED").val(polltemk)
//         this.setData({ manualSum: polltemk });
//         } else {
//         this.setData({ manualSum: manualSum });
        }else{
       	 $("#RR_TIME_REQUIRED").val(timeRequired);
        }
      } else {
	       for (let i = 0; i < timeRequired.length; ++i) {
	         var dsd = timeRequired.charAt(i);
	         if (i == 0) {
	           number = dsd;
	         } else {
	           if (number == "0") {
	           	timeRequired = timeRequired.substring(1, timeRequired.length);
	           }
	         }
	       }
	       if (timeRequired == '00') {
	       	timeRequired = '0';
	       }
	       $("#RR_TIME_REQUIRED").val(timeRequired);
	  }
}

                //  时间格式化
                    function timeFormat(date) {
                    	   if (!date || typeof(date) === "string") {
                    	          this.error("参数异常,请检查...");
                    	     }
                    	    var y = date.getFullYear(); //年
                    	    var m = date.getMonth() + 1; //月
                    	    var d = date.getDate(); //日
                    		
                    	    return y + "-" + (m<10? ('0'+m) :m) + "-" + (d<10? ('0'+d) :d);
                    	 }
//                     	 获取当月第一天
                    function getFirstDayOfMonth (date) {
                    	    date.setDate(1);
                    	return timeFormat(date);
                    	}



                    $(function(){

                	//蓝色主题色
                	jeDate("#RR_DEADLINE", {
                		theme : {
                			bgcolor : "#00A1CB",
                			color : "#ffffff",
                			pnColor : "#00CCFF"
                		},
                		format : "YYYY-MM-DD "
                	});
                	
                	
                  if($("#RR_DEADLINE").val()=="")
                	$("#RR_DEADLINE").val(timeFormat(new Date()))//初始化为当前时间
                	
                    })
                    
                    $(function(){

                	//蓝色主题色
                	jeDate("#RR_DEADLINE", {
                		theme : {
                			bgcolor : "#00A1CB",
                			color : "#ffffff",
                			pnColor : "#00CCFF"
                		},
                		format : "YYYY-MM-DD "
                	});
                  if($("#RR_DEADLINE").val()=="")
                		$("#RR_DEADLINE").val(timeFormat(new Date()))//初始化为当前时间                	
                    })
                    
                   
                    
                        $("#saveUserInfo").click(function(){
                        	//增加相应的表单验证,否则无法进行保存处理
                        	//增加相应的验证信息
	                       	 var serviceCompany = $("#RR_SERVICE_COMPANY").val();//服务企业名称
	                       	 var receivingPollutants = $("#RR_RECEIVING_POLLUTANTS").val();//接收污染物类型
	                       	 var deadline = $("#RR_DEADLINE").val();//服务截止日期
	                       	 var timeRequired = $("#RR_TIME_REQUIRED").val();//到达港口企业所需时间
	                       	
	                       	 
// 	                     	 if(serviceCompany==null ||serviceCompany==""){
// 	                       		 window.parent.modalOutError("服务企业名称不能为空!");
// 	                       		 return;
// 	                       	 }
// 							 if(receivingPollutants==null ||receivingPollutants==""){
// 								 window.parent.modalOutError("接收污染物类型不能为空!");
//                        			 return;
// 	                       	 }
	                       	 if(deadline==null ||deadline==""){
	                       		 window.parent.modalOutError("服务截止日期不能为空!");
	                       		 return;
	                       	 }
							 var tel=/^\d{4}-\d{1,2}-\d{1,2}/;//
	                         if (!tel.test(deadline)) {     //
	                      	   window.parent.modalOutError("时间格式有误请输入正确的时间");        
	                                return;
	                          }  

	                         if(timeRequired=="" || timeRequired==null){
	                      	    window.parent.modalOutError("到达港口企业所需时间不能为空");
	                      	   return;
	                         } 
	                         var row=/^(\-|\+)?\d+(\.\d{0,2})?$/g;//
	                         if (!row.test(timeRequired) || timeRequired==0) {     //
	                      	   window.parent.modalOutError("到达港口企业格式有误请输入正确的时间");        
	                                return;
	                          }
							 
	                        	$.ajax({
	       						 cache: true,
	       				         type: "POST",
	       				         url:"<%=basePath%>researchReport/updateResearchReport.te",
	       				     	 data :  $("#initFormUserAdd").serialize(),
	       				      beforeSend:function(){
	       			            //防止表单重复提交
	       			           $('.form-horizontal').loader('show','<img src="<%=basePath%>images/loading1.gif">');
	       			                    },
	       				         success: function(data) {
	       				        	 
	       				        	 $('.form-horizontal').loader('hide');
	       				        	 window.parent.modalOutClose();
	              		        	 $(".modal-backdrop").remove();
	       				        	 if(data.result=="0"){
	       				        		 window.parent.modalOutError("保存成功!!");
	       				        		 
<%-- 	       				        		 window.location.href='<%=basePath%>researchReport/initSiteManger.te?noChangeFid=${auditFid}'; --%>
	       				        		 document.getElementById("mainiframe").contentWindow.initResearchReportTable();
	       				        	 }else if(data.result=="1"){
	       				        		 window.parent.modalOutError("保存失败!!");
	       				        	 }
	       				        	 
	       				         },
	       				         error: function(request) {
	       				        	 $('.form-horizontal').loader('hide');
	       				        	 window.parent.modalOutErrorClose();//关闭添加谈框
	       							 window.parent.modalOutError("操作超时,请重新登录!!");
	       				         }
	       					});
                        });
                    
                    
               	  	$(function() {
 	 					$('.selectpicker').selectpicker({  
 								'noneSelectedText':'请选择',
 								'noneResultsText':"没有匹配到 {0}",
 			                });  
 	            		});
	             	  	$('.selectpicker').selectpicker('val', '${hc.HC_NAME}');
</script>
	
</body>
</html>

ResearchReportController.java

package enytek.com.cn.controller.researchReport;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;

import enytek.com.cn.model.companyPermissions.CompanyPermissions;
import enytek.com.cn.model.functionbuttoninfo.FunctionButtonInfoModel;
import enytek.com.cn.model.holdingRelation.HoldingRelation;
import enytek.com.cn.model.holdingcopany.HoldingCompanyModel;

import enytek.com.cn.model.researchreport.ResearchReportModel;
import enytek.com.cn.model.sysDataDictionary.SysDataDictionayModel;
import enytek.com.cn.model.userInfo.UserInfoEntity;
import enytek.com.cn.service.holdingcompany.HoldingCompanyService;
import enytek.com.cn.service.researchReport.ResearchReportSerivace;
import enytek.com.cn.service.sysDataDictionary.SysDataDictionaryService;
import enytek.com.cn.util.CommonUtil;
import enytek.com.cn.util.echecomap.EhcacheMapUtil;
import enytek.com.cn.util.userlimit.AllLimitUtil;

@Controller
@RequestMapping("researchReport")
public class ResearchReportController {
	@Autowired
	private ResearchReportSerivace researchReportSerivace;
	@Autowired
	private SysDataDictionaryService sysDataDictionaryService;
	@Autowired
	private HoldingCompanyService holdingCompanyService;
	
	/**
//	 * 字典表内容  research_report
	 * @param dic
	 * @return
	 */
	public List<SysDataDictionayModel> getDataDic(String dic){
		SysDataDictionayModel sysData = new SysDataDictionayModel();
		sysData.setSDD_DICTIONARY(dic);
		List<SysDataDictionayModel> sysDataList = sysDataDictionaryService.findDicInfo(sysData);
		return sysDataList;
	}
	
//	public List<HoldingCompanyModel> getData(String cty) throws Exception{
//		HoldingCompanyModel hcData=new HoldingCompanyModel();
//		hcData.setHC_likeType(cty);
//		List<HoldingCompanyModel> hcDateList=holdingCompanyService.findHoldingCompanyModel(hcData);
//		return hcDateList;
//	}
	/**
	 * 缓存和数据库之间的问题
	 * sysDatDictionayModel sysData=new sysDatDictionayModel();
	 * sysdata.setSDD_DICII(dic);
	 * List<sysDatDictionayModel> sysDataList = sysDataDictionaryService.findDicInfo(sysData);
	 * return sysDataList;
	 * 
	 * 
	 */
	
	//初始化监测点
		@RequestMapping("initSiteManger")
		public String showShippingInfo(HttpSession session,String noChangeFid,Model model,String auditFid) throws Exception{
			//下拉列表接收污染物类型
			List<SysDataDictionayModel> sysRtdType = getDataDic("03020");
			model.addAttribute("sys",sysRtdType);
			
			UserInfoEntity userInfo = (UserInfoEntity)session.getAttribute("LoginUserInfo");
			//下拉列表服务企业名称
			HoldingCompanyModel hold=new HoldingCompanyModel();
			hold.setHC_NOTIN("1");
//			hold.setHC_FID(userInfo.getLoginHoldIngCompany());
			List<HoldingCompanyModel> findHoldingCompanyModel = holdingCompanyService.findHoldingCompanyModel(hold);
			model.addAttribute("hc", findHoldingCompanyModel);
			
			Object obj = EhcacheMapUtil.getObject("btn"+userInfo.getUI_FID());
			if(obj!=null){
				List<FunctionButtonInfoModel> tempList = (List<FunctionButtonInfoModel>)obj;
				//获取一级按钮的信息start
				List<FunctionButtonInfoModel> resultList = new ArrayList<FunctionButtonInfoModel>();
				AllLimitUtil.getButtonListInfoFromFid(noChangeFid, tempList, resultList);
				model.addAttribute("allPollutantDeliveryBtn",resultList);
				//获取一级按钮的信息end
				if(resultList!=null && resultList.size()>0){
					for (int j = 0; j < resultList.size(); j++) {
						List<FunctionButtonInfoModel> resultListErJi = new ArrayList<FunctionButtonInfoModel>();
						FunctionButtonInfoModel tempFunctionButtonInfoModel=resultList.get(j);
						String erJiFId = tempFunctionButtonInfoModel.getFBI_FID();
						AllLimitUtil.getButtonListInfoFromFid(erJiFId, tempList, resultListErJi);
						model.addAttribute("pollutantDeliverySecond"+resultList.get(j).getFBI_URL(),resultListErJi);
					}
				}
				
				model.addAttribute("auditFid", auditFid);
			}else{
				return "permissionDenied";
			}	
			/**
			 * C标签表达式 要在初始中
			 */	
			/*SysDataDictionayModel sys=new SysDataDictionayModel();
			sys.setSDD_DICTIONARY("0001");
			sys.setSDD_DELFALG("0");
			List<SysDataDictionayModel> findDicInfo = sysDataDictionaryService.findDicInfo(sys);
			model.addAttribute("sys",findDicInfo);*/
			
//			SeentErfoModel sm=new SeentErfoModel();
//			sm.setSE_DEL_FLAG("0");
			
			
			
			return "researchReport/showResearchReport";
		}
		
		/**
		 * 查询及分页
		 * 
		 */
		@RequestMapping("initResearchReport")
		@ResponseBody
		public Map<String , Object> initResearchReport(ResearchReportModel researchReport,HttpSession session,@RequestParam Integer pageSize,@RequestParam Integer pageNumber,Model model) throws Exception{
			UserInfoEntity userInfo = (UserInfoEntity)session.getAttribute("LoginUserInfo");
			Map<String ,Object> result=new HashMap<String, Object>();
			
			if(userInfo!=null && userInfo.getLoginHoldIngCompany()!=null){
				String userIn = userInfo.getLoginHoldIngCompany();   // 当前用户单位FID 及下级 单位 FID 
				
					//服务企业下拉框可以复选
					if(researchReport.getRR_SERVICE_COMPANY()!=null && !"".equals(researchReport.getRR_SERVICE_COMPANY())){
						String[] stiNum = researchReport.getRR_SERVICE_COMPANY().split(",");
						String companyFid = CommonUtil.connectListString(stiNum);
						researchReport.setRR_SERVICE_COMPANY(null);
						researchReport.setRR_SERVICE_COMPANY_IN(companyFid);
						
					}
//						else{
						researchReport.setRR_CREATE_COMPANY_IN(userInfo.getLoginHoldIngCompany());
//						researchReport.setRR_CREATE_COMPANY_IN(CommonUtil.getString("RR_CREATE_COMPANY", userInfo.getCompanyList()));
//					}
					//权限控制
					if(researchReport.getRR_SERVICE_COMPANY()=="" || researchReport.getRR_SERVICE_COMPANY()==null){ 
						researchReport.setRR_CREATE_COMPANY_IN(CommonUtil.getString("RR_CREATE_COMPANY", userInfo.getCompanyList()));//
					}
//					agreementList
//				researchReport.setHtliketype("1");
				List<ResearchReportModel> selectPaging3=new ArrayList<ResearchReportModel>();
				selectPaging3=researchReportSerivace.selectResearchReportPaging(researchReport, pageNumber, pageSize);
				Integer selectResearchReportCount = researchReportSerivace.selectResearchReportCount(researchReport);
				result.put("total", selectResearchReportCount);
				result.put("rows", selectPaging3);
			}
			return result;
		}
		
	
		
		@RequestMapping("getCompanyByType")
		@ResponseBody
		public String getCompanyByType(HttpSession session) throws Exception{
			UserInfoEntity userInfo = (UserInfoEntity)session.getAttribute("LoginUserInfo");
			HoldingCompanyModel hold=new HoldingCompanyModel();
			hold.setHC_NOTIN("1");
			hold.setHC_FID(userInfo.getLoginHoldIngCompany());
			List<HoldingCompanyModel> hcRtdType = holdingCompanyService.findHoldingCompanyModel(hold);
		
				return JSON.toJSONString(hcRtdType);
			
			
		}
		/**
		 * 初始化跳转新增页面
		 * @throws Exception 
		 */
		@RequestMapping("insertResearchReportInfo")
		public String insertResearchReportInfo(ResearchReportModel researchReport,HttpSession session,Model model,String noChangeFid,String auditFid) throws Exception{
			UserInfoEntity userInfo = (UserInfoEntity)session.getAttribute("LoginUserInfo");
			//下拉列表服务企业名称
			HoldingCompanyModel hold=new HoldingCompanyModel();
			hold.setHC_NOTIN("1");
//			hold.setHC_FID(userInfo.getLoginHoldIngCompany());
			List<HoldingCompanyModel> hcRtdType = holdingCompanyService.findHoldingCompanyModel(hold);
			model.addAttribute("hcRtdType", hcRtdType);
				//下拉列表接收污染物类型
				List<SysDataDictionayModel> sysRtdType = getDataDic("03020");
				model.addAttribute("sysRtdType",sysRtdType);
				
				model.addAttribute("auditFid", auditFid);
			
			return "researchReport/insertResearchReport";
			
		}

		/**
		 * 新增模块信息
		 * 
		 */
		@RequestMapping("insertResearchReport")
		@ResponseBody
		public Map<String , Object> insertResearchReport(HttpSession session,ResearchReportModel researchReport) throws Exception{
			UserInfoEntity userInfo = (UserInfoEntity)session.getAttribute("LoginUserInfo");
			Map<String, Object> result = new HashMap<String, Object>();
			try {
				String ui_fid = userInfo.getUI_FID();
				String rr_fid = CommonUtil.getRandomNum("RR");

				researchReport.setRR_FID(rr_fid);
				researchReport.setRR_CREATER(ui_fid);
				researchReport.setRR_CREATE_COMPANY(userInfo.getHC_FID());

				researchReportSerivace.insertResearchReport(researchReport);
				
				result.put("result", "0");
			} catch (Exception e) {
				e.printStackTrace();
				result.put("result", "1");
			}
			return result;
			
		}
		
		
		/**
		 * 添加新判断信息
		 * 
		 */
		@RequestMapping("PanduanResearchReport")
		@ResponseBody
		public Map<String , Object> PanduanResearchReport(HttpSession session,ResearchReportModel researchReport) throws Exception{
			UserInfoEntity userInfo = (UserInfoEntity)session.getAttribute("LoginUserInfo");
			Map<String, Object> result = new HashMap<String, Object>();
			try {
				ResearchReportModel rec=new ResearchReportModel();
				rec.setRR_SERVICE_COMPANY(researchReport.getRR_SERVICE_COMPANY());
				rec.setRR_RECEIVING_POLLUTANTS(researchReport.getRR_RECEIVING_POLLUTANTS());
				List<ResearchReportModel> selectResearchReportList = researchReportSerivace.selectResearchReportList(rec);
			
				
				if(selectResearchReportList.size()>0){
				    boolean ofNot = false;
					for (int i = 0; i < selectResearchReportList.size(); i++) {
						if (userInfo.getUI_FID().equals(selectResearchReportList.get(i).getRR_CREATER())) {
							ofNot = true;
						}
					}
					
					if(ofNot){
						result.put("result", "0");
					}else{
						result.put("result", "1");
					}
				}else{
					result.put("result", "1");
				}
				
			
			} catch (Exception e) {
				e.printStackTrace();
				result.put("result", "1");
			}
			return result;
			
		}
		
		
		/**
		 * 修改前展示模块信息
		 * @throws Exception 
		 */
		@RequestMapping("updateInfo")
		public String updateInfo(HttpSession session,String noChanggeFid,Model model,String fid,String auditFid) throws Exception{
			if(fid!=null && fid!=""){
				model.addAttribute("fid", fid);
				ResearchReportModel researchReport=new ResearchReportModel();
				researchReport.setRR_FID(fid);
				//列表服务企业名称
				List<ResearchReportModel> listRR= researchReportSerivace.selectResearchReportList(researchReport);
				if (listRR!=null && listRR.size()>0) {
					ResearchReportModel rr=listRR.get(0);
					model.addAttribute("rr",rr);
				}
				
				model.addAttribute("auditFid", auditFid);
			}
			//列表接收污染物类型
			List<SysDataDictionayModel> sysRtdType = getDataDic("03020");
			model.addAttribute("sysRtdType",sysRtdType);
			
			return "researchReport/updateResearchReport";
		}
		
		
		/**
		 * 修改模块信息
		 * 
		 */
		@RequestMapping("updateResearchReport")
		@ResponseBody
		public Map<String , Object> updateResearchReport(String fid,HttpSession session,ResearchReportModel researchReport) throws Exception{
			UserInfoEntity userInfo = (UserInfoEntity)session.getAttribute("LoginUserInfo");
			Map<String, Object> result = new HashMap<String, Object>();
			try {
				String ui_fid = userInfo.getUI_FID();

				researchReport.setRR_FID(fid);
				researchReport.setRR_CREATER(ui_fid);
				researchReport.setRR_CREATE_COMPANY(userInfo.getHC_FID());

				researchReportSerivace.updateResearchReport(researchReport);;
				
				result.put("result", "0");
			} catch (Exception e) {
				e.printStackTrace();
				result.put("result", "1");
			}
			return result;
		
		}
		
		
		/**
		 * 删除模块信息
		 * 
		 */
		@RequestMapping("delResearchReport")
		@ResponseBody
		public Map<String, Object> delResearchReport(ResearchReportModel researchReport,HttpSession session,String fid) throws Exception{
			Map<String,Object> result=new HashMap<String,Object>();
			//创建数组
			String inem_ID = researchReport.getINEM_ID();
			String[] split = inem_ID.split(",");
			//循环判断多条要删除数据
			for(int i=0;i<split.length;i++){
				ResearchReportModel rec=new ResearchReportModel();
				
				rec.setRR_FID(split[i]);
				researchReportSerivace.deleteResearchReport(rec);
			}
			result.put("result", "success");
			return result;
		}
		
}

ResearchReportSerivace.java

package enytek.com.cn.service.researchReport;

import java.util.List;

import enytek.com.cn.model.researchreport.ResearchReportModel;

public interface ResearchReportSerivace {
	/**
	 * 新增方法
	 */
	public Integer insertResearchReport(ResearchReportModel researchReport);
	
	/**
	 * 修改方法
	 */
	public Integer updateResearchReport(ResearchReportModel researchReport);
	
	/**
	 * 删除方法
	 */
	public Integer deleteResearchReport(ResearchReportModel researchReport);
	
	/**
	 * 查询方法
	 */
	public List<ResearchReportModel> selectResearchReportList(ResearchReportModel researchReport);
	
	/**
	 * 分页查询
	 * @throws Exception 
	 */
	public List<ResearchReportModel> selectResearchReportPaging(ResearchReportModel researchReport,Integer pager_offset,Integer pageSize) throws Exception;
	
	/**
	 * 总数量
	 * @throws Exception 
	 */
	public Integer selectResearchReportCount(ResearchReportModel researchReport);
	
	/**
	 * 批量新增方法
	 */
	public Integer batchInsertResearchReportlist(List<ResearchReportModel> researchReport);
}

ResearchReportSerivceImpl.java

package enytek.com.cn.service.Impl.researchReport;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import enytek.com.cn.dao.researchReport.ResearchReportDao;
import enytek.com.cn.model.researchreport.ResearchReportModel;
import enytek.com.cn.service.researchReport.ResearchReportSerivace;
import enytek.com.cn.util.PageTools;

@Service("ResearchReportSerivce")
public class ResearchReportSerivceImpl implements ResearchReportSerivace {
	@Resource(name="ResearchReportDao")
	private ResearchReportDao researchReportDao;
	
	/**
	 * 新增方法
	 */
	public Integer insertResearchReport(ResearchReportModel researchReport) {
		return researchReportDao.insertResearchReport(researchReport);
	}

	/**
	 * 修改方法
	 */
	public Integer updateResearchReport(ResearchReportModel researchReport) {
		return researchReportDao.updateResearchReport(researchReport);
	}

	/**
	 * 删除方法
	 */
	public Integer deleteResearchReport(ResearchReportModel researchReport) {
		return researchReportDao.deleteResearchReport(researchReport);
	}

	/**
	 * 查询方法
	 */
	public List<ResearchReportModel> selectResearchReportList(
			ResearchReportModel researchReport) {
		return researchReportDao.selectResearchReportList(researchReport);
	}

	/**
	 * 查询及分页方法
	 * @throws Exception 
	 */
	public List<ResearchReportModel> selectResearchReportPaging(
			ResearchReportModel researchReport, Integer pager_offset,
			Integer pageSize) throws Exception {
		PageTools pt = new PageTools();
		int startPage = pt.getBeginNumbers(pager_offset, pageSize);
		int endPage = pt.getEndNumbers(pager_offset, pageSize);
		researchReport.setStartPage(startPage);
		researchReport.setEndPage(endPage);
		return researchReportDao.selectResearchReportPaging(researchReport);
	}

	/**
	 * 总数量
	 */
	public Integer selectResearchReportCount(ResearchReportModel researchReport) {
		return researchReportDao.selectResearchReportCount(researchReport);
	}

	/**
	 * 批量新增方法
	 */
	public Integer batchInsertResearchReportlist(
			List<ResearchReportModel> researchReport) {
		return researchReportDao.batchInsertResearchReportlist(researchReport);
	}


}

dao层

ResearchReportDao.java

package enytek.com.cn.dao.researchReport;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import enytek.com.cn.model.researchreport.ResearchReportModel;

public interface ResearchReportDao {
	/**
	 * 新增方法
	 */
	public Integer insertResearchReport(ResearchReportModel researchReport);
	
	/**
	 * 修改方法
	 */
	public Integer updateResearchReport(ResearchReportModel researchReport);
	
	/**
	 * 删除方法
	 */
	public Integer deleteResearchReport(ResearchReportModel researchReport);
	
	/**
	 * 查询方法
	 */
	public List<ResearchReportModel> selectResearchReportList(ResearchReportModel researchReport);
	
	/**
	 * 分页查询
	 */
	public List<ResearchReportModel> selectResearchReportPaging(ResearchReportModel researchReport);
	
	/**
	 * 总数量
	 */
	public Integer selectResearchReportCount(ResearchReportModel researchReport);
	
	/**
	 * 批量新增方法
	 */
	public Integer batchInsertResearchReportlist(List<ResearchReportModel> researchReport);

	/**查询用户和按钮之间的关系方法
	 *
	 */
	public List<ResearchReportModel> selectResearchReportlistInfo(@Param("listSon")List<String> listSon);
}

ResearchReportDaoImpl.java

package enytek.com.cn.dao.Impl.researchReport;

import java.util.List;

import org.springframework.stereotype.Repository;

import enytek.com.cn.base.PublicSqlSessionDao;
import enytek.com.cn.dao.researchReport.ResearchReportDao;
import enytek.com.cn.model.researchreport.ResearchReportModel;

@Repository("ResearchReportDao")
public class ResearchReportDaoImpl extends PublicSqlSessionDao implements ResearchReportDao {

	/**
	 * 新增方法
	 */
	public Integer insertResearchReport(ResearchReportModel researchReport) {
		return this.getSqlSession().insert("insertResearchReport", researchReport);
	}

	/**
	 * 修改方法
	 */
	public Integer updateResearchReport(ResearchReportModel researchReport) {
		return this.getSqlSession().update("updateResearchReport", researchReport);
	}

	/**
	 * 删除方法
	 */
	public Integer deleteResearchReport(ResearchReportModel researchReport) {
		return this.getSqlSession().delete("deleteResearchReport", researchReport);
	}

	/**
	 * 查询方法
	 */
	public List<ResearchReportModel> selectResearchReportList(
			ResearchReportModel researchReport) {
		return this.getSqlSession().selectList("selectResearchReportList", researchReport);
	}

	/**
	 * 查询及分页方法
	 */
	public List<ResearchReportModel> selectResearchReportPaging(ResearchReportModel researchReport) {
		return this.getSqlSession().selectList("selectResearchReportPaging",researchReport);
	}

	/**
	 * 总数量方法
	 */
	public Integer selectResearchReportCount(ResearchReportModel researchReport) {
		return this.getSqlSession().selectOne("selectResearchReportCount", researchReport);
	}

	/**
	 * 批量新增方法
	 */
	public Integer batchInsertResearchReportlist(
			List<ResearchReportModel> researchReport) {
		return this.getSqlSession().insert("batchInsertResearchReportlist", researchReport);
	}

	@Override
	public List<ResearchReportModel> selectResearchReportlistInfo(
			List<String> listSon) {
		// TODO Auto-generated method stub
		return this.getSqlSession().selectList("selectResearchReportlistInfo", listSon);
	}
	
	

}

ResearchReportMapper.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="enytek.com.cn.dao.researchReport.ResearchReportDao">
 
 <sql id="Base_Column_List">
 			 RR_ID
	 		,RR_FID
	 		,RR_SCFID
	 		,RR_SERVICE_COMPANY
	 		,RR_RECEIVING_POLLUTANTS
	 		,RR_DEADLINE
	 		,RR_TIME_REQUIRED
	 		,RR_DELFLAG
	 		,RR_CREATER
	 		,RR_CREATION_TIME
	 		,RR_IMAGE_NAME
	 		,RR_SYSTEM_IMAGE
	 		,RR_PICTURE_PATH
	 		,RR_CREATE_COMPANY
 </sql>
<!--  查询 条件-->
  <sql id="where_conditions">
	  <if test="RR_ID !=null and RR_ID !=''">
	 	 and RR_ID = #{RR_ID,jdbcType=DECIMAL}
	  </if>
	  <if test="RR_FID !=null and RR_FID !=''">
	 	 and RR_FID = #{RR_FID,jdbcType=VARCHAR}
	  </if>
	  <if test="RR_SCFID !=null and RR_SCFID !=''">
	 	 and RR_SCFID = #{RR_SCFID,jdbcType=VARCHAR}
	  </if>
	  <if test="RR_SERVICE_COMPANY !=null and RR_SERVICE_COMPANY !=''">
	 	 and RR_SERVICE_COMPANY = #{RR_SERVICE_COMPANY,jdbcType=VARCHAR}
	  </if>
	  <if test="RR_RECEIVING_POLLUTANTS !=null and RR_RECEIVING_POLLUTANTS !=''">
	 	 and RR_RECEIVING_POLLUTANTS = #{RR_RECEIVING_POLLUTANTS,jdbcType=VARCHAR}
	  </if>
	  <if test="RR_DEADLINE !=null and RR_DEADLINE !=''">
	 	 and RR_DEADLINE = to_date(#{RR_DEADLINE},'yyyy-mm-dd')
	  </if>
	  <if test="RR_TIME_REQUIRED !=null and RR_TIME_REQUIRED !=''">
	 	 and RR_TIME_REQUIRED = #{RR_TIME_REQUIRED,jdbcType=VARCHAR}
	  </if>
	  <if test="RR_DELFLAG !=null and RR_DELFLAG !=''">
	 	 and RR_DELFLAG = #{RR_DELFLAG,jdbcType=VARCHAR}
	  </if>
	  <if test="RR_CREATER !=null and RR_CREATER !=''">
	 	 and RR_CREATER = #{RR_CREATER,jdbcType=VARCHAR}
	  </if>
	  <if test="RR_CREATION_TIME !=null and RR_CREATION_TIME !=''">
	 	 and RR_CREATION_TIME =to_date(#{RR_CREATION_TIME},'yyyy-mm-dd')
	  </if>
	  <if test="RR_IMAGE_NAME !=null and RR_IMAGE_NAME !=''">
	 	 and RR_IMAGE_NAME = #{RR_IMAGE_NAME,jdbcType=VARCHAR}
	  </if>
	  <if test="RR_SYSTEM_IMAGE !=null and RR_SYSTEM_IMAGE !=''">
	 	 and RR_SYSTEM_IMAGE = #{RR_SYSTEM_IMAGE,jdbcType=VARCHAR}
	  </if>
	  <if test="RR_PICTURE_PATH !=null and RR_PICTURE_PATH !=''">
	 	 and RR_PICTURE_PATH = #{RR_PICTURE_PATH,jdbcType=VARCHAR}
	  </if>
	  <if test="RR_CREATE_COMPANY !=null and RR_CREATE_COMPANY !=''">
	 	 and RR_CREATE_COMPANY = #{RR_CREATE_COMPANY,jdbcType=VARCHAR}
	  </if>
	  <if test="RR_CREATE_COMPANY_IN !=null and RR_CREATE_COMPANY_IN !=''">
	 	 and  (${RR_CREATE_COMPANY_IN})
	  </if>
	  <if test="RR_CREATER_IN !=null and RR_CREATER_IN !=''">
	 	 and  (${RR_CREATER_IN})
	  </if>
	  <if test="company !=null and company !=''">
	 	 and company = #{company,jdbcType=VARCHAR}
	  </if>
	  <if test="RR_SERVICE_COMPANY_IN !=null and RR_SERVICE_COMPANY_IN !=''">
		 and RR_SERVICE_COMPANY in ${RR_SERVICE_COMPANY_IN}
	  </if>
		
  </sql>
<!--   新增方法 -->
  <insert id="insertResearchReport" parameterType="researchReport">
  	<selectKey resultType="Integer" keyProperty="RR_ID" order="BEFORE">
  		SELECT SEQ_RR_ID.nextval FROM DUAL
  	</selectKey>
  		insert into RESEARCH_REPORT(
  			RR_ID
	 		,RR_FID
	 		,RR_SCFID
	 		,RR_SERVICE_COMPANY
	 		,RR_RECEIVING_POLLUTANTS
	 		,RR_DEADLINE
	 		,RR_TIME_REQUIRED
	 		,RR_DELFLAG
	 		,RR_CREATER
	 		,RR_CREATION_TIME
	 		,RR_IMAGE_NAME
	 		,RR_SYSTEM_IMAGE
	 		,RR_PICTURE_PATH
	 		,RR_CREATE_COMPANY
  		)values(
		  	 #{ RR_ID,jdbcType=DECIMAL},
			 #{ RR_FID,jdbcType=VARCHAR},
			 #{ RR_SCFID,jdbcType=VARCHAR},
			 #{ RR_SERVICE_COMPANY,jdbcType=VARCHAR},
			 #{ RR_RECEIVING_POLLUTANTS,jdbcType=VARCHAR},
			 to_date(#{RR_DEADLINE},'yyyy-MM-dd '),
			 #{ RR_TIME_REQUIRED,jdbcType=VARCHAR},
			 '0',
			 #{ RR_CREATER,jdbcType=VARCHAR},
			 sysdate,
			 #{ RR_IMAGE_NAME,jdbcType=VARCHAR},
			 #{ RR_SYSTEM_IMAGE,jdbcType=VARCHAR},
			 #{ RR_PICTURE_PATH,jdbcType=VARCHAR},
			 #{ RR_CREATE_COMPANY,jdbcType=VARCHAR}
  		)
  </insert>
<!--   查询方法 -->
  <select id="selectResearchReportList" parameterType="researchReport" resultType="researchReport">
  	select RR_ID,
       RR_FID,
       RR_SCFID,
       RR_SERVICE_COMPANY,
       RR_RECEIVING_POLLUTANTS,
       to_char(RR_DEADLINE, 'yyyy-mm-dd') RR_DEADLINE,
       RR_TIME_REQUIRED,
       RR_DELFLAG,
       RR_CREATER,
       to_char(RR_CREATION_TIME, 'yyyy-mm-dd') RR_CREATION_TIME,
       RR_IMAGE_NAME,
       RR_SYSTEM_IMAGE,
       RR_PICTURE_PATH,
       RR_CREATE_COMPANY,
       (select hc_name from HOLDINGCOMPANY where hc_fid = RR_SERVICE_COMPANY) as company
<!-- 	 <include refid="Base_Column_List"/> -->
	 	from RESEARCH_REPORT
	 <where>
	 RR_DELFLAG='0'
	 <include refid="where_conditions"/>
	 </where>	
  </select>
<!--   分页查询 -->
  <select id="selectResearchReportPaging" parameterType="researchReport" resultType="researchReport">
  	select 
  	<include refid="Base_Column_List"/>,
  		rownum_ from(select 
  			RR_ID
	 		,RR_FID
	 		,RR_SCFID
	 		,(select HC_NAME from HOLDINGCOMPANY where HC_FID=RR_SERVICE_COMPANY) as RR_SERVICE_COMPANY
	 		,(select SDD_DICTIONARY_CNAME from SYS_DATA_DICTIONARY where SDD_DICTIONARY='03020' and SDD_DELFALG='0' and RR_RECEIVING_POLLUTANTS=SDD_DICTIONARY_CODE) as RR_RECEIVING_POLLUTANTS
	 		,to_char(RR_DEADLINE,'yyyy-MM-dd') RR_DEADLINE
	 		,RR_TIME_REQUIRED
	 		,RR_DELFLAG
	 		,RR_CREATER
	 		,to_char(RR_CREATION_TIME,'yyyy-MM-dd') RR_CREATION_TIME
	 		,RR_IMAGE_NAME
	 		,RR_SYSTEM_IMAGE
	 		,RR_PICTURE_PATH
	 		,RR_CREATE_COMPANY
	 		,(select HC_NAME from HOLDINGCOMPANY where HC_FID=RR_SERVICE_COMPANY) as company
	 		,row_number() over(order by RR_ID desc) as rownum_
	 		from  RESEARCH_REPORT,HOLDINGCOMPANY
<!-- 	 		 left join POLLUTANT_REPORT -->
<!--             on RESEARCH_REPORT.RR_SCFID = POLLUTANT_REPORT.PR_FID -->
		where
			1=1  and RR_DELFLAG='0'
				and RESEARCH_REPORT.RR_SERVICE_COMPANY=HOLDINGCOMPANY.HC_FID
				and HOLDINGCOMPANY.HC_TYPE not like '%1%'
			<include refid="where_conditions" />

			
		
  		) row_ WHERE row_.rownum_ between #{startPage} and #{endPage}
  	
  </select>
  
<!--   总数量 -->
  <select id="selectResearchReportCount" parameterType="researchReport" resultType="Integer">
  	select count(1) from RESEARCH_REPORT 
  	<where>
  		 RR_DELFLAG='0'
		<include refid="where_conditions"/>
		
  	</where>
  </select>
<!--   修改方法 -->
  <update id="updateResearchReport" parameterType="researchReport">
  		update RESEARCH_REPORT
  		<set>
	  		<if test="RR_ID != null and RR_ID !=''">
		 		RR_ID=#{RR_ID,jdbcType=DECIMAL},
		 	</if>
	    	<if test="RR_FID != null and RR_FID !=''">
		 		RR_FID=#{RR_FID,jdbcType=VARCHAR},
		 	</if>
	    	<if test="RR_SCFID != null and RR_SCFID !=''">
		 		RR_SCFID=#{RR_SCFID,jdbcType=VARCHAR},
		 	</if>
	    	<if test="RR_SERVICE_COMPANY != null and RR_SERVICE_COMPANY !=''">
		 		RR_SERVICE_COMPANY=#{RR_SERVICE_COMPANY,jdbcType=VARCHAR},
		 	</if>
	    	<if test="RR_RECEIVING_POLLUTANTS != null and RR_RECEIVING_POLLUTANTS !=''">
		 		RR_RECEIVING_POLLUTANTS=#{RR_RECEIVING_POLLUTANTS,jdbcType=VARCHAR},
		 	</if>
	    	<if test="RR_DEADLINE != null and RR_DEADLINE !=''">
		 		RR_DEADLINE=to_date(#{RR_DEADLINE},'yyyy-mm-dd '),
		 	</if>
	    	<if test="RR_TIME_REQUIRED != null and RR_TIME_REQUIRED !=''">
		 		RR_TIME_REQUIRED=#{RR_TIME_REQUIRED,jdbcType=VARCHAR},
		 	</if>
	    	<if test="RR_DELFLAG != null and RR_DELFLAG !=''">
		 		RR_DELFLAG=#{RR_DELFLAG,jdbcType=VARCHAR},
		 	</if>
	    	<if test="RR_CREATER != null and RR_CREATER !=''">
		 		RR_CREATER=#{RR_CREATER,jdbcType=VARCHAR},
		 	</if>
	    	<if test="RR_CREATION_TIME != null and RR_CREATION_TIME !=''">
		 		RR_CREATION_TIME=to_date(#{RR_CREATION_TIME},'yyyy-mm-dd '),
		 	</if>
	    	<if test="RR_IMAGE_NAME != null and RR_IMAGE_NAME !=''">
		 		RR_IMAGE_NAME=#{RR_IMAGE_NAME,jdbcType=VARCHAR},
		 	</if>
	    	<if test="RR_SYSTEM_IMAGE != null and RR_SYSTEM_IMAGE !=''">
		 		RR_SYSTEM_IMAGE=#{RR_SYSTEM_IMAGE,jdbcType=DATE},
		 	</if>
	    	<if test="RR_PICTURE_PATH != null and RR_PICTURE_PATH !=''">
		 		RR_PICTURE_PATH=#{RR_PICTURE_PATH,jdbcType=VARCHAR},
		 	</if>
  		</set>
  		where RR_FID=#{RR_FID,jdbcType=VARCHAR}
  </update>
<!--   删除方法 -->
  <update id="deleteResearchReport" parameterType="researchReport" >
  	update RESEARCH_REPORT set RR_DELFLAG='1' where RR_FID=${RR_FID}
  </update>
</mapper>

ResearchReportModel.java

package enytek.com.cn.model.researchreport;

public class ResearchReportModel {
	private Integer RR_ID; //主键
	private String RR_FID; //伪列
	private String RR_SCFID; //服务fid
	private String RR_SERVICE_COMPANY; //服务企业名称
	private String RR_RECEIVING_POLLUTANTS; //接收污染物类型
	private String RR_DEADLINE; //服务截止日期
	private String RR_TIME_REQUIRED; //到达港口企业所需时间
	private String RR_DELFLAG; //删除标记
	private String RR_CREATER; //创建人
	private String RR_CREATION_TIME; //创建时间
	private String RR_IMAGE_NAME; //图片名称
	private String RR_SYSTEM_IMAGE; //系统生成的图片名
	private String RR_PICTURE_PATH; //图面路径
	
	private Integer StartPage;//开始分页
	private Integer EndPage;//接收分页
	private String rownum_;//序号
	
	private String RR_CREATER_IN;
	private String RR_SERVICE_COMPANY_IN;//展示用企业名称
	private String RR_RECEIVING_POLLUTANTS_IN;//展示用接收污染物类型
	
	private String INEM_ID;//查询多条in
	
	private String RR_CREATE_COMPANY;//创建单位 2019年10月16日16:08:46 zhd
	

	private String htliketype;

	private String company;

	private String RR_CREATE_COMPANY_IN;
	
	public String getRR_CREATE_COMPANY_IN() {
		return RR_CREATE_COMPANY_IN;
	}
	public void setRR_CREATE_COMPANY_IN(String rR_CREATE_COMPANY_IN) {
		RR_CREATE_COMPANY_IN = rR_CREATE_COMPANY_IN;
	}
	public String getHtliketype() {
		return htliketype;
	}
	public void setHtliketype(String htliketype) {
		this.htliketype = htliketype;
	}
	public String getCompany() {
		return company;
	}
	public void setCompany(String company) {
		this.company = company;
	}
	public String getRR_CREATE_COMPANY() {
		return RR_CREATE_COMPANY;
	}
	public void setRR_CREATE_COMPANY(String rR_CREATE_COMPANY) {
		RR_CREATE_COMPANY = rR_CREATE_COMPANY;
	}
	public String getINEM_ID() {
		return INEM_ID;
	}
	public void setINEM_ID(String iNEM_ID) {
		INEM_ID = iNEM_ID;
	}
	public String getRR_CREATER_IN() {
		return RR_CREATER_IN;
	}
	public void setRR_CREATER_IN(String rR_CREATER_IN) {
		RR_CREATER_IN = rR_CREATER_IN;
	}
	public Integer getStartPage() {
		return StartPage;
	}
	public void setStartPage(Integer startPage) {
		StartPage = startPage;
	}
	public Integer getEndPage() {
		return EndPage;
	}
	public void setEndPage(Integer endPage) {
		EndPage = endPage;
	}
	public Integer getRR_ID() {
		return RR_ID;
	}
	public void setRR_ID(Integer rR_ID) {
		RR_ID = rR_ID;
	}
	public String getRR_FID() {
		return RR_FID;
	}
	public void setRR_FID(String rR_FID) {
		RR_FID = rR_FID;
	}
	public String getRR_SCFID() {
		return RR_SCFID;
	}
	public void setRR_SCFID(String rR_SCFID) {
		RR_SCFID = rR_SCFID;
	}
	public String getRR_SERVICE_COMPANY() {
		return RR_SERVICE_COMPANY;
	}
	public void setRR_SERVICE_COMPANY(String rR_SERVICE_COMPANY) {
		RR_SERVICE_COMPANY = rR_SERVICE_COMPANY;
	}
	public String getRR_RECEIVING_POLLUTANTS() {
		return RR_RECEIVING_POLLUTANTS;
	}
	public void setRR_RECEIVING_POLLUTANTS(String rR_RECEIVING_POLLUTANTS) {
		RR_RECEIVING_POLLUTANTS = rR_RECEIVING_POLLUTANTS;
	}
	public String getRR_DEADLINE() {
		return RR_DEADLINE;
	}
	public void setRR_DEADLINE(String rR_DEADLINE) {
		RR_DEADLINE = rR_DEADLINE;
	}
	
//	public Double getRR_TIME_REQUIRED() {
//		return RR_TIME_REQUIRED;
//	}
//	public void setRR_TIME_REQUIRED(Double rR_TIME_REQUIRED) {
//		RR_TIME_REQUIRED = rR_TIME_REQUIRED;
//	}
	
	public String getRR_DELFLAG() {
		return RR_DELFLAG;
	}
	public String getRR_TIME_REQUIRED() {
		return RR_TIME_REQUIRED;
	}
	public void setRR_TIME_REQUIRED(String rR_TIME_REQUIRED) {
		RR_TIME_REQUIRED = rR_TIME_REQUIRED;
	}
	public void setRR_DELFLAG(String rR_DELFLAG) {
		RR_DELFLAG = rR_DELFLAG;
	}
	public String getRR_CREATER() {
		return RR_CREATER;
	}
	public void setRR_CREATER(String rR_CREATER) {
		RR_CREATER = rR_CREATER;
	}
	public String getRR_CREATION_TIME() {
		return RR_CREATION_TIME;
	}
	public void setRR_CREATION_TIME(String rR_CREATION_TIME) {
		RR_CREATION_TIME = rR_CREATION_TIME;
	}
	public String getRR_IMAGE_NAME() {
		return RR_IMAGE_NAME;
	}
	public void setRR_IMAGE_NAME(String rR_IMAGE_NAME) {
		RR_IMAGE_NAME = rR_IMAGE_NAME;
	}
	public String getRR_SYSTEM_IMAGE() {
		return RR_SYSTEM_IMAGE;
	}
	public void setRR_SYSTEM_IMAGE(String rR_SYSTEM_IMAGE) {
		RR_SYSTEM_IMAGE = rR_SYSTEM_IMAGE;
	}
	public String getRR_PICTURE_PATH() {
		return RR_PICTURE_PATH;
	}
	public void setRR_PICTURE_PATH(String rR_PICTURE_PATH) {
		RR_PICTURE_PATH = rR_PICTURE_PATH;
	}
	public String getRownum_() {
		return rownum_;
	}
	public void setRownum_(String rownum_) {
		this.rownum_ = rownum_;
	}
	public String getRR_SERVICE_COMPANY_IN() {
		return RR_SERVICE_COMPANY_IN;
	}
	public void setRR_SERVICE_COMPANY_IN(String rR_SERVICE_COMPANY_IN) {
		RR_SERVICE_COMPANY_IN = rR_SERVICE_COMPANY_IN;
	}
	public String getRR_RECEIVING_POLLUTANTS_IN() {
		return RR_RECEIVING_POLLUTANTS_IN;
	}
	public void setRR_RECEIVING_POLLUTANTS_IN(String rR_RECEIVING_POLLUTANTS_IN) {
		RR_RECEIVING_POLLUTANTS_IN = rR_RECEIVING_POLLUTANTS_IN;
	}
	
	
}

mybatis-config.xml

<!-- 		调研填报附件表 -->
		<typeAlias alias="researchReport" type="enytek.com.cn.model.researchreport.ResearchReportModel" />
<!-- 		调研填报附件表 -->
		<mapper resource="enytek/com/cn/mappers/researchreport/ResearchReportMapper.xml"/>

ResearchReportModel.java

package enytek.com.cn.model.researchreport;

public class ResearchReportModel {
	private Integer RR_ID; //主键
	private String RR_FID; //伪列
	private String RR_SCFID; //服务fid
	private String RR_SERVICE_COMPANY; //服务企业名称
	private String RR_RECEIVING_POLLUTANTS; //接收污染物类型
	private String RR_DEADLINE; //服务截止日期
	private String RR_TIME_REQUIRED; //到达港口企业所需时间
	private String RR_DELFLAG; //删除标记
	private String RR_CREATER; //创建人
	private String RR_CREATION_TIME; //创建时间
	private String RR_IMAGE_NAME; //图片名称
	private String RR_SYSTEM_IMAGE; //系统生成的图片名
	private String RR_PICTURE_PATH; //图面路径
	
	private Integer StartPage;//开始分页
	private Integer EndPage;//接收分页
	private String rownum_;//序号
	
	private String RR_CREATER_IN;
	private String RR_SERVICE_COMPANY_IN;//展示用企业名称
	private String RR_RECEIVING_POLLUTANTS_IN;//展示用接收污染物类型
	
	private String INEM_ID;//查询多条in
	
	private String RR_CREATE_COMPANY;//创建单位 2019年10月16日16:08:46 zhd
	

	private String htliketype;

	private String company;

	private String RR_CREATE_COMPANY_IN;
	
	public String getRR_CREATE_COMPANY_IN() {
		return RR_CREATE_COMPANY_IN;
	}
	public void setRR_CREATE_COMPANY_IN(String rR_CREATE_COMPANY_IN) {
		RR_CREATE_COMPANY_IN = rR_CREATE_COMPANY_IN;
	}
	public String getHtliketype() {
		return htliketype;
	}
	public void setHtliketype(String htliketype) {
		this.htliketype = htliketype;
	}
	public String getCompany() {
		return company;
	}
	public void setCompany(String company) {
		this.company = company;
	}
	public String getRR_CREATE_COMPANY() {
		return RR_CREATE_COMPANY;
	}
	public void setRR_CREATE_COMPANY(String rR_CREATE_COMPANY) {
		RR_CREATE_COMPANY = rR_CREATE_COMPANY;
	}
	public String getINEM_ID() {
		return INEM_ID;
	}
	public void setINEM_ID(String iNEM_ID) {
		INEM_ID = iNEM_ID;
	}
	public String getRR_CREATER_IN() {
		return RR_CREATER_IN;
	}
	public void setRR_CREATER_IN(String rR_CREATER_IN) {
		RR_CREATER_IN = rR_CREATER_IN;
	}
	public Integer getStartPage() {
		return StartPage;
	}
	public void setStartPage(Integer startPage) {
		StartPage = startPage;
	}
	public Integer getEndPage() {
		return EndPage;
	}
	public void setEndPage(Integer endPage) {
		EndPage = endPage;
	}
	public Integer getRR_ID() {
		return RR_ID;
	}
	public void setRR_ID(Integer rR_ID) {
		RR_ID = rR_ID;
	}
	public String getRR_FID() {
		return RR_FID;
	}
	public void setRR_FID(String rR_FID) {
		RR_FID = rR_FID;
	}
	public String getRR_SCFID() {
		return RR_SCFID;
	}
	public void setRR_SCFID(String rR_SCFID) {
		RR_SCFID = rR_SCFID;
	}
	public String getRR_SERVICE_COMPANY() {
		return RR_SERVICE_COMPANY;
	}
	public void setRR_SERVICE_COMPANY(String rR_SERVICE_COMPANY) {
		RR_SERVICE_COMPANY = rR_SERVICE_COMPANY;
	}
	public String getRR_RECEIVING_POLLUTANTS() {
		return RR_RECEIVING_POLLUTANTS;
	}
	public void setRR_RECEIVING_POLLUTANTS(String rR_RECEIVING_POLLUTANTS) {
		RR_RECEIVING_POLLUTANTS = rR_RECEIVING_POLLUTANTS;
	}
	public String getRR_DEADLINE() {
		return RR_DEADLINE;
	}
	public void setRR_DEADLINE(String rR_DEADLINE) {
		RR_DEADLINE = rR_DEADLINE;
	}
	
//	public Double getRR_TIME_REQUIRED() {
//		return RR_TIME_REQUIRED;
//	}
//	public void setRR_TIME_REQUIRED(Double rR_TIME_REQUIRED) {
//		RR_TIME_REQUIRED = rR_TIME_REQUIRED;
//	}
	
	public String getRR_DELFLAG() {
		return RR_DELFLAG;
	}
	public String getRR_TIME_REQUIRED() {
		return RR_TIME_REQUIRED;
	}
	public void setRR_TIME_REQUIRED(String rR_TIME_REQUIRED) {
		RR_TIME_REQUIRED = rR_TIME_REQUIRED;
	}
	public void setRR_DELFLAG(String rR_DELFLAG) {
		RR_DELFLAG = rR_DELFLAG;
	}
	public String getRR_CREATER() {
		return RR_CREATER;
	}
	public void setRR_CREATER(String rR_CREATER) {
		RR_CREATER = rR_CREATER;
	}
	public String getRR_CREATION_TIME() {
		return RR_CREATION_TIME;
	}
	public void setRR_CREATION_TIME(String rR_CREATION_TIME) {
		RR_CREATION_TIME = rR_CREATION_TIME;
	}
	public String getRR_IMAGE_NAME() {
		return RR_IMAGE_NAME;
	}
	public void setRR_IMAGE_NAME(String rR_IMAGE_NAME) {
		RR_IMAGE_NAME = rR_IMAGE_NAME;
	}
	public String getRR_SYSTEM_IMAGE() {
		return RR_SYSTEM_IMAGE;
	}
	public void setRR_SYSTEM_IMAGE(String rR_SYSTEM_IMAGE) {
		RR_SYSTEM_IMAGE = rR_SYSTEM_IMAGE;
	}
	public String getRR_PICTURE_PATH() {
		return RR_PICTURE_PATH;
	}
	public void setRR_PICTURE_PATH(String rR_PICTURE_PATH) {
		RR_PICTURE_PATH = rR_PICTURE_PATH;
	}
	public String getRownum_() {
		return rownum_;
	}
	public void setRownum_(String rownum_) {
		this.rownum_ = rownum_;
	}
	public String getRR_SERVICE_COMPANY_IN() {
		return RR_SERVICE_COMPANY_IN;
	}
	public void setRR_SERVICE_COMPANY_IN(String rR_SERVICE_COMPANY_IN) {
		RR_SERVICE_COMPANY_IN = rR_SERVICE_COMPANY_IN;
	}
	public String getRR_RECEIVING_POLLUTANTS_IN() {
		return RR_RECEIVING_POLLUTANTS_IN;
	}
	public void setRR_RECEIVING_POLLUTANTS_IN(String rR_RECEIVING_POLLUTANTS_IN) {
		RR_RECEIVING_POLLUTANTS_IN = rR_RECEIVING_POLLUTANTS_IN;
	}
	
	
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值