分类汇总问题,求大神详细指导下,跪求

下边是我实现第二个图的代码,现在我想实现第二张图查询出来的模式,求大神指导下怎么弄,跪求~

图片说明

图片说明

public String getList() throws Exception
    {


          chengJiJiLuList = dao.getList(TrainingOrCompetitionID,startTime,endTime);
        ArrayList chengJiJiLuList = new ArrayList();
        coreService.getRsToObjList(chengJiJiLuList, ChengJiJiLu.class, "select userID,count(userID) as userID from  ChengJiJiLu where trainingOrCompetitionID=" + TrainingOrCompetitionID + " group by userID;");
        coreService.getRsToObjList(chengJiJiLuList, ChengJiJiLu.class, "select xiangmu,userID,count(userID) as userID from  ChengJiJiLu where trainingOrCompetitionID=" + TrainingOrCompetitionID + " group by xiangmu,userID;");

          userList = this.getUserLisAll();
         return SUCCESS;


 public ArrayList getUserLisAll() throws Exception {
           Users user = new Users();
           ArrayList userList = new ArrayList<Users>();
           service.getObjList(userList, user, " oid in (select id from organization)", " id");
           return userList;
       }
    } 
 <%@page contentType="text/html;  charset=UTF-8" import="java.util.*" %>
<%@ page import="com.sysgrrj.core.valueobject.UsersSession" %>
<%@  taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
    <jsp:include page='/res/inc/inc.jsp' flush='true'/>
</head>
<body>
<s:form action="Add" id="form1" theme="simple" >
  <jsp:include page='/res/inc/inc_form_List.jsp' flush='true'/>
    <script type="text/javascript">
        function doAction(action) {
            if ("add" == action) {
                var url = '/Module/ChengJiJiLu/Add.action?iframeId=' +<s:property value="iframeId"/>+'&TrainingOrCompetitionID='+<s:property value="TrainingOrCompetitionID"/>;
                window.parent.openWinEdit(this, '成绩记录', url, 0, 0);

            } else {
                var selectIds = "";
                var arryObj = document.getElementsByName("selId");
                var count = 0;
                for (var i = 0; i < arryObj.length; i++) {
                    if (typeof arryObj[i].type != "undefined" && arryObj[i].type == "checkbox") {
                        if (arryObj[i].checked) {
                            selectIds = selectIds + arryObj[i].value + ",";
                            count = count + 1;
                        }
                    }
                }

                if ("update" == action) {
                    if (count == 0 || 1 < count) {
                        alert('请先选择一条记录');
                        return false;
                    }
                    selectIds = selectIds.substring(0, selectIds.length - 1);
                    var url = '/Module/ChengJiJiLu/Edit.action?id=' + selectIds + '&iframeId=' +<s:property value="iframeId"/>+'&TrainingOrCompetitionID='+<s:property value="TrainingOrCompetitionID"/>;
                    window.parent.openWinEdit(this, '成绩记录', url, 0, 0);

                }
                else if ("del" == action) {
                    if (count == 0) {
                        alert('请先选择一条记录');
                        return false;
                    }

                    if (confirm("是否确认删除?")) {

                        selectIds = selectIds.substring(0, selectIds.length - 1);
                        document.getElementById("ids").value = selectIds;
                        document.getElementById("form1").action = "Delete";
                        document.getElementById("form1").submit();
                        return true;
                    }
                    else {
                        return false;
                    }


                }
            }

        }
     </script>

    <div class="buttonDiv">
         查询日期: <input type="text" name="startTime" size="10" value="<s:property value="startTime"/>" readonly="true" onclick="setday(this)">
           至 <input type="text" name="endTime" size="10" value="<s:property value="endTime"/>"  readonly="true" onclick="setday(this)"> &nbsp;&nbsp;
        用户名称:<s:textfield name="keRenMingCheng" size="8" value="%{keRenMingCheng}"/>&nbsp;&nbsp;
        <s:submit theme="simple" name="List" action="List" value="查询" cssClass="button_style" method="getList"/> &nbsp;&nbsp;
         <input type="button" class="button_style_add" onclick="return doAction('add')"/>
         <input type="button" class="button_style_edit" onclick="return doAction('update')"/>
         <input type="button" class="button_style_del" onclick="return doAction('del')"/>
    </div>
    <div class="validatemsg">
        <s:actionerror/>
        <s:fielderror/>
        <s:actionmessage/>
    </div>
    <%--<%--%>
        <%--UsersSession usersSession = (UsersSession) request.getSession().getAttribute("usersession");--%>
        <%--String userNameInfo = usersSession.getUsersObj().getName();--%>

    <%--%>--%>
    <table width="100%" class="listext" id="table1">
      <tr>
            <TH colspan="7" style="background:  #EBEBEB;height: 35px"> 成绩记录</TH>
        </tr>
    <TR>
       <TH width="10"><s:checkbox id="doAllSele" value="" onclick="selectAll()" name="doAllSele"></s:checkbox></TH>
       <TH width="30"> 序号</TH>
       <TH>用户名称</TH>
       <%--<TH>TrainingOrCompetitionID</TH>--%>
       <TH>时间</TH>
       <TH>项目</TH>
       <TH>状态</TH>
       <TH>备注</TH>
    </TR>
<s:iterator value="chengJiJiLuList" status="st" var="cil">
    <TR>
       <TD><input type="checkbox" name="selId" id="selId" value="<s:property value="id"/>"/></TD>
       <TD  align="center"><s:property value='#st.index+1'/></TD>
       <TD ><s:iterator value="userList" var="ulist">
                                <s:if test="#ulist.id==#cil.userID"><s:property value="#ulist.name"/></s:if>
                            </s:iterator></TD>
       <%--<TD ><s:property value="trainingOrCompetitionID"/></TD>--%>
       <TD  align="center"><s:date name="shiJian" format="yyyy-MM-dd" /></TD>
       <TD ><s:property value="xiangMu"/></TD>
       <TD ><s:property value="zhuangTai"/></TD>
       <TD ><s:property value="beiZhu"/></TD>
    </TR>


</s:iterator>
</TABLE>
    <s:hidden name="TrainingOrCompetitionID"/>
</s:form>
</body>
</html>

2个回答

没看明白你想表达什么

没看明白你要说什么,你最好说清楚点

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问