基于javaweb+jsp的学生请假管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Layui Ajax)
JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Layui Ajax
基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可
开发工具:eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
first: false, //不显示首页
last: false, //不显示尾页
},
toolbar: '#myToolbar', //开启头部工具栏,并为其绑定左侧模板
defaultToolbar: ['filter', 'exports', 'print', { //自定义头部工具栏右侧图标。如无需自定义,去除该参数即可
title: '提示',
layEvent: 'LAYTABLE_TIPS',
icon: 'layui-icon-tips'
}],
title: '公告列表',
cols: [
[
{
field: 'noticeName',
title: '标题',
templet: vo => (vo = vo.noticeName) ? '<a href="#" style="color: #009688;">' + vo + 'a>' : '',
event: 'info',
},
{
field: 'noticeText',
title: '内容',
},
{
field: 'noticeType',
title: '类型',
ORDER BY id ASC
<if test="startIndex != null and pageSize != null">
LIMIT #{startIndex},#{pageSize};
if>
select>
<select id="getAllCount" parameterType="java.util.Map" resultType="Integer">
SELECT COUNT(*) FROM `t_leave`
<where>
<if test="searchColumn != null and searchColumn != '' and keyword != null and keyword != ''">
${searchColumn} LIKE CONCAT('%',#{keyword},'%') AND
if>
1=1
where>
select>
mapper>
DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.demo.dao.UserMapper">
<resultMap id="BaseResultMap" type="com.demo.vo.User" >
<result column="id" property="id" />
<result column="username" property="username" />
<result column="password" property="password" />
<result column="real_name" property="realName" />
<result column="user_sex" property="userSex" />
<div class="searchTable">
搜索:
<div class="layui-inline">
<input class="layui-input" name="search_keyword" id="search_keyword" autocomplete="off" placeholder="姓名">
<input type="hidden" class="layui-input" name="searchColumn" id="searchColumn" autocomplete="off" value="real_name">
div>
<button class="layui-btn" data-type="reload">搜索button>
div>
div>
<table class="layui-hide" id="myData" lay-filter="myTable">table>
div>
div>
<script src="js/layui/layui.js"/>
<script>
//JavaScript代码区域
layui.use('element', function () {
let element = layui.element;
});
Notice vo = new Notice();
vo.setId(Long.valueOf(Util.decode(request, "id")));
vo.setNoticeName(Util.decode(request, "noticeName"));
vo.setNoticeText(Util.decode(request, "noticeText"));
vo.setNoticeType(Util.decode(request, "noticeType"));
vo.setCreateDate(Util.decode(request, "createDate"));
noticeService.update(vo);
this.redirectList(request, response);
}
/**
* 获取公告的详细信息(详情页面与编辑页面要显示该公告的详情)并跳转回页面
*
* @param response
* @param request
* @throws IOException
*/
@RequestMapping({"noticeGet", "noticeEditPre"})
public void get(HttpServletResponse response, HttpServletRequest request) throws IOException {
Serializable id = Util.decode(request, "id");//取出主键id
Notice vo = noticeService.get(id);
request.getSession().setAttribute("vo", vo);
String to = request.getRequestURI().toLowerCase().contains("get") ? "info" : "edit";//判断是去详情显示页面还是编辑页面
response.sendRedirect("notice_" + to + ".jsp");
<script src="js/layer.js">script>
head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
<div class="layui-header">
<div class="layui-logo" style="font-weight: bold;font-size: 19px">学生请假管理系统div>
<ul class="layui-nav layui-layout-left">ul>
<c:if test="${loginUser==null}">
<ul class="layui-nav layui-layout-right">
<li class="layui-nav-item"><a href="login.jsp">请登录a>li>
ul>
c:if>
<c:if test="${loginUser!=null}">
<ul class="layui-nav layui-layout-right">
<li class="layui-nav-item"><a>${loginUser.username}a>li>
<li class="layui-nav-item"><a href="authLogout">退出登录a>li>
ul>
c:if>
div>
vo.setLeaveName(Util.decode(request, "leaveName"));
vo.setLeaveSex(Util.decode(request, "leaveSex"));
vo.setLeavePhone(Util.decode(request, "leavePhone"));
vo.setLeaveClass(Util.decode(request, "leaveClass"));
vo.setLeaveReason(Util.decode(request, "leaveReason"));
vo.setLeaveStart(Util.decode(request, "leaveStart"));
vo.setLeaveHour(Util.decode(request, "leaveHour"));
//调用Service层的增加(insert)方法
leaveService.insert(vo);
this.redirectList(request, response);
}
/**
* 删除请假
*
* @param response
* @param request
* @throws IOException
*/
@RequestMapping("leaveDelete")
public void delete(HttpServletResponse response, HttpServletRequest request) throws IOException {
Serializable id = Util.decode(request, "id");
leaveService.delete(Arrays.asList(id));
padding: 0 50px;
border-radius: 15px;
/* 设置框的居中位置也可以采用flex布局方式 */
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
.login-wrapper .header {
font-size: 30px;
font-weight: bold;
text-align: center;
line-height: 120px;
}
.login-wrapper .form-wrapper .input-item {
display: block;
width: 100%;
margin-bottom: 20px;
border: 0;
padding: 10px;
border-bottom: 1px solid rgb(128, 125, 125);
font-size: 15px;
outline: none;
}
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.3.xsd">
<context:component-scan base-package="com.demo"/>
<mvc:annotation-driven/>
<mvc:resources mapping="/css/**" location="/css/"/>
<mvc:resources mapping="/img/**" location="/img/"/>
title: '班级',
},
{
field: 'leaveReason',
title: '请假原因',
},
{
field: 'leaveStart',
title: '开始时间',
},
{
field: 'leaveHour',
title: '请假时长(h)',
},
{
align: 'center',
fixed: 'right',
title: ' *** 作',
width: 130,
templet: vo => {
let flag = ${loginUser.userType == '管理员'};
return flag ? '<a class="layui-btn layui-btn-xs" lay-event="edit">编辑a><a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除a>' : '';
}
}
]
],
运行环境
Java≥6、Tomcat≥7.0、MySQL≥5.5
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
技术框架
JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Layui Ajax
基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
登录、注册、退出、用户模块、公告模块、请假模块的增删改查管理
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)