Commit 5b03edef3946a1756c781adb67699bb5451e1c29
1 parent
8ee66e91
更新协议
Showing
9 changed files
with
1430 additions
and
0 deletions
WebRoot/WEB-INF/jsp/sunvote/student/student_edit.jsp
0 → 100644
| 1 | +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> | ||
| 2 | +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> | ||
| 3 | +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> | ||
| 4 | +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> | ||
| 5 | +<% | ||
| 6 | + String path = request.getContextPath(); | ||
| 7 | + String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; | ||
| 8 | +%> | ||
| 9 | +<!DOCTYPE html> | ||
| 10 | +<html lang="en"> | ||
| 11 | + <head> | ||
| 12 | + <base href="<%=basePath%>"> | ||
| 13 | + <!-- 下拉框 --> | ||
| 14 | + <link rel="stylesheet" href="static/ace/css/chosen.css" /> | ||
| 15 | + <!-- jsp文件头和头部 --> | ||
| 16 | + <%@ include file="../../system/index/top.jsp"%> | ||
| 17 | + <!-- 日期框 --> | ||
| 18 | + <link rel="stylesheet" href="static/ace/css/datepicker.css" /> | ||
| 19 | +</head> | ||
| 20 | +<body class="no-skin"> | ||
| 21 | +<!-- /section:basics/navbar.layout --> | ||
| 22 | +<div class="main-container" id="main-container"> | ||
| 23 | + <!-- /section:basics/sidebar --> | ||
| 24 | + <div class="main-content"> | ||
| 25 | + <div class="main-content-inner"> | ||
| 26 | + <div class="page-content"> | ||
| 27 | + <div class="row"> | ||
| 28 | + <div class="col-xs-12"> | ||
| 29 | + | ||
| 30 | + <form action="student/${msg }.do" name="Form" id="Form" method="post"> | ||
| 31 | + <input type="hidden" name="ID" id="ID" value="${pd.ID}"/> | ||
| 32 | + <div id="zhongxin" style="padding-top: 13px;"> | ||
| 33 | + <table id="table_report" class="table table-striped table-bordered table-hover"> | ||
| 34 | + <tr> | ||
| 35 | + <td style="width:75px;text-align: right;padding-top: 13px;">学生姓名:</td> | ||
| 36 | + <td><input type="text" name="NAME" id="NAME" value="${pd.NAME}" maxlength="255" placeholder="这里输入学生姓名" title="学生姓名" style="width:98%;"/></td> | ||
| 37 | + </tr> | ||
| 38 | + <tr> | ||
| 39 | + <td style="width:75px;text-align: right;padding-top: 13px;">学籍号:</td> | ||
| 40 | + <td><input type="text" name="SNO" id="SNO" value="${pd.SNO}" maxlength="255" placeholder="这里输入学籍号" title="学籍号" style="width:98%;"/></td> | ||
| 41 | + </tr> | ||
| 42 | + <tr> | ||
| 43 | + <td style="width:75px;text-align: right;padding-top: 13px;">学号:</td> | ||
| 44 | + <td><input type="text" name="NUMBER" id="NUMBER" value="${pd.NUMBER}" maxlength="255" placeholder="这里输入学号" title="学号" style="width:98%;"/></td> | ||
| 45 | + </tr> | ||
| 46 | + <tr> | ||
| 47 | + <td style="width:75px;text-align: right;padding-top: 13px;">性别:</td> | ||
| 48 | + <td> | ||
| 49 | + <%-- <input type="number" name="SEX" id="SEX" value="${pd.SEX}" maxlength="32" placeholder="这里输入性别" title="性别" style="width:98%;"/></td> --%> | ||
| 50 | + <select class="chosen-select form-control" name="SEX" id="SEX" data-placeholder="这里输入班级类型"> | ||
| 51 | + <option value="1" <c:if test="${pd.SEX==1}">selected="true"</c:if>>男</option> | ||
| 52 | + <option value="0" <c:if test="${pd.SEX==0}">selected="true"</c:if>>女</option> | ||
| 53 | + </select> | ||
| 54 | + </td> | ||
| 55 | + </tr> | ||
| 56 | + <tr> | ||
| 57 | + <td style="width:75px;text-align: right;padding-top: 13px;">组号:</td> | ||
| 58 | + <td><input type="text" name="GROUPID" id="GROUPID" value="${pd.GROUPID}" maxlength="255" placeholder="这里输入组号" title="组号" style="width:98%;"/></td> | ||
| 59 | + </tr> | ||
| 60 | + <tr> | ||
| 61 | + <td style="width:75px;text-align: right;padding-top: 13px;">签到码:</td> | ||
| 62 | + <td><input type="text" name="SIGN_NO" id="SIGN_NO" value="${pd.SIGN_NO}" maxlength="255" placeholder="这里输入签到码" title="签到码" style="width:98%;"/></td> | ||
| 63 | + </tr> | ||
| 64 | + <tr> | ||
| 65 | + <td style="width:75px;text-align: right;padding-top: 13px;">家长姓名:</td> | ||
| 66 | + <td><input type="text" name="PARENT_NAME" id="PARENT_NAME" value="${pd.PARENT_NAME}" maxlength="255" placeholder="这里输入家长姓名" title="家长姓名" style="width:98%;"/></td> | ||
| 67 | + </tr> | ||
| 68 | + <tr> | ||
| 69 | + <td style="width:75px;text-align: right;padding-top: 13px;">家长手机号:</td> | ||
| 70 | + <td><input type="text" name="PARENT_PHONE" id="PARENT_PHONE" value="${pd.PARENT_PHONE}" maxlength="255" placeholder="这里输入家长手机号" title="家长手机号" style="width:98%;"/></td> | ||
| 71 | + </tr> | ||
| 72 | + <tr> | ||
| 73 | + <td style="width:75px;text-align: right;padding-top: 13px;">键盘ID:</td> | ||
| 74 | + <td><input type="text" name="KEYPAD_ID" id="KEYPAD_ID" value="${pd.KEYPAD_ID}" maxlength="255" placeholder="这里输入键盘ID" title="键盘ID" style="width:98%;"/></td> | ||
| 75 | + </tr> | ||
| 76 | + <tr> | ||
| 77 | + <td style="width:75px;text-align: right;padding-top: 13px;">备注:</td> | ||
| 78 | + <td><input type="text" name="REMARK" id="REMARK" value="${pd.REMARK}" maxlength="255" placeholder="这里输入备注" title="备注" style="width:98%;"/></td> | ||
| 79 | + </tr> | ||
| 80 | + <tr> | ||
| 81 | + <td style="text-align: center;" colspan="10"> | ||
| 82 | + <a class="btn btn-mini btn-primary" onclick="save();">保存</a> | ||
| 83 | + <a class="btn btn-mini btn-danger" onclick="top.Dialog.close();">取消</a> | ||
| 84 | + </td> | ||
| 85 | + </tr> | ||
| 86 | + </table> | ||
| 87 | + </div> | ||
| 88 | + <div id="zhongxin2" class="center" style="display:none"><br/><br/><br/><br/><br/><img src="static/images/jiazai.gif" /><br/><h4 class="lighter block green">提交中...</h4></div> | ||
| 89 | + </form> | ||
| 90 | + </div> | ||
| 91 | + <!-- /.col --> | ||
| 92 | + </div> | ||
| 93 | + <!-- /.row --> | ||
| 94 | + </div> | ||
| 95 | + <!-- /.page-content --> | ||
| 96 | + </div> | ||
| 97 | + </div> | ||
| 98 | + <!-- /.main-content --> | ||
| 99 | +</div> | ||
| 100 | +<!-- /.main-container --> | ||
| 101 | + | ||
| 102 | + | ||
| 103 | + <!-- 页面底部js¨ --> | ||
| 104 | + <%@ include file="../../system/index/foot.jsp"%> | ||
| 105 | + <!-- 下拉框 --> | ||
| 106 | + <script src="static/ace/js/chosen.jquery.js"></script> | ||
| 107 | + <!-- 日期框 --> | ||
| 108 | + <script src="static/ace/js/date-time/bootstrap-datepicker.js"></script> | ||
| 109 | + <!--提示框--> | ||
| 110 | + <script type="text/javascript" src="static/js/jquery.tips.js"></script> | ||
| 111 | + <script type="text/javascript"> | ||
| 112 | + $(top.hangge()); | ||
| 113 | + //保存 | ||
| 114 | + function save(){ | ||
| 115 | + if($("#NAME").val()==""){ | ||
| 116 | + $("#NAME").tips({ | ||
| 117 | + side:3, | ||
| 118 | + msg:'请输入学生姓名', | ||
| 119 | + bg:'#AE81FF', | ||
| 120 | + time:2 | ||
| 121 | + }); | ||
| 122 | + $("#NAME").focus(); | ||
| 123 | + return false; | ||
| 124 | + } | ||
| 125 | + if($("#SNO").val()==""){ | ||
| 126 | + $("#SNO").tips({ | ||
| 127 | + side:3, | ||
| 128 | + msg:'请输入学籍号', | ||
| 129 | + bg:'#AE81FF', | ||
| 130 | + time:2 | ||
| 131 | + }); | ||
| 132 | + $("#SNO").focus(); | ||
| 133 | + return false; | ||
| 134 | + } | ||
| 135 | + if($("#NUMBER").val()==""){ | ||
| 136 | + $("#NUMBER").tips({ | ||
| 137 | + side:3, | ||
| 138 | + msg:'请输入学号', | ||
| 139 | + bg:'#AE81FF', | ||
| 140 | + time:2 | ||
| 141 | + }); | ||
| 142 | + $("#NUMBER").focus(); | ||
| 143 | + return false; | ||
| 144 | + } | ||
| 145 | + if($("#SEX").val()==""){ | ||
| 146 | + $("#SEX").tips({ | ||
| 147 | + side:3, | ||
| 148 | + msg:'请输入性别', | ||
| 149 | + bg:'#AE81FF', | ||
| 150 | + time:2 | ||
| 151 | + }); | ||
| 152 | + $("#SEX").focus(); | ||
| 153 | + return false; | ||
| 154 | + } | ||
| 155 | + if($("#GROUPID").val()==""){ | ||
| 156 | + $("#GROUPID").tips({ | ||
| 157 | + side:3, | ||
| 158 | + msg:'请输入组号', | ||
| 159 | + bg:'#AE81FF', | ||
| 160 | + time:2 | ||
| 161 | + }); | ||
| 162 | + $("#GROUPID").focus(); | ||
| 163 | + return false; | ||
| 164 | + } | ||
| 165 | + if($("#SIGN_NO").val()==""){ | ||
| 166 | + $("#SIGN_NO").tips({ | ||
| 167 | + side:3, | ||
| 168 | + msg:'请输入签到码', | ||
| 169 | + bg:'#AE81FF', | ||
| 170 | + time:2 | ||
| 171 | + }); | ||
| 172 | + $("#SIGN_NO").focus(); | ||
| 173 | + return false; | ||
| 174 | + } | ||
| 175 | + if($("#PARENT_NAME").val()==""){ | ||
| 176 | + $("#PARENT_NAME").tips({ | ||
| 177 | + side:3, | ||
| 178 | + msg:'请输入家长姓名', | ||
| 179 | + bg:'#AE81FF', | ||
| 180 | + time:2 | ||
| 181 | + }); | ||
| 182 | + $("#PARENT_NAME").focus(); | ||
| 183 | + return false; | ||
| 184 | + } | ||
| 185 | + if($("#PARENT_PHONE").val()==""){ | ||
| 186 | + $("#PARENT_PHONE").tips({ | ||
| 187 | + side:3, | ||
| 188 | + msg:'请输入家长手机号', | ||
| 189 | + bg:'#AE81FF', | ||
| 190 | + time:2 | ||
| 191 | + }); | ||
| 192 | + $("#PARENT_PHONE").focus(); | ||
| 193 | + return false; | ||
| 194 | + } | ||
| 195 | + if($("#KEYPAD_ID").val()==""){ | ||
| 196 | + $("#KEYPAD_ID").tips({ | ||
| 197 | + side:3, | ||
| 198 | + msg:'请输入键盘ID', | ||
| 199 | + bg:'#AE81FF', | ||
| 200 | + time:2 | ||
| 201 | + }); | ||
| 202 | + $("#KEYPAD_ID").focus(); | ||
| 203 | + return false; | ||
| 204 | + } | ||
| 205 | + if($("#REMARK").val()==""){ | ||
| 206 | + $("#REMARK").tips({ | ||
| 207 | + side:3, | ||
| 208 | + msg:'请输入备注', | ||
| 209 | + bg:'#AE81FF', | ||
| 210 | + time:2 | ||
| 211 | + }); | ||
| 212 | + $("#REMARK").focus(); | ||
| 213 | + return false; | ||
| 214 | + } | ||
| 215 | + $("#Form").submit(); | ||
| 216 | + $("#zhongxin").hide(); | ||
| 217 | + $("#zhongxin2").show(); | ||
| 218 | + } | ||
| 219 | + | ||
| 220 | + $(function() { | ||
| 221 | + //日期框 | ||
| 222 | + $('.date-picker').datepicker({autoclose: true,todayHighlight: true}); | ||
| 223 | + }); | ||
| 224 | + </script> | ||
| 225 | +</body> | ||
| 226 | +</html> | ||
| 0 | \ No newline at end of file | 227 | \ No newline at end of file |
WebRoot/WEB-INF/jsp/sunvote/student/student_list.jsp
0 → 100644
| 1 | +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> | ||
| 2 | +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> | ||
| 3 | +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> | ||
| 4 | +<% | ||
| 5 | + String path = request.getContextPath(); | ||
| 6 | + String basePath = request.getScheme() + "://" | ||
| 7 | + + request.getServerName() + ":" + request.getServerPort() | ||
| 8 | + + path + "/"; | ||
| 9 | +%> | ||
| 10 | +<!DOCTYPE html> | ||
| 11 | +<html lang="en"> | ||
| 12 | +<head> | ||
| 13 | +<base href="<%=basePath%>"> | ||
| 14 | +<!-- 下拉框 --> | ||
| 15 | +<link rel="stylesheet" href="static/ace/css/chosen.css" /> | ||
| 16 | +<!-- jsp文件头和头部 --> | ||
| 17 | +<%@ include file="../../system/index/top.jsp"%> | ||
| 18 | +<!-- 日期框 --> | ||
| 19 | +<link rel="stylesheet" href="static/ace/css/datepicker.css" /> | ||
| 20 | +</head> | ||
| 21 | +<body class="no-skin"> | ||
| 22 | + | ||
| 23 | + <!-- /section:basics/navbar.layout --> | ||
| 24 | + <div class="main-container" id="main-container"> | ||
| 25 | + <!-- /section:basics/sidebar --> | ||
| 26 | + <div class="main-content"> | ||
| 27 | + <div class="main-content-inner"> | ||
| 28 | + <div class="page-content"> | ||
| 29 | + <div class="row"> | ||
| 30 | + <div class="col-xs-12"> | ||
| 31 | + | ||
| 32 | + <!-- 检索 --> | ||
| 33 | + <form action="student/list.do" method="post" name="Form" id="Form"> | ||
| 34 | + <table style="margin-top:5px;"> | ||
| 35 | + <tr> | ||
| 36 | + <td> | ||
| 37 | + <div class="nav-search"> | ||
| 38 | + <span class="input-icon"> | ||
| 39 | + <input type="text" placeholder="这里输入关键词" class="nav-search-input" id="nav-search-input" autocomplete="off" name="keywords" value="${pd.keywords }" placeholder="这里输入关键词"/> | ||
| 40 | + <i class="ace-icon fa fa-search nav-search-icon"></i> | ||
| 41 | + </span> | ||
| 42 | + </div> | ||
| 43 | + </td> | ||
| 44 | + <td style="padding-left:2px;"><input class="span10 date-picker" name="lastStart" id="lastStart" value="" type="text" data-date-format="yyyy-mm-dd" readonly="readonly" style="width:88px;" placeholder="开始日期" title="开始日期"/></td> | ||
| 45 | + <td style="padding-left:2px;"><input class="span10 date-picker" name="lastEnd" name="lastEnd" value="" type="text" data-date-format="yyyy-mm-dd" readonly="readonly" style="width:88px;" placeholder="结束日期" title="结束日期"/></td> | ||
| 46 | + <td style="vertical-align:top;padding-left:2px;"> | ||
| 47 | + <select class="chosen-select form-control" name="name" id="id" data-placeholder="请选择" style="vertical-align:top;width: 120px;"> | ||
| 48 | + <option value=""></option> | ||
| 49 | + <option value="">全部</option> | ||
| 50 | + <option value="">1</option> | ||
| 51 | + <option value="">2</option> | ||
| 52 | + </select> | ||
| 53 | + </td> | ||
| 54 | + <c:if test="${QX.cha == 1 }"> | ||
| 55 | + <td style="vertical-align:top;padding-left:2px"><a class="btn btn-light btn-xs" onclick="tosearch();" title="检索"><i id="nav-search-icon" class="ace-icon fa fa-search bigger-110 nav-search-icon blue"></i></a></td> | ||
| 56 | + </c:if> | ||
| 57 | + <c:if test="${QX.toExcel == 1 }"><td style="vertical-align:top;padding-left:2px;"><a class="btn btn-light btn-xs" onclick="toExcel();" title="导出到EXCEL"><i id="nav-search-icon" class="ace-icon fa fa-download bigger-110 nav-search-icon blue"></i></a></td></c:if> | ||
| 58 | + </tr> | ||
| 59 | + </table> | ||
| 60 | + <!-- 检索 --> | ||
| 61 | + | ||
| 62 | + <table id="simple-table" class="table table-striped table-bordered table-hover" style="margin-top:5px;"> | ||
| 63 | + <thead> | ||
| 64 | + <tr> | ||
| 65 | + <th class="center" style="width:35px;"> | ||
| 66 | + <label class="pos-rel"><input type="checkbox" class="ace" id="zcheckbox" /><span class="lbl"></span></label> | ||
| 67 | + </th> | ||
| 68 | + <th class="center" style="width:50px;">序号</th> | ||
| 69 | + <th class="center">学生姓名</th> | ||
| 70 | + <th class="center">学籍号</th> | ||
| 71 | + <th class="center">学号</th> | ||
| 72 | + <th class="center">性别</th> | ||
| 73 | + <th class="center">组号</th> | ||
| 74 | + <th class="center">签到码</th> | ||
| 75 | + <th class="center">家长姓名</th> | ||
| 76 | + <th class="center">家长手机号</th> | ||
| 77 | + <th class="center">键盘ID</th> | ||
| 78 | + <th class="center">备注</th> | ||
| 79 | + <th class="center">操作</th> | ||
| 80 | + </tr> | ||
| 81 | + </thead> | ||
| 82 | + | ||
| 83 | + <tbody> | ||
| 84 | + <!-- 开始循环 --> | ||
| 85 | + <c:choose> | ||
| 86 | + <c:when test="${not empty varList}"> | ||
| 87 | + <c:if test="${QX.cha == 1 }"> | ||
| 88 | + <c:forEach items="${varList}" var="var" varStatus="vs"> | ||
| 89 | + <tr> | ||
| 90 | + <td class='center'> | ||
| 91 | + <label class="pos-rel"><input type='checkbox' name='ids' value="${var.ID}" class="ace" /><span class="lbl"></span></label> | ||
| 92 | + </td> | ||
| 93 | + <td class='center' style="width: 30px;">${vs.index+1}</td> | ||
| 94 | + <td class='center'>${var.NAME}</td> | ||
| 95 | + <td class='center'>${var.SNO}</td> | ||
| 96 | + <td class='center'>${var.NUMBER}</td> | ||
| 97 | + <td class='center'>${var.SEX == 1 ? "男":"女"}</td> | ||
| 98 | + <td class='center'>${var.GROUPID}</td> | ||
| 99 | + <td class='center'>${var.SIGN_NO}</td> | ||
| 100 | + <td class='center'>${var.PARENT_NAME}</td> | ||
| 101 | + <td class='center'>${var.PARENT_PHONE}</td> | ||
| 102 | + <td class='center'>${var.KEYPAD_ID}</td> | ||
| 103 | + <td class='center'>${var.REMARK}</td> | ||
| 104 | + <td class="center"> | ||
| 105 | + <c:if test="${QX.edit != 1 && QX.del != 1 }"> | ||
| 106 | + <span class="label label-large label-grey arrowed-in-right arrowed-in"><i class="ace-icon fa fa-lock" title="无权限"></i></span> | ||
| 107 | + </c:if> | ||
| 108 | + <div class="hidden-sm hidden-xs btn-group"> | ||
| 109 | + <c:if test="${QX.edit == 1 }"> | ||
| 110 | + <a class="btn btn-xs btn-success" title="编辑" onclick="edit('${var.ID}');"> | ||
| 111 | + <i class="ace-icon fa fa-pencil-square-o bigger-120" title="编辑"></i> | ||
| 112 | + </a> | ||
| 113 | + </c:if> | ||
| 114 | + <c:if test="${QX.del == 1 }"> | ||
| 115 | + <a class="btn btn-xs btn-danger" onclick="del('${var.ID}');"> | ||
| 116 | + <i class="ace-icon fa fa-trash-o bigger-120" title="删除"></i> | ||
| 117 | + </a> | ||
| 118 | + </c:if> | ||
| 119 | + </div> | ||
| 120 | + <div class="hidden-md hidden-lg"> | ||
| 121 | + <div class="inline pos-rel"> | ||
| 122 | + <button class="btn btn-minier btn-primary dropdown-toggle" data-toggle="dropdown" data-position="auto"> | ||
| 123 | + <i class="ace-icon fa fa-cog icon-only bigger-110"></i> | ||
| 124 | + </button> | ||
| 125 | + | ||
| 126 | + <ul class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close"> | ||
| 127 | + <c:if test="${QX.edit == 1 }"> | ||
| 128 | + <li> | ||
| 129 | + <a style="cursor:pointer;" onclick="edit('${var.ID}');" class="tooltip-success" data-rel="tooltip" title="修改"> | ||
| 130 | + <span class="green"> | ||
| 131 | + <i class="ace-icon fa fa-pencil-square-o bigger-120"></i> | ||
| 132 | + </span> | ||
| 133 | + </a> | ||
| 134 | + </li> | ||
| 135 | + </c:if> | ||
| 136 | + <c:if test="${QX.del == 1 }"> | ||
| 137 | + <li> | ||
| 138 | + <a style="cursor:pointer;" onclick="del('${var.ID}');" class="tooltip-error" data-rel="tooltip" title="删除"> | ||
| 139 | + <span class="red"> | ||
| 140 | + <i class="ace-icon fa fa-trash-o bigger-120"></i> | ||
| 141 | + </span> | ||
| 142 | + </a> | ||
| 143 | + </li> | ||
| 144 | + </c:if> | ||
| 145 | + </ul> | ||
| 146 | + </div> | ||
| 147 | + </div> | ||
| 148 | + </td> | ||
| 149 | + </tr> | ||
| 150 | + | ||
| 151 | + </c:forEach> | ||
| 152 | + </c:if> | ||
| 153 | + <c:if test="${QX.cha == 0 }"> | ||
| 154 | + <tr> | ||
| 155 | + <td colspan="100" class="center">您无权查看</td> | ||
| 156 | + </tr> | ||
| 157 | + </c:if> | ||
| 158 | + </c:when> | ||
| 159 | + <c:otherwise> | ||
| 160 | + <tr class="main_info"> | ||
| 161 | + <td colspan="100" class="center" >没有相关数据</td> | ||
| 162 | + </tr> | ||
| 163 | + </c:otherwise> | ||
| 164 | + </c:choose> | ||
| 165 | + </tbody> | ||
| 166 | + </table> | ||
| 167 | + <div class="page-header position-relative"> | ||
| 168 | + <table style="width:100%;"> | ||
| 169 | + <tr> | ||
| 170 | + <td style="vertical-align:top;"> | ||
| 171 | + <c:if test="${QX.add == 1 }"> | ||
| 172 | + <a class="btn btn-mini btn-success" onclick="add();">新增</a> | ||
| 173 | + </c:if> | ||
| 174 | + <c:if test="${QX.del == 1 }"> | ||
| 175 | + <a class="btn btn-mini btn-danger" onclick="makeAll('确定要删除选中的数据吗?');" title="批量删除" ><i class='ace-icon fa fa-trash-o bigger-120'></i></a> | ||
| 176 | + </c:if> | ||
| 177 | + </td> | ||
| 178 | + <td style="vertical-align:top;"><div class="pagination" style="float: right;padding-top: 0px;margin-top: 0px;">${page.pageStr}</div></td> | ||
| 179 | + </tr> | ||
| 180 | + </table> | ||
| 181 | + </div> | ||
| 182 | + </form> | ||
| 183 | + | ||
| 184 | + </div> | ||
| 185 | + <!-- /.col --> | ||
| 186 | + </div> | ||
| 187 | + <!-- /.row --> | ||
| 188 | + </div> | ||
| 189 | + <!-- /.page-content --> | ||
| 190 | + </div> | ||
| 191 | + </div> | ||
| 192 | + <!-- /.main-content --> | ||
| 193 | + | ||
| 194 | + <!-- 返回顶部 --> | ||
| 195 | + <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse"> | ||
| 196 | + <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i> | ||
| 197 | + </a> | ||
| 198 | + | ||
| 199 | + </div> | ||
| 200 | + <!-- /.main-container --> | ||
| 201 | + | ||
| 202 | + <!-- basic scripts --> | ||
| 203 | + <!-- 页面底部js¨ --> | ||
| 204 | + <%@ include file="../../system/index/foot.jsp"%> | ||
| 205 | + <!-- 删除时确认窗口 --> | ||
| 206 | + <script src="static/ace/js/bootbox.js"></script> | ||
| 207 | + <!-- ace scripts --> | ||
| 208 | + <script src="static/ace/js/ace/ace.js"></script> | ||
| 209 | + <!-- 下拉框 --> | ||
| 210 | + <script src="static/ace/js/chosen.jquery.js"></script> | ||
| 211 | + <!-- 日期框 --> | ||
| 212 | + <script src="static/ace/js/date-time/bootstrap-datepicker.js"></script> | ||
| 213 | + <!--提示框--> | ||
| 214 | + <script type="text/javascript" src="static/js/jquery.tips.js"></script> | ||
| 215 | + <script type="text/javascript"> | ||
| 216 | + $(top.hangge());//关闭加载状态 | ||
| 217 | + //检索 | ||
| 218 | + function tosearch(){ | ||
| 219 | + top.jzts(); | ||
| 220 | + $("#Form").submit(); | ||
| 221 | + } | ||
| 222 | + $(function() { | ||
| 223 | + | ||
| 224 | + //日期框 | ||
| 225 | + $('.date-picker').datepicker({ | ||
| 226 | + autoclose: true, | ||
| 227 | + todayHighlight: true | ||
| 228 | + }); | ||
| 229 | + | ||
| 230 | + //下拉框 | ||
| 231 | + if(!ace.vars['touch']) { | ||
| 232 | + $('.chosen-select').chosen({allow_single_deselect:true}); | ||
| 233 | + $(window) | ||
| 234 | + .off('resize.chosen') | ||
| 235 | + .on('resize.chosen', function() { | ||
| 236 | + $('.chosen-select').each(function() { | ||
| 237 | + var $this = $(this); | ||
| 238 | + $this.next().css({'width': $this.parent().width()}); | ||
| 239 | + }); | ||
| 240 | + }).trigger('resize.chosen'); | ||
| 241 | + $(document).on('settings.ace.chosen', function(e, event_name, event_val) { | ||
| 242 | + if(event_name != 'sidebar_collapsed') return; | ||
| 243 | + $('.chosen-select').each(function() { | ||
| 244 | + var $this = $(this); | ||
| 245 | + $this.next().css({'width': $this.parent().width()}); | ||
| 246 | + }); | ||
| 247 | + }); | ||
| 248 | + $('#chosen-multiple-style .btn').on('click', function(e){ | ||
| 249 | + var target = $(this).find('input[type=radio]'); | ||
| 250 | + var which = parseInt(target.val()); | ||
| 251 | + if(which == 2) $('#form-field-select-4').addClass('tag-input-style'); | ||
| 252 | + else $('#form-field-select-4').removeClass('tag-input-style'); | ||
| 253 | + }); | ||
| 254 | + } | ||
| 255 | + | ||
| 256 | + | ||
| 257 | + //复选框全选控制 | ||
| 258 | + var active_class = 'active'; | ||
| 259 | + $('#simple-table > thead > tr > th input[type=checkbox]').eq(0).on('click', function(){ | ||
| 260 | + var th_checked = this.checked;//checkbox inside "TH" table header | ||
| 261 | + $(this).closest('table').find('tbody > tr').each(function(){ | ||
| 262 | + var row = this; | ||
| 263 | + if(th_checked) $(row).addClass(active_class).find('input[type=checkbox]').eq(0).prop('checked', true); | ||
| 264 | + else $(row).removeClass(active_class).find('input[type=checkbox]').eq(0).prop('checked', false); | ||
| 265 | + }); | ||
| 266 | + }); | ||
| 267 | + }); | ||
| 268 | + | ||
| 269 | + //新增 | ||
| 270 | + function add(){ | ||
| 271 | + top.jzts(); | ||
| 272 | + var diag = new top.Dialog(); | ||
| 273 | + diag.Drag=true; | ||
| 274 | + diag.Title ="新增"; | ||
| 275 | + diag.URL = '<%=basePath%>student/goAdd.do'; | ||
| 276 | + diag.Width = 450; | ||
| 277 | + diag.Height = 355; | ||
| 278 | + diag.Modal = true; //有无遮罩窗口 | ||
| 279 | + diag. ShowMaxButton = true; //最大化按钮 | ||
| 280 | + diag.ShowMinButton = true; //最小化按钮 | ||
| 281 | + diag.CancelEvent = function(){ //关闭事件 | ||
| 282 | + if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){ | ||
| 283 | + if('${page.currentPage}' == '0'){ | ||
| 284 | + tosearch(); | ||
| 285 | + }else{ | ||
| 286 | + tosearch(); | ||
| 287 | + } | ||
| 288 | + } | ||
| 289 | + diag.close(); | ||
| 290 | + }; | ||
| 291 | + diag.show(); | ||
| 292 | + } | ||
| 293 | + | ||
| 294 | + //删除 | ||
| 295 | + function del(Id){ | ||
| 296 | + bootbox.confirm("确定要删除吗?", function(result) { | ||
| 297 | + if(result) { | ||
| 298 | + top.jzts(); | ||
| 299 | + var url = "<%=basePath%>student/delete.do?ID="+Id+"&tm="+new Date().getTime(); | ||
| 300 | + $.get(url,function(data){ | ||
| 301 | + tosearch(); | ||
| 302 | + }); | ||
| 303 | + } | ||
| 304 | + }); | ||
| 305 | + } | ||
| 306 | + | ||
| 307 | + //修改 | ||
| 308 | + function edit(Id){ | ||
| 309 | + top.jzts(); | ||
| 310 | + var diag = new top.Dialog(); | ||
| 311 | + diag.Drag=true; | ||
| 312 | + diag.Title ="编辑"; | ||
| 313 | + diag.URL = '<%=basePath%>student/goEdit.do?ID='+Id; | ||
| 314 | + diag.Width = 450; | ||
| 315 | + diag.Height = 355; | ||
| 316 | + diag.Modal = true; //有无遮罩窗口 | ||
| 317 | + diag. ShowMaxButton = true; //最大化按钮 | ||
| 318 | + diag.ShowMinButton = true; //最小化按钮 | ||
| 319 | + diag.CancelEvent = function(){ //关闭事件 | ||
| 320 | + if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){ | ||
| 321 | + tosearch(); | ||
| 322 | + } | ||
| 323 | + diag.close(); | ||
| 324 | + }; | ||
| 325 | + diag.show(); | ||
| 326 | + } | ||
| 327 | + | ||
| 328 | + //批量操作 | ||
| 329 | + function makeAll(msg){ | ||
| 330 | + bootbox.confirm(msg, function(result) { | ||
| 331 | + if(result) { | ||
| 332 | + var str = ''; | ||
| 333 | + for(var i=0;i < document.getElementsByName('ids').length;i++){ | ||
| 334 | + if(document.getElementsByName('ids')[i].checked){ | ||
| 335 | + if(str=='') str += document.getElementsByName('ids')[i].value; | ||
| 336 | + else str += ',' + document.getElementsByName('ids')[i].value; | ||
| 337 | + } | ||
| 338 | + } | ||
| 339 | + if(str==''){ | ||
| 340 | + bootbox.dialog({ | ||
| 341 | + message: "<span class='bigger-110'>您没有选择任何内容!</span>", | ||
| 342 | + buttons: | ||
| 343 | + { "button":{ "label":"确定", "className":"btn-sm btn-success"}} | ||
| 344 | + }); | ||
| 345 | + $("#zcheckbox").tips({ | ||
| 346 | + side:1, | ||
| 347 | + msg:'点这里全选', | ||
| 348 | + bg:'#AE81FF', | ||
| 349 | + time:8 | ||
| 350 | + }); | ||
| 351 | + return; | ||
| 352 | + }else{ | ||
| 353 | + if(msg == '确定要删除选中的数据吗?'){ | ||
| 354 | + top.jzts(); | ||
| 355 | + $.ajax({ | ||
| 356 | + type: "POST", | ||
| 357 | + url: '<%=basePath%>student/deleteAll.do?tm='+new Date().getTime(), | ||
| 358 | + data: {DATA_IDS:str}, | ||
| 359 | + dataType:'json', | ||
| 360 | + //beforeSend: validateData, | ||
| 361 | + cache: false, | ||
| 362 | + success: function(data){ | ||
| 363 | + $.each(data.list, function(i, list){ | ||
| 364 | + tosearch(); | ||
| 365 | + }); | ||
| 366 | + } | ||
| 367 | + }); | ||
| 368 | + } | ||
| 369 | + } | ||
| 370 | + } | ||
| 371 | + }); | ||
| 372 | + }; | ||
| 373 | + | ||
| 374 | + //导出excel | ||
| 375 | + function toExcel(){ | ||
| 376 | + window.location.href='<%=basePath%>student/excel.do'; | ||
| 377 | + } | ||
| 378 | + </script> | ||
| 379 | + | ||
| 380 | + | ||
| 381 | +</body> | ||
| 382 | +</html> | ||
| 0 | \ No newline at end of file | 383 | \ No newline at end of file |
WebRoot/WEB-INF/tld/elfun.tld
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<taglib xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| 3 | + xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" | ||
| 4 | + version="2.0"> | ||
| 5 | + | ||
| 6 | + <tlib-version>1.0</tlib-version> | ||
| 7 | + <short-name>myelfun</short-name><!-- 定义标签使用的短名称 --> | ||
| 8 | + | ||
| 9 | + <!-- 自定义标签的形参都是域里面传递的参数值;自定义标签基本使用在jsp页面上 --> | ||
| 10 | + <function> | ||
| 11 | + <description>根据ID 获取学校名称</description><!-- 对该标签的说明 --> | ||
| 12 | + <name>findSchoolName</name><!-- 定义标签名,放在短标签之后 --> | ||
| 13 | + <function-class>com.fh.controller.sunvote.Myelfun</function-class><!-- 标签处理域值的类路径 --> | ||
| 14 | + <function-signature>java.lang.String findSchoolName(int)</function-signature><!-- 标签处理域值的具体的类方法 --> | ||
| 15 | + <example>${myelfun:findSchoolName(obj1)}</example><!-- 自定义标签的使用示范 ,域参数会自动传递到具体的方法里面--> | ||
| 16 | + </function> | ||
| 17 | + | ||
| 18 | + <!-- 自定义标签的形参都是域里面传递的参数值;自定义标签基本使用在jsp页面上 --> | ||
| 19 | + <function> | ||
| 20 | + <description>根据ID获取年级名称</description><!-- 对该标签的说明 --> | ||
| 21 | + <name>findGradeName</name><!-- 定义标签名,放在短标签之后 --> | ||
| 22 | + <function-class>com.fh.controller.sunvote.Myelfun</function-class><!-- 标签处理域值的类路径 --> | ||
| 23 | + <function-signature>java.lang.String findGradeName(int)</function-signature><!-- 标签处理域值的具体的类方法 --> | ||
| 24 | + <example>${myelfun:findGradeName(obj1)}</example><!-- 自定义标签的使用示范 ,域参数会自动传递到具体的方法里面--> | ||
| 25 | + </function> | ||
| 26 | + | ||
| 27 | + <function> | ||
| 28 | + <description>根据ID获取班级类型名称</description><!-- 对该标签的说明 --> | ||
| 29 | + <name>findClassTypeName</name><!-- 定义标签名,放在短标签之后 --> | ||
| 30 | + <function-class>com.fh.controller.sunvote.Myelfun</function-class><!-- 标签处理域值的类路径 --> | ||
| 31 | + <function-signature>java.lang.String findClassTypeName(int)</function-signature><!-- 标签处理域值的具体的类方法 --> | ||
| 32 | + <example>${myelfun:findClassTypeName(obj1)}</example><!-- 自定义标签的使用示范 ,域参数会自动传递到具体的方法里面--> | ||
| 33 | + </function> | ||
| 34 | + | ||
| 35 | + <function> | ||
| 36 | + <description>获取科目英文名称</description><!-- 对该标签的说明 --> | ||
| 37 | + <name>findSubjectEName</name><!-- 定义标签名,放在短标签之后 --> | ||
| 38 | + <function-class>com.fh.controller.sunvote.Myelfun</function-class><!-- 标签处理域值的类路径 --> | ||
| 39 | + <function-signature>java.lang.String findSubjectEName(int)</function-signature><!-- 标签处理域值的具体的类方法 --> | ||
| 40 | + <example>${myelfun:findSubjectEName(obj1)}</example><!-- 自定义标签的使用示范 ,域参数会自动传递到具体的方法里面--> | ||
| 41 | + </function> | ||
| 42 | + | ||
| 43 | + <function> | ||
| 44 | + <description>根据ID获取科目中文名称</description><!-- 对该标签的说明 --> | ||
| 45 | + <name>findSubjectCName</name><!-- 定义标签名,放在短标签之后 --> | ||
| 46 | + <function-class>com.fh.controller.sunvote.Myelfun</function-class><!-- 标签处理域值的类路径 --> | ||
| 47 | + <function-signature>java.lang.String findSubjectCName(int)</function-signature><!-- 标签处理域值的具体的类方法 --> | ||
| 48 | + <example>${myelfun:findSubjectCName(obj1)}</example><!-- 自定义标签的使用示范 ,域参数会自动传递到具体的方法里面--> | ||
| 49 | + </function> | ||
| 50 | + | ||
| 51 | + <function> | ||
| 52 | + <description>根据ID查找基站名称</description><!-- 对该标签的说明 --> | ||
| 53 | + <name>findBasestationName</name><!-- 定义标签名,放在短标签之后 --> | ||
| 54 | + <function-class>com.fh.controller.sunvote.Myelfun</function-class><!-- 标签处理域值的类路径 --> | ||
| 55 | + <function-signature>java.lang.String findBasestationName(int)</function-signature><!-- 标签处理域值的具体的类方法 --> | ||
| 56 | + <example>${myelfun:findBasestationName(obj1)}</example><!-- 自定义标签的使用示范 ,域参数会自动传递到具体的方法里面--> | ||
| 57 | + </function> | ||
| 58 | + | ||
| 59 | + <function> | ||
| 60 | + <description>根据ID查找老师姓名</description><!-- 对该标签的说明 --> | ||
| 61 | + <name>findTeacherName</name><!-- 定义标签名,放在短标签之后 --> | ||
| 62 | + <function-class>com.fh.controller.sunvote.Myelfun</function-class><!-- 标签处理域值的类路径 --> | ||
| 63 | + <function-signature>java.lang.String findTeacherName(int)</function-signature><!-- 标签处理域值的具体的类方法 --> | ||
| 64 | + <example>${myelfun:findTeacherName(obj1)}</example><!-- 自定义标签的使用示范 ,域参数会自动传递到具体的方法里面--> | ||
| 65 | + </function> | ||
| 66 | + | ||
| 67 | + <function> | ||
| 68 | + <description>根据ID查找班级姓名</description><!-- 对该标签的说明 --> | ||
| 69 | + <name>findClassName</name><!-- 定义标签名,放在短标签之后 --> | ||
| 70 | + <function-class>com.fh.controller.sunvote.Myelfun</function-class><!-- 标签处理域值的类路径 --> | ||
| 71 | + <function-signature>java.lang.String findClassName(int)</function-signature><!-- 标签处理域值的具体的类方法 --> | ||
| 72 | + <example>${myelfun:findClassName(obj1)}</example><!-- 自定义标签的使用示范 ,域参数会自动传递到具体的方法里面--> | ||
| 73 | + </function> | ||
| 74 | + | ||
| 75 | + <function> | ||
| 76 | + <description>根据ID查找教材名称</description><!-- 对该标签的说明 --> | ||
| 77 | + <name>findTeachingmaterialName</name><!-- 定义标签名,放在短标签之后 --> | ||
| 78 | + <function-class>com.fh.controller.sunvote.Myelfun</function-class><!-- 标签处理域值的类路径 --> | ||
| 79 | + <function-signature>java.lang.String findTeachingmaterialName(int)</function-signature><!-- 标签处理域值的具体的类方法 --> | ||
| 80 | + <example>${myelfun:findTeachingmaterialName(obj1)}</example><!-- 自定义标签的使用示范 ,域参数会自动传递到具体的方法里面--> | ||
| 81 | + </function> | ||
| 82 | + | ||
| 83 | + | ||
| 84 | +</taglib> |
resources/mybatis1/sunvote/StudentMapper.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
| 3 | +<mapper namespace="StudentMapper"> | ||
| 4 | + | ||
| 5 | + <!--表名 --> | ||
| 6 | + <sql id="tableName"> | ||
| 7 | + SV_STUDENT | ||
| 8 | + </sql> | ||
| 9 | + | ||
| 10 | + <!-- 字段 --> | ||
| 11 | + <sql id="Field"> | ||
| 12 | + NAME, | ||
| 13 | + SNO, | ||
| 14 | + NUMBER, | ||
| 15 | + SEX, | ||
| 16 | + GROUPID, | ||
| 17 | + SIGN_NO, | ||
| 18 | + PARENT_NAME, | ||
| 19 | + PARENT_PHONE, | ||
| 20 | + KEYPAD_ID, | ||
| 21 | + REMARK, | ||
| 22 | + ID | ||
| 23 | + </sql> | ||
| 24 | + | ||
| 25 | + <!-- 字段值 --> | ||
| 26 | + <sql id="FieldValue"> | ||
| 27 | + #{NAME}, | ||
| 28 | + #{SNO}, | ||
| 29 | + #{NUMBER}, | ||
| 30 | + #{SEX}, | ||
| 31 | + #{GROUPID}, | ||
| 32 | + #{SIGN_NO}, | ||
| 33 | + #{PARENT_NAME}, | ||
| 34 | + #{PARENT_PHONE}, | ||
| 35 | + #{KEYPAD_ID}, | ||
| 36 | + #{REMARK}, | ||
| 37 | + #{ID} | ||
| 38 | + </sql> | ||
| 39 | + | ||
| 40 | + <!-- 新增--> | ||
| 41 | + <insert id="save" parameterType="pd"> | ||
| 42 | + insert into | ||
| 43 | + <include refid="tableName"></include> | ||
| 44 | + ( | ||
| 45 | + NAME, | ||
| 46 | + SNO, | ||
| 47 | + NUMBER, | ||
| 48 | + SEX, | ||
| 49 | + GROUPID, | ||
| 50 | + SIGN_NO, | ||
| 51 | + PARENT_NAME, | ||
| 52 | + PARENT_PHONE, | ||
| 53 | + KEYPAD_ID, | ||
| 54 | + REMARK | ||
| 55 | + ) values ( | ||
| 56 | + #{NAME}, | ||
| 57 | + #{SNO}, | ||
| 58 | + #{NUMBER}, | ||
| 59 | + #{SEX}, | ||
| 60 | + #{GROUPID}, | ||
| 61 | + #{SIGN_NO}, | ||
| 62 | + #{PARENT_NAME}, | ||
| 63 | + #{PARENT_PHONE}, | ||
| 64 | + #{KEYPAD_ID}, | ||
| 65 | + #{REMARK} | ||
| 66 | + ) | ||
| 67 | + </insert> | ||
| 68 | + | ||
| 69 | + <!-- 删除--> | ||
| 70 | + <delete id="delete" parameterType="pd"> | ||
| 71 | + delete from | ||
| 72 | + <include refid="tableName"></include> | ||
| 73 | + where | ||
| 74 | + ID = #{ID} | ||
| 75 | + </delete> | ||
| 76 | + | ||
| 77 | + <!-- 修改 --> | ||
| 78 | + <update id="edit" parameterType="pd"> | ||
| 79 | + update | ||
| 80 | + <include refid="tableName"></include> | ||
| 81 | + set | ||
| 82 | + NAME = #{NAME}, | ||
| 83 | + SNO = #{SNO}, | ||
| 84 | + NUMBER = #{NUMBER}, | ||
| 85 | + SEX = #{SEX}, | ||
| 86 | + GROUPID = #{GROUPID}, | ||
| 87 | + SIGN_NO = #{SIGN_NO}, | ||
| 88 | + PARENT_NAME = #{PARENT_NAME}, | ||
| 89 | + PARENT_PHONE = #{PARENT_PHONE}, | ||
| 90 | + KEYPAD_ID = #{KEYPAD_ID}, | ||
| 91 | + REMARK = #{REMARK}, | ||
| 92 | + ID = #{ID} | ||
| 93 | + where | ||
| 94 | + ID = #{ID} | ||
| 95 | + </update> | ||
| 96 | + | ||
| 97 | + <!-- 通过ID获取数据 --> | ||
| 98 | + <select id="findById" parameterType="pd" resultType="pd"> | ||
| 99 | + select | ||
| 100 | + <include refid="Field"></include> | ||
| 101 | + from | ||
| 102 | + <include refid="tableName"></include> | ||
| 103 | + where | ||
| 104 | + ID = #{ID} | ||
| 105 | + </select> | ||
| 106 | + | ||
| 107 | + <!-- 列表 --> | ||
| 108 | + <select id="datalistPage" parameterType="page" resultType="pd"> | ||
| 109 | + select | ||
| 110 | + <include refid="Field"></include> | ||
| 111 | + from | ||
| 112 | + <include refid="tableName"></include> | ||
| 113 | + where 1=1 | ||
| 114 | + <if test="pd.keywords!= null and pd.keywords != ''"><!-- 关键词检索 --> | ||
| 115 | + and | ||
| 116 | + ( | ||
| 117 | + <!-- 根据需求自己加检索条件 | ||
| 118 | + 字段1 LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%') | ||
| 119 | + or | ||
| 120 | + 字段2 LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%') | ||
| 121 | + --> | ||
| 122 | + ) | ||
| 123 | + </if> | ||
| 124 | + </select> | ||
| 125 | + | ||
| 126 | + <!-- 列表(全部) --> | ||
| 127 | + <select id="listAll" parameterType="pd" resultType="pd"> | ||
| 128 | + select | ||
| 129 | + <include refid="Field"></include> | ||
| 130 | + from | ||
| 131 | + <include refid="tableName"></include> | ||
| 132 | + </select> | ||
| 133 | + | ||
| 134 | + <!-- 批量删除 --> | ||
| 135 | + <delete id="deleteAll" parameterType="String"> | ||
| 136 | + delete from | ||
| 137 | + <include refid="tableName"></include> | ||
| 138 | + where | ||
| 139 | + ID in | ||
| 140 | + <foreach item="item" index="index" collection="array" open="(" separator="," close=")"> | ||
| 141 | + #{item} | ||
| 142 | + </foreach> | ||
| 143 | + </delete> | ||
| 144 | + | ||
| 145 | + <!-- fh313596790qq(青苔) --> | ||
| 146 | +</mapper> | ||
| 0 | \ No newline at end of file | 147 | \ No newline at end of file |
src/com/fh/controller/sunvote/Myelfun.java
0 → 100644
| 1 | +package com.fh.controller.sunvote; | ||
| 2 | + | ||
| 3 | +import org.springframework.stereotype.Service; | ||
| 4 | + | ||
| 5 | +import com.fh.service.sunvote.basestation.impl.BasestationService; | ||
| 6 | +import com.fh.service.sunvote.classtype.impl.ClassTypeService; | ||
| 7 | +import com.fh.service.sunvote.grade.impl.GradeService; | ||
| 8 | +import com.fh.service.sunvote.school.impl.SchoolService; | ||
| 9 | +import com.fh.service.sunvote.sclass.impl.SClassService; | ||
| 10 | +import com.fh.service.sunvote.subject.impl.SubjectService; | ||
| 11 | +import com.fh.service.sunvote.teacher.impl.TeacherService; | ||
| 12 | +import com.fh.service.sunvote.teachingmaterial.impl.TeachingMaterialService; | ||
| 13 | +import com.fh.util.PageData; | ||
| 14 | +import com.fh.util.SpringBeanFactoryUtils; | ||
| 15 | + | ||
| 16 | +@Service | ||
| 17 | +public class Myelfun { | ||
| 18 | + | ||
| 19 | + /** | ||
| 20 | + * 根据ID 获取学校名称 | ||
| 21 | + * @param type | ||
| 22 | + * @return | ||
| 23 | + * @throws Exception | ||
| 24 | + */ | ||
| 25 | + public static String findSchoolName(int type) throws Exception{ | ||
| 26 | + SchoolService schoolService = (SchoolService)SpringBeanFactoryUtils.getBean("schoolService"); | ||
| 27 | + PageData pageData = new PageData(); | ||
| 28 | + pageData.put("ID", type); | ||
| 29 | + pageData = schoolService.findById(pageData); | ||
| 30 | + if(pageData != null){ | ||
| 31 | + return pageData.getString("NAME"); | ||
| 32 | + }else{ | ||
| 33 | + return "" ; | ||
| 34 | + } | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + /** | ||
| 38 | + * 根据ID获取年级名称 | ||
| 39 | + * @param type | ||
| 40 | + * @return | ||
| 41 | + * @throws Exception | ||
| 42 | + */ | ||
| 43 | + public static String findGradeName(int type) throws Exception{ | ||
| 44 | + GradeService gradeService = (GradeService)SpringBeanFactoryUtils.getBean("gradeService"); | ||
| 45 | + PageData pageData = new PageData(); | ||
| 46 | + pageData.put("ID", type); | ||
| 47 | + pageData = gradeService.findById(pageData); | ||
| 48 | + if(pageData != null){ | ||
| 49 | + return pageData.getString("NAME"); | ||
| 50 | + }else{ | ||
| 51 | + return "" ; | ||
| 52 | + } | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + /** | ||
| 56 | + * 根据ID或者班级类型名称 | ||
| 57 | + * @param type | ||
| 58 | + * @return | ||
| 59 | + * @throws Exception | ||
| 60 | + */ | ||
| 61 | + public static String findClassTypeName(int type) throws Exception{ | ||
| 62 | + ClassTypeService classTypeService = (ClassTypeService)SpringBeanFactoryUtils.getBean("classtypeService"); | ||
| 63 | + PageData pageData = new PageData(); | ||
| 64 | + pageData.put("ID", type); | ||
| 65 | + pageData = classTypeService.findById(pageData); | ||
| 66 | + if(pageData != null){ | ||
| 67 | + return pageData.getString("NAME"); | ||
| 68 | + }else{ | ||
| 69 | + return "" ; | ||
| 70 | + } | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + /** | ||
| 74 | + * 根据ID,获取科目中文名称 | ||
| 75 | + * @param type | ||
| 76 | + * @return | ||
| 77 | + * @throws Exception | ||
| 78 | + */ | ||
| 79 | + public static String findSubjectEName(int type) throws Exception{ | ||
| 80 | + SubjectService subjectService = (SubjectService)SpringBeanFactoryUtils.getBean("subjectService"); | ||
| 81 | + PageData pageData = new PageData(); | ||
| 82 | + pageData.put("ID", type); | ||
| 83 | + pageData = subjectService.findById(pageData); | ||
| 84 | + if(pageData != null){ | ||
| 85 | + return pageData.getString("ENAME"); | ||
| 86 | + }else{ | ||
| 87 | + return "" ; | ||
| 88 | + } | ||
| 89 | + } | ||
| 90 | + | ||
| 91 | + /** | ||
| 92 | + * 根据ID或者科目英文名称 | ||
| 93 | + * @param type | ||
| 94 | + * @return | ||
| 95 | + * @throws Exception | ||
| 96 | + */ | ||
| 97 | + public static String findSubjectCName(int type) throws Exception{ | ||
| 98 | + SubjectService subjectService = (SubjectService)SpringBeanFactoryUtils.getBean("subjectService"); | ||
| 99 | + PageData pageData = new PageData(); | ||
| 100 | + pageData.put("ID", type); | ||
| 101 | + pageData = subjectService.findById(pageData); | ||
| 102 | + if(pageData != null){ | ||
| 103 | + return pageData.getString("CNAME"); | ||
| 104 | + }else{ | ||
| 105 | + return "" ; | ||
| 106 | + } | ||
| 107 | + } | ||
| 108 | + | ||
| 109 | + /** | ||
| 110 | + * 根据ID查找基站名称 | ||
| 111 | + * @param type | ||
| 112 | + * @return | ||
| 113 | + * @throws Exception | ||
| 114 | + */ | ||
| 115 | + public static String findBasestationName(int type) throws Exception{ | ||
| 116 | + BasestationService basestationService = (BasestationService)SpringBeanFactoryUtils.getBean("basestationService"); | ||
| 117 | + PageData pageData = new PageData(); | ||
| 118 | + pageData.put("ID", type); | ||
| 119 | + pageData = basestationService.findById(pageData); | ||
| 120 | + if(pageData != null){ | ||
| 121 | + return pageData.getString("NAME"); | ||
| 122 | + }else{ | ||
| 123 | + return "" ; | ||
| 124 | + } | ||
| 125 | + } | ||
| 126 | + | ||
| 127 | + /** | ||
| 128 | + * 根据ID 老师姓名 | ||
| 129 | + * @param id | ||
| 130 | + * @return | ||
| 131 | + * @throws Exception | ||
| 132 | + */ | ||
| 133 | + public static String findTeacherName(int id) throws Exception { | ||
| 134 | + TeacherService teacherService = (TeacherService)SpringBeanFactoryUtils.getBean("teacherService"); | ||
| 135 | + PageData pageData = new PageData(); | ||
| 136 | + pageData.put("ID", id); | ||
| 137 | + pageData = teacherService.findById(pageData); | ||
| 138 | + if(pageData != null){ | ||
| 139 | + return pageData.getString("NAME"); | ||
| 140 | + }else{ | ||
| 141 | + return "" ; | ||
| 142 | + } | ||
| 143 | + } | ||
| 144 | + | ||
| 145 | + /** | ||
| 146 | + * 根据ID班级名称 | ||
| 147 | + * @param id | ||
| 148 | + * @return | ||
| 149 | + * @throws Exception | ||
| 150 | + */ | ||
| 151 | + public static String findClassName(int id) throws Exception { | ||
| 152 | + SClassService sclassService = (SClassService)SpringBeanFactoryUtils.getBean("sclassService"); | ||
| 153 | + PageData pageData = new PageData(); | ||
| 154 | + pageData.put("ID", id); | ||
| 155 | + pageData = sclassService.findById(pageData); | ||
| 156 | + if(pageData != null){ | ||
| 157 | + return pageData.getString("CLASS_NAME"); | ||
| 158 | + }else{ | ||
| 159 | + return "" ; | ||
| 160 | + } | ||
| 161 | + } | ||
| 162 | + | ||
| 163 | + /** | ||
| 164 | + * 根据ID班级名称 | ||
| 165 | + * @param id | ||
| 166 | + * @return | ||
| 167 | + * @throws Exception | ||
| 168 | + */ | ||
| 169 | + public static String findTeachingmaterialName(int id) throws Exception { | ||
| 170 | + TeachingMaterialService teachingmaterialService = (TeachingMaterialService)SpringBeanFactoryUtils.getBean("teachingmaterialService"); | ||
| 171 | + PageData pageData = new PageData(); | ||
| 172 | + pageData.put("ID", id); | ||
| 173 | + pageData = teachingmaterialService.findById(pageData); | ||
| 174 | + if(pageData != null){ | ||
| 175 | + return pageData.getString("NAME"); | ||
| 176 | + }else{ | ||
| 177 | + return "" ; | ||
| 178 | + } | ||
| 179 | + } | ||
| 180 | + | ||
| 181 | +} |
src/com/fh/controller/sunvote/student/StudentController.java
0 → 100644
| 1 | +package com.fh.controller.sunvote.student; | ||
| 2 | + | ||
| 3 | +import java.io.PrintWriter; | ||
| 4 | +import java.text.DateFormat; | ||
| 5 | +import java.text.SimpleDateFormat; | ||
| 6 | +import java.util.ArrayList; | ||
| 7 | +import java.util.Date; | ||
| 8 | +import java.util.HashMap; | ||
| 9 | +import java.util.List; | ||
| 10 | +import java.util.Map; | ||
| 11 | +import javax.annotation.Resource; | ||
| 12 | +import org.springframework.beans.propertyeditors.CustomDateEditor; | ||
| 13 | +import org.springframework.stereotype.Controller; | ||
| 14 | +import org.springframework.web.bind.WebDataBinder; | ||
| 15 | +import org.springframework.web.bind.annotation.InitBinder; | ||
| 16 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 17 | +import org.springframework.web.bind.annotation.ResponseBody; | ||
| 18 | +import org.springframework.web.servlet.ModelAndView; | ||
| 19 | +import com.fh.controller.base.BaseController; | ||
| 20 | +import com.fh.entity.Page; | ||
| 21 | +import com.fh.util.AppUtil; | ||
| 22 | +import com.fh.util.ObjectExcelView; | ||
| 23 | +import com.fh.util.PageData; | ||
| 24 | +import com.fh.util.Jurisdiction; | ||
| 25 | +import com.fh.util.Tools; | ||
| 26 | +import com.fh.service.sunvote.student.StudentManager; | ||
| 27 | + | ||
| 28 | +/** | ||
| 29 | + * 说明:学生管理 | ||
| 30 | + * 创建人:Elvis | ||
| 31 | + * 创建时间:2018-04-28 | ||
| 32 | + */ | ||
| 33 | +@Controller | ||
| 34 | +@RequestMapping(value="/student") | ||
| 35 | +public class StudentController extends BaseController { | ||
| 36 | + | ||
| 37 | + String menuUrl = "student/list.do"; //菜单地址(权限用) | ||
| 38 | + @Resource(name="studentService") | ||
| 39 | + private StudentManager studentService; | ||
| 40 | + | ||
| 41 | + /**保存 | ||
| 42 | + * @param | ||
| 43 | + * @throws Exception | ||
| 44 | + */ | ||
| 45 | + @RequestMapping(value="/save") | ||
| 46 | + public ModelAndView save() throws Exception{ | ||
| 47 | + logBefore(logger, Jurisdiction.getUsername()+"新增Student"); | ||
| 48 | + if(!Jurisdiction.buttonJurisdiction(menuUrl, "add")){return null;} //校验权限 | ||
| 49 | + ModelAndView mv = this.getModelAndView(); | ||
| 50 | + PageData pd = new PageData(); | ||
| 51 | + pd = this.getPageData(); | ||
| 52 | + studentService.save(pd); | ||
| 53 | + mv.addObject("msg","success"); | ||
| 54 | + mv.setViewName("save_result"); | ||
| 55 | + return mv; | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | + /**删除 | ||
| 59 | + * @param out | ||
| 60 | + * @throws Exception | ||
| 61 | + */ | ||
| 62 | + @RequestMapping(value="/delete") | ||
| 63 | + public void delete(PrintWriter out) throws Exception{ | ||
| 64 | + logBefore(logger, Jurisdiction.getUsername()+"删除Student"); | ||
| 65 | + if(!Jurisdiction.buttonJurisdiction(menuUrl, "del")){return;} //校验权限 | ||
| 66 | + PageData pd = new PageData(); | ||
| 67 | + pd = this.getPageData(); | ||
| 68 | + studentService.delete(pd); | ||
| 69 | + out.write("success"); | ||
| 70 | + out.close(); | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + /**修改 | ||
| 74 | + * @param | ||
| 75 | + * @throws Exception | ||
| 76 | + */ | ||
| 77 | + @RequestMapping(value="/edit") | ||
| 78 | + public ModelAndView edit() throws Exception{ | ||
| 79 | + logBefore(logger, Jurisdiction.getUsername()+"修改Student"); | ||
| 80 | + if(!Jurisdiction.buttonJurisdiction(menuUrl, "edit")){return null;} //校验权限 | ||
| 81 | + ModelAndView mv = this.getModelAndView(); | ||
| 82 | + PageData pd = new PageData(); | ||
| 83 | + pd = this.getPageData(); | ||
| 84 | + studentService.edit(pd); | ||
| 85 | + mv.addObject("msg","success"); | ||
| 86 | + mv.setViewName("save_result"); | ||
| 87 | + return mv; | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + /**列表 | ||
| 91 | + * @param page | ||
| 92 | + * @throws Exception | ||
| 93 | + */ | ||
| 94 | + @RequestMapping(value="/list") | ||
| 95 | + public ModelAndView list(Page page) throws Exception{ | ||
| 96 | + logBefore(logger, Jurisdiction.getUsername()+"列表Student"); | ||
| 97 | + //if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;} //校验权限(无权查看时页面会有提示,如果不注释掉这句代码就无法进入列表页面,所以根据情况是否加入本句代码) | ||
| 98 | + ModelAndView mv = this.getModelAndView(); | ||
| 99 | + PageData pd = new PageData(); | ||
| 100 | + pd = this.getPageData(); | ||
| 101 | + String keywords = pd.getString("keywords"); //关键词检索条件 | ||
| 102 | + if(null != keywords && !"".equals(keywords)){ | ||
| 103 | + pd.put("keywords", keywords.trim()); | ||
| 104 | + } | ||
| 105 | + page.setPd(pd); | ||
| 106 | + List<PageData> varList = studentService.list(page); //列出Student列表 | ||
| 107 | + mv.setViewName("sunvote/student/student_list"); | ||
| 108 | + mv.addObject("varList", varList); | ||
| 109 | + mv.addObject("pd", pd); | ||
| 110 | + mv.addObject("QX",Jurisdiction.getHC()); //按钮权限 | ||
| 111 | + return mv; | ||
| 112 | + } | ||
| 113 | + | ||
| 114 | + /**去新增页面 | ||
| 115 | + * @param | ||
| 116 | + * @throws Exception | ||
| 117 | + */ | ||
| 118 | + @RequestMapping(value="/goAdd") | ||
| 119 | + public ModelAndView goAdd()throws Exception{ | ||
| 120 | + ModelAndView mv = this.getModelAndView(); | ||
| 121 | + PageData pd = new PageData(); | ||
| 122 | + pd = this.getPageData(); | ||
| 123 | + mv.setViewName("sunvote/student/student_edit"); | ||
| 124 | + mv.addObject("msg", "save"); | ||
| 125 | + mv.addObject("pd", pd); | ||
| 126 | + return mv; | ||
| 127 | + } | ||
| 128 | + | ||
| 129 | + /**去修改页面 | ||
| 130 | + * @param | ||
| 131 | + * @throws Exception | ||
| 132 | + */ | ||
| 133 | + @RequestMapping(value="/goEdit") | ||
| 134 | + public ModelAndView goEdit()throws Exception{ | ||
| 135 | + ModelAndView mv = this.getModelAndView(); | ||
| 136 | + PageData pd = new PageData(); | ||
| 137 | + pd = this.getPageData(); | ||
| 138 | + pd = studentService.findById(pd); //根据ID读取 | ||
| 139 | + mv.setViewName("sunvote/student/student_edit"); | ||
| 140 | + mv.addObject("msg", "edit"); | ||
| 141 | + mv.addObject("pd", pd); | ||
| 142 | + return mv; | ||
| 143 | + } | ||
| 144 | + | ||
| 145 | + /**批量删除 | ||
| 146 | + * @param | ||
| 147 | + * @throws Exception | ||
| 148 | + */ | ||
| 149 | + @RequestMapping(value="/deleteAll") | ||
| 150 | + @ResponseBody | ||
| 151 | + public Object deleteAll() throws Exception{ | ||
| 152 | + logBefore(logger, Jurisdiction.getUsername()+"批量删除Student"); | ||
| 153 | + if(!Jurisdiction.buttonJurisdiction(menuUrl, "del")){return null;} //校验权限 | ||
| 154 | + PageData pd = new PageData(); | ||
| 155 | + Map<String,Object> map = new HashMap<String,Object>(); | ||
| 156 | + pd = this.getPageData(); | ||
| 157 | + List<PageData> pdList = new ArrayList<PageData>(); | ||
| 158 | + String DATA_IDS = pd.getString("DATA_IDS"); | ||
| 159 | + if(null != DATA_IDS && !"".equals(DATA_IDS)){ | ||
| 160 | + String ArrayDATA_IDS[] = DATA_IDS.split(","); | ||
| 161 | + studentService.deleteAll(ArrayDATA_IDS); | ||
| 162 | + pd.put("msg", "ok"); | ||
| 163 | + }else{ | ||
| 164 | + pd.put("msg", "no"); | ||
| 165 | + } | ||
| 166 | + pdList.add(pd); | ||
| 167 | + map.put("list", pdList); | ||
| 168 | + return AppUtil.returnObject(pd, map); | ||
| 169 | + } | ||
| 170 | + | ||
| 171 | + /**导出到excel | ||
| 172 | + * @param | ||
| 173 | + * @throws Exception | ||
| 174 | + */ | ||
| 175 | + @RequestMapping(value="/excel") | ||
| 176 | + public ModelAndView exportExcel() throws Exception{ | ||
| 177 | + logBefore(logger, Jurisdiction.getUsername()+"导出Student到excel"); | ||
| 178 | + if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;} | ||
| 179 | + ModelAndView mv = new ModelAndView(); | ||
| 180 | + PageData pd = new PageData(); | ||
| 181 | + pd = this.getPageData(); | ||
| 182 | + Map<String,Object> dataMap = new HashMap<String,Object>(); | ||
| 183 | + List<String> titles = new ArrayList<String>(); | ||
| 184 | + titles.add("学生姓名"); //1 | ||
| 185 | + titles.add("学籍号"); //2 | ||
| 186 | + titles.add("学号"); //3 | ||
| 187 | + titles.add("性别"); //4 | ||
| 188 | + titles.add("组号"); //5 | ||
| 189 | + titles.add("签到码"); //6 | ||
| 190 | + titles.add("家长姓名"); //7 | ||
| 191 | + titles.add("家长手机号"); //8 | ||
| 192 | + titles.add("键盘ID"); //9 | ||
| 193 | + titles.add("备注"); //10 | ||
| 194 | + dataMap.put("titles", titles); | ||
| 195 | + List<PageData> varOList = studentService.listAll(pd); | ||
| 196 | + List<PageData> varList = new ArrayList<PageData>(); | ||
| 197 | + for(int i=0;i<varOList.size();i++){ | ||
| 198 | + PageData vpd = new PageData(); | ||
| 199 | + vpd.put("var1", varOList.get(i).getString("NAME")); //1 | ||
| 200 | + vpd.put("var2", varOList.get(i).getString("SNO")); //2 | ||
| 201 | + vpd.put("var3", varOList.get(i).getString("NUMBER")); //3 | ||
| 202 | + vpd.put("var4", varOList.get(i).get("SEX").toString()); //4 | ||
| 203 | + vpd.put("var5", varOList.get(i).getString("GROUP")); //5 | ||
| 204 | + vpd.put("var6", varOList.get(i).getString("SIGN_NO")); //6 | ||
| 205 | + vpd.put("var7", varOList.get(i).getString("PARENT_NAME")); //7 | ||
| 206 | + vpd.put("var8", varOList.get(i).getString("PARENT_PHONE")); //8 | ||
| 207 | + vpd.put("var9", varOList.get(i).getString("KEYPAD_ID")); //9 | ||
| 208 | + vpd.put("var10", varOList.get(i).getString("REMARK")); //10 | ||
| 209 | + varList.add(vpd); | ||
| 210 | + } | ||
| 211 | + dataMap.put("varList", varList); | ||
| 212 | + ObjectExcelView erv = new ObjectExcelView(); | ||
| 213 | + mv = new ModelAndView(erv,dataMap); | ||
| 214 | + return mv; | ||
| 215 | + } | ||
| 216 | + | ||
| 217 | + @InitBinder | ||
| 218 | + public void initBinder(WebDataBinder binder){ | ||
| 219 | + DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); | ||
| 220 | + binder.registerCustomEditor(Date.class, new CustomDateEditor(format,true)); | ||
| 221 | + } | ||
| 222 | +} |
src/com/fh/service/sunvote/student/StudentManager.java
0 → 100644
| 1 | +package com.fh.service.sunvote.student; | ||
| 2 | + | ||
| 3 | +import java.util.List; | ||
| 4 | +import com.fh.entity.Page; | ||
| 5 | +import com.fh.util.PageData; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * 说明: 学生管理接口 | ||
| 9 | + * 创建人:Elvis | ||
| 10 | + * 创建时间:2018-04-28 | ||
| 11 | + * @version | ||
| 12 | + */ | ||
| 13 | +public interface StudentManager{ | ||
| 14 | + | ||
| 15 | + /**新增 | ||
| 16 | + * @param pd | ||
| 17 | + * @throws Exception | ||
| 18 | + */ | ||
| 19 | + public void save(PageData pd)throws Exception; | ||
| 20 | + | ||
| 21 | + /**删除 | ||
| 22 | + * @param pd | ||
| 23 | + * @throws Exception | ||
| 24 | + */ | ||
| 25 | + public void delete(PageData pd)throws Exception; | ||
| 26 | + | ||
| 27 | + /**修改 | ||
| 28 | + * @param pd | ||
| 29 | + * @throws Exception | ||
| 30 | + */ | ||
| 31 | + public void edit(PageData pd)throws Exception; | ||
| 32 | + | ||
| 33 | + /**列表 | ||
| 34 | + * @param page | ||
| 35 | + * @throws Exception | ||
| 36 | + */ | ||
| 37 | + public List<PageData> list(Page page)throws Exception; | ||
| 38 | + | ||
| 39 | + /**列表(全部) | ||
| 40 | + * @param pd | ||
| 41 | + * @throws Exception | ||
| 42 | + */ | ||
| 43 | + public List<PageData> listAll(PageData pd)throws Exception; | ||
| 44 | + | ||
| 45 | + /**通过id获取数据 | ||
| 46 | + * @param pd | ||
| 47 | + * @throws Exception | ||
| 48 | + */ | ||
| 49 | + public PageData findById(PageData pd)throws Exception; | ||
| 50 | + | ||
| 51 | + /**批量删除 | ||
| 52 | + * @param ArrayDATA_IDS | ||
| 53 | + * @throws Exception | ||
| 54 | + */ | ||
| 55 | + public void deleteAll(String[] ArrayDATA_IDS)throws Exception; | ||
| 56 | + | ||
| 57 | +} | ||
| 58 | + |
src/com/fh/service/sunvote/student/impl/StudentService.java
0 → 100644
| 1 | +package com.fh.service.sunvote.student.impl; | ||
| 2 | + | ||
| 3 | +import java.util.List; | ||
| 4 | +import javax.annotation.Resource; | ||
| 5 | +import org.springframework.stereotype.Service; | ||
| 6 | +import com.fh.dao.DaoSupport; | ||
| 7 | +import com.fh.entity.Page; | ||
| 8 | +import com.fh.util.PageData; | ||
| 9 | +import com.fh.service.sunvote.student.StudentManager; | ||
| 10 | + | ||
| 11 | +/** | ||
| 12 | + * 说明: 学生管理 | ||
| 13 | + * 创建人:FH Q313596790 | ||
| 14 | + * 创建时间:2018-04-28 | ||
| 15 | + * @version | ||
| 16 | + */ | ||
| 17 | +@Service("studentService") | ||
| 18 | +public class StudentService implements StudentManager{ | ||
| 19 | + | ||
| 20 | + @Resource(name = "daoSupport") | ||
| 21 | + private DaoSupport dao; | ||
| 22 | + | ||
| 23 | + /**新增 | ||
| 24 | + * @param pd | ||
| 25 | + * @throws Exception | ||
| 26 | + */ | ||
| 27 | + public void save(PageData pd)throws Exception{ | ||
| 28 | + dao.save("StudentMapper.save", pd); | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + /**删除 | ||
| 32 | + * @param pd | ||
| 33 | + * @throws Exception | ||
| 34 | + */ | ||
| 35 | + public void delete(PageData pd)throws Exception{ | ||
| 36 | + dao.delete("StudentMapper.delete", pd); | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + /**修改 | ||
| 40 | + * @param pd | ||
| 41 | + * @throws Exception | ||
| 42 | + */ | ||
| 43 | + public void edit(PageData pd)throws Exception{ | ||
| 44 | + dao.update("StudentMapper.edit", pd); | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + /**列表 | ||
| 48 | + * @param page | ||
| 49 | + * @throws Exception | ||
| 50 | + */ | ||
| 51 | + @SuppressWarnings("unchecked") | ||
| 52 | + public List<PageData> list(Page page)throws Exception{ | ||
| 53 | + return (List<PageData>)dao.findForList("StudentMapper.datalistPage", page); | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + /**列表(全部) | ||
| 57 | + * @param pd | ||
| 58 | + * @throws Exception | ||
| 59 | + */ | ||
| 60 | + @SuppressWarnings("unchecked") | ||
| 61 | + public List<PageData> listAll(PageData pd)throws Exception{ | ||
| 62 | + return (List<PageData>)dao.findForList("StudentMapper.listAll", pd); | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | + /**通过id获取数据 | ||
| 66 | + * @param pd | ||
| 67 | + * @throws Exception | ||
| 68 | + */ | ||
| 69 | + public PageData findById(PageData pd)throws Exception{ | ||
| 70 | + return (PageData)dao.findForObject("StudentMapper.findById", pd); | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + /**批量删除 | ||
| 74 | + * @param ArrayDATA_IDS | ||
| 75 | + * @throws Exception | ||
| 76 | + */ | ||
| 77 | + public void deleteAll(String[] ArrayDATA_IDS)throws Exception{ | ||
| 78 | + dao.delete("StudentMapper.deleteAll", ArrayDATA_IDS); | ||
| 79 | + } | ||
| 80 | + | ||
| 81 | +} | ||
| 82 | + |
src/com/fh/util/SpringBeanFactoryUtils.java
0 → 100644
| 1 | +package com.fh.util; | ||
| 2 | + | ||
| 3 | + | ||
| 4 | + | ||
| 5 | +import org.springframework.beans.BeansException; | ||
| 6 | +import org.springframework.context.ApplicationContext; | ||
| 7 | +import org.springframework.context.ApplicationContextAware; | ||
| 8 | +/** | ||
| 9 | + * ------------------------------------------- | ||
| 10 | + * Title : SpringBeanFactoryUtils | ||
| 11 | + * Description : 普通类调用Spring注解方式的Service层bean | ||
| 12 | + * Create on : 2016年11月1日 下午3:12:25 | ||
| 13 | + * Copyright (C) strongunion | ||
| 14 | + * @author RICK | ||
| 15 | + * 修改历史: | ||
| 16 | + * 修改人 修改日期 修改描述 | ||
| 17 | + * ------------------------------------------- | ||
| 18 | + */ | ||
| 19 | +public class SpringBeanFactoryUtils implements ApplicationContextAware { | ||
| 20 | + | ||
| 21 | + private static ApplicationContext appCtx; | ||
| 22 | + | ||
| 23 | + /** | ||
| 24 | + * TODO: 此方法可以把ApplicationContext对象inject到当前类中作为一个静态成员变量。 | ||
| 25 | + * @Auhor: RICK | ||
| 26 | + * @Date : 2016年11月1日 | ||
| 27 | + */ | ||
| 28 | + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { | ||
| 29 | + appCtx = applicationContext; | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + /** | ||
| 33 | + * TODO: 获取ApplicationContext | ||
| 34 | + * @Auhor: RICK | ||
| 35 | + * @Date : 2016年11月1日 | ||
| 36 | + */ | ||
| 37 | + public static ApplicationContext getApplicationContext() { | ||
| 38 | + return appCtx; | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + /** | ||
| 42 | + * TODO: 这是一个便利的方法,帮助我们快速得到一个BEAN | ||
| 43 | + * @Auhor: RICK | ||
| 44 | + * @Date : 2016年11月1日 | ||
| 45 | + */ | ||
| 46 | + public static Object getBean(String beanName) { | ||
| 47 | + return appCtx.getBean(beanName); | ||
| 48 | + } | ||
| 49 | +} | ||
| 0 | \ No newline at end of file | 50 | \ No newline at end of file |