新写的jsp,选多人的条件,列表数据加连接


<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page import="com.velcro.base.BaseContext" %>
<%@ include file="/vbase/init.jsp"%>
<%@ page import="com.velcro.workflow.report.service.ReportdefService"%>
<%@ page import="com.velcro.workflow.report.model.Reportdef"%>
<%@ page import="com.velcro.base.Page"%>
<%@ page import="com.velcro.base.selectitem.model.Selectitem"%>
<%@ page import="com.velcro.base.selectitem.service.SelectitemService"%>
<%@ page import="com.velcro.kernel.base.IDataService" %>
<%@ page import="com.velcro.kernel.workflow.report.service.IReportdefService" %>
<%@ page import="static org.nutz.mvc.Mvcs.getServletContext" %>
<%@ page import="com.velcro.base.orgunit.service.OrgunitService" %>
<%@ page import="com.velcro.document.base.service.DocbaseService" %>
<%
    IDataService  dateservice= (IDataService) BaseContext.getBean(request,"dataService");
    HumresService humresService= (HumresService)BaseContext.getBean(request,"humresService");
    OrgunitService orgunitService = (OrgunitService)BaseContext.getBean(request,"orgunitService");
    SelectitemService selectitemService=(SelectitemService)BaseContext.getBean(request,"selectitemService");
    DocbaseService docbaseService = (DocbaseService) BaseContext.getBean(getServletContext(), "docbaseService");

    String nameid = StringHelper.null2String(request.getParameter("nameid"));//企业名称id
    String bMentorid = StringHelper.null2String(request.getParameter("bMentorid"));  //企业导师id
    String sMentorid = StringHelper.null2String(request.getParameter("sMentorid"));  //学术导师id
    String createdates = StringHelper.null2String(request.getParameter("createdate"));//开始时间
    String createdates_1 = StringHelper.null2String(request.getParameter("createdate_1"));//结束时间

    String selectSql = "select * from ufe4f3l71655105091655 where 1=1 and (isdelete is null or isdelete=0) ";

    if (StringHelper.isNotEmpty(createdates)){
        selectSql=selectSql + "and field012 >='"+createdates+"' ";
    }
    if (StringHelper.isNotEmpty(createdates_1)){
        selectSql=selectSql + "and field012 <='"+createdates_1+"' ";
    }
    //合作机构
    if (StringHelper.isNotEmpty(nameid)){
        selectSql=selectSql + "and field002 ='"+nameid+"' ";
    }
    String nameidspan=dateservice.getValue("select field001 from ufe7q3i81625135784770 where id='"+nameid+"'");

    //获取企业导师id
    String bMentoridname="";
    if (StringHelper.isNotEmpty(bMentorid)){
        String[] objnames = new String[0];
        objnames = bMentorid.split(",");
        String bMentorids="";
        for (int i=0;i){
            if (i==objnames.length-1){
                bMentorids=bMentorids+"'"+objnames[i]+"'";
            }else {
                bMentorids=bMentorids+"'"+objnames[i]+"'"+",";
            }
        }
        selectSql=selectSql + " and field005 like '%"+bMentorid+"%' ";
        bMentoridname=dateservice.getValue("select objname from humres where id in ("+bMentorids+")");//企业导师名称
    }

    //学视导师名称
    String sMentoridspan="";
    if (StringHelper.isNotEmpty(sMentorid)){
        String[] objnames = new String[0];
        objnames = sMentorid.split(",");
        String sMentorids="";
        for (int i=0;i){
            if (i== objnames.length -1){
                sMentorids=sMentorids+"'"+objnames[i]+"'";
            }else {
                sMentorids=sMentorids+"'"+objnames[i]+"'"+",";
            }
        }
        selectSql=selectSql + " and field006 like '%"+sMentorid+"%' ";
        sMentoridspan=dateservice.getValue("select objname from humres where id in ("+sMentorids+")");
    }

    selectSql=selectSql+" order by field001 asc";
//    System.out.println(selectSql);

    int pageno = NumberHelper.string2Int((String) request.getParameter("pageno"), 1);
    int pagesize = NumberHelper.string2Int((String) request.getParameter("pagesize"), 10);
    Page pageObject = (Page) dateservice.pagedQuery(selectSql, pageno, pagesize);
    List list = new ArrayList();
    if (pageObject.getTotalSize() != 0) {
        list = (List) pageObject.getResult();
    }

%>


    <script type="text/javascript" src="/vjs/sack.js"></script>
    <script type="text/javascript" src="/vjs/base/ShowHide.js"></script>
    <script type="text/javascript" src="/vjs/base/ListTable.js"></script>
    <script src="/kms/js/My97DatePicker/WdatePicker.js"></script>
    <script src="/vjs/base/InputMsg.js" type="text/javascript"></script>
    <script src="/vjs/base/DataHelper.js" type="text/javascript"></script>
    <script src="/vjs/browser.js" type="text/javascript"></script>
    <script src="/vjs/selectitemjs.js" type="text/javascript"></script>
    <script type="text/javascript"
            src="/vkm/vnc/treeframe/knowledge/js/jquery-latest.js"></script>
    <script type="text/javascript"
            src="/vkm/vnc/treeframe/knowledge/js/jquery-ui-latest.js"></script>
    <script type="text/javascript"
            src="/vkm/vnc/treeframe/knowledge/js/jquery.layout-latest.js"></script>
    <script language="JScript.Encode" src="/vjs/rtxint.js"></script>
    <script language="JScript.Encode" src="/vjs/browinfo.js"></script>
    
    
    
    
    
    



