基于javaweb+jsp的自习室座位预订管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap Ajax)
JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Bootstrap Ajax
基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可
开发工具:eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
<if test ='userPhone != null'>`user_phone` = #{userPhone},</if>
<if test ='userText != null'>`user_text` = #{userText},</if>
<if test ='userType != null'>`user_type` = #{userType}</if>
</set>
WHERE `id` = #{id}
</update>
<!--获取-->
<select id="findById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" /> FROM `t_user` WHERE `id` = #{id}
</select>
<!--列表-->
<select id="findAllSplit" parameterType="java.util.Map" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" /> FROM `t_user`
<where>
<if test="searchColumn != null and searchColumn != '' and keyword != null and keyword != ''">
public class Util {
/**
* 获取系统当前时间并格式化为字符串
*
* @return
*/
public static String getTime() {
return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(System.currentTimeMillis());
}
/**
* 判断字符串是不是中文
*
* @param c
* @return
*/
private static boolean isChinese(char c) {
Character.UnicodeBlock ub = Character.UnicodeBlock.of(c);
return (ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
import java.text.SimpleDateFormat;
/**
* 该方法为通用的工具类,放置一些共用的方法
*/
public class Util {
/**
* 获取系统当前时间并格式化为字符串
*
* @return
*/
public static String getTime() {
return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(System.currentTimeMillis());
}
/**
* 判断字符串是不是中文
*
* @param c
* @return
*/
private static boolean isChinese(char c) {
Character.UnicodeBlock ub = Character.UnicodeBlock.of(c);
return (ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title">用户</h4>
</div>
<div class="modal-body">
<table class="table table-striped table-hover" style="font-size: 15px;">
<tr>
<td style="width: 15%;">用户名:</td>
<td><b id="info-username"></b></td>
</tr>
<tr>
<td style="width: 15%;">姓名:</td>
<td><b id="info-realName"></b></td>
</tr>
<tr>
<td style="width: 15%;">性别:</td>
<td><b id="info-userSex"></b></td>
</tr>
<tr>
<td style="width: 15%;">手机:</td>
<td><b id="info-userPhone"></b></td>
</tr>
<tr>
<td style="width: 15%;">备注:</td>
<td><b id="info-userText"></b></td>
* 获取用户的详细信息(详情页面与编辑页面要显示该用户的详情)并跳转回页面
*
* @param response
* @param request
* @throws IOException
*/
@RequestMapping({"userGet", "userEditPre"})
public void get(HttpServletResponse response, HttpServletRequest request) throws IOException {
Serializable id = Util.decode(request, "id");//取出主键id
User vo = userService.get(id);
response.getWriter().println(com.alibaba.fastjson.JSONObject.toJSONString(vo));
}
/**
* 根据条件查询用户的列表并跳转回页面
*
* @param response
* @param request
* @throws IOException
*/
@RequestMapping("userList")
public void list(HttpServletResponse response, HttpServletRequest request) throws IOException {
this.redirectList(request, response);
}
<input name="zuoweiStatus" id="edit-zuoweiStatus_空闲" type="radio" value="空闲"/>空闲
<input name="zuoweiStatus" id="edit-zuoweiStatus_已预定" type="radio" value="已预定"/>已预定
</div>
<div class="form-group">
<label for="edit-zuoweiText" class="control-label">备注:</label>
<textarea style="height: 100px;" class="form-control" name="zuoweiText" id="edit-zuoweiText"></textarea>
</div>
<div class="form-group hidden">
<label for="edit-createTime" class="control-label">创建时间:</label>
<input type="text" class="form-control" name="createTime" id="edit-createTime">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-pill btn-grad btn-info" data-dismiss="modal">取消</button>
<button type="submit" class="btn btn-pill btn-grad btn-success">提交</button>
</div>
<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" />
<result column="user_phone" property="userPhone" />
<result column="user_text" property="userText" />
<result column="user_type" property="userType" />
</resultMap>
<sql id="Base_Column_List">
`id`,`username`,`password`,`real_name`,`user_sex`,`user_phone`,`user_text`,`user_type`
</sql>
<!--新增-->
<insert id="doCreate" useGeneratedKeys="true" keyColumn="id" keyProperty="id" parameterType="com.demo.vo.User">
INSERT INTO `t_user`
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test ='id != null'>`id`,</if>
<if test ='username != null'>`username`,</if>
<if test ='password != null'>`password`,</if>
<if test ='realName != null'>`real_name`,</if>
<if test ='userSex != null'>`user_sex`,</if>
<if test ='yuyueSex != null'>`yuyue_sex` = #{yuyueSex},</if>
<if test ='yuyuePhone != null'>`yuyue_phone` = #{yuyuePhone},</if>
<if test ='yuyueZxs != null'>`yuyue_zxs` = #{yuyueZxs},</if>
<if test ='yuyueZuo != null'>`yuyue_zuo` = #{yuyueZuo},</if>
<if test ='yuyueDate != null'>`yuyue_date` = #{yuyueDate},</if>
<if test ='yuyueText != null'>`yuyue_text` = #{yuyueText}</if>
</set>
WHERE `id` = #{id}
</update>
<!--获取-->
<select id="findById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" /> FROM `t_yuyue` WHERE `id` = #{id}
</select>
<!--列表-->
<select id="findAllSplit" parameterType="java.util.Map" resultMap="BaseResultMap">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">自习室座位预订管理系统</span> <span class="icon-bar"></span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">自习室座位预订管理系统</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="#">欢迎:<span style="color: yellow">${loginUser.username}</span></a></li>
<li><a href="authLogout">退出</a></li>
</ul>
</div>
</div>
</nav>
<div class="container-fluid">
<div class="row">
<div class="col-sm-3 col-md-2 sidebar">
<!-- 侧边栏 -->
<jsp:include page="menu.jsp">
<jsp:param value="active" name="Yuyue_active"/>
</jsp:include>
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">自习室座位预订管理系统</span> <span class="icon-bar"></span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">自习室座位预订管理系统</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="#">欢迎:<span style="color: yellow">${loginUser.username}</span></a></li>
<li><a href="authLogout">退出</a></li>
</ul>
</div>
</div>
</nav>
<div class="container-fluid">
<div class="row">
运行环境
Java≥6、Tomcat≥7.0、MySQL≥5.5
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
技术框架
JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Bootstrap Ajax
基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
登录、注册、退出、用户模块、公告模块、座位模块、预约模块的增删改查管理