baidu_29643173 2015-09-10 09:10 采纳率: 0%
浏览 1502

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

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

图片说明

图片说明

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条回答 默认 最新

  • 微甜灬呼吸 2015-09-10 09:11
    关注

    没看明白你想表达什么

    评论

报告相同问题?

悬赏问题

  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题