基于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等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
for (User user : list) {
if (user.getUsername().equals(username) && user.getPassword().equals(password)) {//找到这个管理员了
request.getSession().setAttribute("loginUser", user);
request.getRequestDispatcher("userList").forward(request, response);
return;
}
}
request.getSession().setAttribute("alert_msg", "错误:用户名或密码错误!");
request.getRequestDispatcher("login.jsp").forward(request, response);
}
@RequestMapping("authRegister")
public void register(HttpServletResponse response, HttpServletRequest request) throws IOException, ServletException {
String username = Util.decode(request, "username");
String password = Util.decode(request, "password");
System.out.println("username=" + username);
System.out.println("password=" + password);
Map<String, Object> params = new HashMap();
params.put("searchColumn", "username");//使用`username`字段进行模糊查询
params.put("keyword", username);
params.put("startIndex", 0);
</insert>
<!--批量删除-->
<delete id="doRemoveBatch" parameterType="java.util.Collection">
DELETE FROM `t_parking` WHERE `id` IN
<foreach collection="list" item="id" separator="," open="(" close=")">
#{id}
</foreach>
</delete>
<!--修改-->
<update id="doUpdate" parameterType="com.demo.vo.Parking">
UPDATE `t_parking`
<set>
<if test ='id != null'>`id` = #{id},</if>
<if test ='parkingName != null'>`parking_name` = #{parkingName},</if>
<if test ='parkingArea != null'>`parking_area` = #{parkingArea},</if>
<if test ='parkingStatus != null'>`parking_status` = #{parkingStatus},</if>
<if test ='parkingOwner != null'>`parking_owner` = #{parkingOwner}</if>
</set>
* @param response
*/
private void redirectList(HttpServletRequest request, HttpServletResponse response) throws IOException {
//查询列和关键字
String searchColumn = Util.decode(request, "searchColumn");
String keyword = Util.decode(request, "keyword");
Map<String, Object> params = new HashMap();//用来保存控制层传进来的参数(查询条件)
params.put("searchColumn", searchColumn);//要查询的列
params.put("keyword", keyword);//查询的关键字
Map<String, Object> map = houseService.list(params);
request.getSession().setAttribute("list", map.get("list"));
Integer totalRecord = (Integer) map.get("totalCount");//根据查询条件取出对应的总记录数,用于分页
String pageNum = Util.decode(request, "pageNum");//封装分页参数
com.demo.util.PageBean<Object> pb = new com.demo.util.PageBean(Integer.valueOf(pageNum != null ? pageNum : "1"), totalRecord);
params.put("startIndex", pb.getStartIndex());
params.put("pageSize", pb.getPageSize());
List list = (List) houseService.list(params).get("list");//根据分页参数startIndex、pageSize查询出来的最终结果list
pb.setServlet("houseList");
pb.setSearchColumn(searchColumn);
modal.find('#edit-ownerName').val(vo.ownerName);
for (let val of "男/女/保密".split('/')) {
if (val == vo.ownerSex) {
modal.find('#edit-ownerSex_' + vo.ownerSex).prop("checked", true);
} else {
modal.find('#edit-ownerSex_' + vo.ownerSex).removeAttr("checked");
}
};
modal.find('#edit-ownerAccount').val(vo.ownerAccount);
modal.find('#edit-ownerIdno').val(vo.ownerIdno);
modal.find('#edit-ownerPhone').val(vo.ownerPhone);
modal.find('#edit-ownerIntime').val(vo.ownerIntime);
}
})
})
$('#modal-info').on('show.bs.modal', function (event) {
</div>
<div style="float: right;padding-right: 10px;color: #515151;"><jsp:include page="split.jsp"/></div>
</div>
</div>
</div>
<!-- add -->
<div class="modal fade" id="modal-add" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<form action="houseAdd" onsubmit="return addCheck()">
<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" id="myModalLabel">增加房产</h4>
</div>
<div class="modal-body">
<if test ='id != null'>`id` = #{id},</if>
<if test ='username != null'>`username` = #{username},</if>
<if test ='password != null'>`password` = #{password},</if>
<if test ='realName != null'>`real_name` = #{realName},</if>
<if test ='userSex != null'>`user_sex` = #{userSex},</if>
<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 != ''">
${searchColumn} LIKE CONCAT('%',#{keyword},'%') AND
</if>
1=1
</where>
ORDER BY id ASC
return false;
}
if (document.getElementById("edit-houseArea").value.trim().length == 0) {
alert("面积不能为空");
return false;
}
if (document.getElementById("edit-houseStructure").value.trim().length == 0) {
alert("结构不能为空");
return false;
}
if (document.getElementById("edit-houseBuilding").value.trim().length == 0) {
alert("楼栋不能为空");
return false;
}
if (document.getElementById("edit-houseOwner").value.trim().length == 0) {
alert("业主不能为空");
char c = ch[i];
if (!Character.isLetterOrDigit(c)) {
if (!isChinese(c)) {
count = count + 1;
}
chLength++;
}
}
return count / chLength > 0.4;
}
/**
* 为防止页面传进来的内容因为编码不同等原因造成乱码,这里作统一的转换
*
* @param parameterName
* @return
}
//增加表单提交之前进行检查,如果return false,则不允许提交
function addCheck() {
//根据ID获取值
if (document.getElementById("add-username").value.trim().length == 0) {
alert("用户名不能为空");
return false;
}
if (document.getElementById("add-password").value.trim().length == 0) {
alert("密码不能为空");
return false;
}
if (document.getElementById("add-realName").value.trim().length == 0) {
alert("姓名不能为空");
return false;
}
<if test ='parkingName != null'>`parking_name` = #{parkingName},</if>
<if test ='parkingArea != null'>`parking_area` = #{parkingArea},</if>
<if test ='parkingStatus != null'>`parking_status` = #{parkingStatus},</if>
<if test ='parkingOwner != null'>`parking_owner` = #{parkingOwner}</if>
</set>
WHERE `id` = #{id}
</update>
<!--获取-->
<select id="findById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" /> FROM `t_parking` WHERE `id` = #{id}
</select>
<!--列表-->
<select id="findAllSplit" parameterType="java.util.Map" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" /> FROM `t_parking`
<where>
<if test="searchColumn != null and searchColumn != '' and keyword != null and keyword != ''">
${searchColumn} LIKE CONCAT('%',#{keyword},'%') AND
</if>
1=1
</where>
ORDER BY id ASC
<if test="startIndex != null and pageSize != null">
<div class="modal-footer">
<button type="button" class="btn btn-line btn-info" data-dismiss="modal">取消</button>
<button type="submit" class="btn btn-line btn-default">提交</button>
</div>
</form>
</div>
</div>
</div>
<!-- info -->
<div class="modal fade" id="modal-info" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
运行环境
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…均可
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
登录、注册、退出、用户模块、公告模块、投诉模块、房产模块、业主模块、车位模块的增删改查管理