class="mW2">
class="pB">
class="direct-right-search">
class="direct-search"> 企业名称: 企业导师: 学术导师: 填报日期: class="dateIpt" id="createdate" type="text" value="<%=createdates%>"> - class="dateIpt" id="createdate_1" type="text" value="<%=createdates_1%>">
class="direct-right-table">
class="right-table-wrap"> class="direct-table-tr"> <% int h=0; for (int i = 0; i < list.size(); i++) { Map map = (Map) list.get(i); String ids=StringHelper.null2String(map.get("id")); String noid=StringHelper.null2String(map.get("field001"));//序号 String businessName=StringHelper.null2String(map.get("field002")); //企业名称 String introduce=StringHelper.null2String(map.get("field004"));//企业介绍 String businessMentor=StringHelper.null2String(map.get("field005"));//企业导师 String scienceMentor=StringHelper.null2String(map.get("field006"));//学术导师 String students=StringHelper.null2String(map.get("field007"));//学生名单 String subjectData=StringHelper.null2String(map.get("field008"));//课题资料 String achievements=StringHelper.null2String(map.get("field009"));//课题成果 //企业名称 String qyid="select field001 from ufe7q3i81625135784770 where id='"+businessName+"' "; String qyname = dateservice.getValue(qyid); //企业导师名称 String[] bmids = new String[0]; bmids = businessMentor.split(","); String bmnames=""; for (int j=0;j){ String sql="select objname from humres where id='"+bmids[j]+"'"; String hname = dateservice.getValue(sql); String append=""+hname+""; if (j == bmids.length -1){ bmnames+=append; }else { bmnames+=append+","; } } //学术导师名称 String[] smids = new String[0]; smids = scienceMentor.split(","); String smnames=""; for (int j=0;j){ String sql="select objname from humres where id='"+smids[j]+"'"; String hname = dateservice.getValue(sql); String append=""+hname+""; if (j == smids.length -1 ){ smnames+=append; }else { smnames+=append+","; } } //学生名单 String[] studentids = new String[0]; studentids = students.split(","); String stnames=""; for (int j=0;j){ String sql="select objname from humres where id='"+studentids[j]+"'"; String hname = dateservice.getValue(sql); String append=""+hname+""; if (j == studentids.length -1 ){ stnames+=append; }else { stnames+=append+","; } } //企业介绍多个introduce的id String[] introduceids=new String[0]; introduceids=introduce.split(","); String intrNames=""; for (int j=0; j){ String sql="select subject from docbase where id='"+introduceids[j]+"'"; String sname= dateservice.getValue(sql); String append=""+sname+""; if (j==introduceids.length-1){ intrNames+=append; }else { intrNames+=append+","; } } %> <%} %>
序号 企业名称 企业介绍 企业导师 学术导师 学生名单 课题资料 课题成果
<%=i+1%> <%=qyname%> <%=StringHelper.convertHtmlString(intrNames.toString())%> <%=StringHelper.convertHtmlString(bmnames.toString())%> <%=StringHelper.convertHtmlString(smnames.toString())%> <%=stnames%> <%=subjectData%> <%=achievements%>
<%@ include file="/vbase/pagenavigator.jsp"%>
<%--<script src="/vjs/jquery/jquery.min.js" type="text/javascript"></script>--%> <%--<script src="/home/js/mail.js"></script>--%> <script language="javascript" type="text/javascript"> function onSubmit(){ document.VelcroForm.pageno.value="1"; document.VelcroForm.submit(); } new vjs.base.ListTable({table:'#vTable'}); </script> <script type="text/javascript"> var tTD; //用来存储当前更改宽度的Table Cell,避免快速移动鼠标的问题 var table = document.getElementById("tb_1"); for (j = 0; j < table.rows[0].cells.length; j++) { table.rows[0].cells[j].onmousedown = function () { //记录单元格 tTD = this; if (event.offsetX > tTD.offsetWidth - 10) { tTD.mouseDown = true; tTD.oldX = event.x; tTD.oldWidth = tTD.offsetWidth; } //记录Table宽度 //table = tTD; while (table.tagName != ‘TABLE') table = table.parentElement; //tTD.tableWidth = table.offsetWidth; }; table.rows[0].cells[j].onmouseup = function () { //结束宽度调整 if (tTD == undefined) tTD = this; tTD.mouseDown = false; tTD.style.cursor = 'default'; }; table.rows[0].cells[j].onmousemove = function () { //更改鼠标样式 if (event.offsetX > this.offsetWidth - 10) this.style.cursor = 'col-resize'; else this.style.cursor = 'default'; //取出暂存的Table Cell if (tTD == undefined) tTD = this; //调整宽度 if (tTD.mouseDown != null && tTD.mouseDown == true) { tTD.style.cursor = 'default'; if (tTD.oldWidth + (event.x - tTD.oldX) > 0) tTD.width = tTD.oldWidth + (event.x - tTD.oldX); //调整列宽 tTD.style.width = tTD.width; tTD.style.cursor = 'col-resize'; //调整该列中的每个Cell table = tTD; while (table.tagName != 'TABLE') table = table.parentElement; for (j = 0; j < table.rows.length; j++) { table.rows[j].cells[tTD.cellIndex].width = tTD.width; } //调整整个表 //table.width = tTD.tableWidth + (tTD.offsetWidth – tTD.oldWidth); //table.style.width = table.width; } }; } </script>