部分代码片段—人力资源管理系统(第二阶段)
一、系统首页前端代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title>head</title>
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</head>
<body>
<div class="hrms_brand_nav">
<nav class="navbar navbar-inverse navbar-static-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#hrms-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">XXX公司LOGO</a>
</div>
<div class="collapse navbar-collapse" id="hrms-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active">
<a href="#">公司介绍 <span class="sr-only">(current)</span> </a>
</li>
<li><a href="#">人力资源部</a></li>
<li><a href="#">请假申请</a></li>
<li><a href="#">报销申请</a></li>
<li><a href="#">出勤记录</a></li>
</ul>
<form class="navbar-form navbar-left">
<div class="form-group">
<input type="text" class="form-control" placeholder="站内搜索">
</div>
<button type="submit" class="btn btn-default">搜索</button>
</form>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">账号管理 <span class="caret"></span></a>
<ul class="dropdown-menu nav nav-pills nav-stacked">
<li class="active"><a href="#"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> 修改信息</a></li>
<li><a href="#"><span class="glyphicon glyphicon-user" aria-hidden="true"></span> 头像更换</a></li>
<li class="hrms_logout"><a href="#"><span class="glyphicon glyphicon-off" aria-hidden="true"></span> 账号退出</a></li>
</ul>
</li>
</ul><!-- /.nav navbar-nav navbar-right -->
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
</div><!-- /.hrms_brand_nav -->
</body>
</html>
二、后台主函数代码(main.jsp):
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>XXX公司人力资源系统后台</title>
</head>
<body>
<div class="hrms_container">
<%@ include file="./commom/head.jsp"%>
<div class="hrms_body" style="position:relative; top:-15px;">
<%@ include file="./commom/leftsidebar.jsp"%>
<div class="hrms_main_ad col-sm-10">
<div class="panel panel-success">
<div class="panel-heading">
<h3 style="text-align: center;">欢迎进入XXX公司人力资源管理系统!</h3>
</div>
<div class="panel-body" style="position:relative; top:-15px;">
<div id="hrms_carousel_1" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#hrms_carousel_1" data-slide-to="0" class="active"></li>
<li data-target="#hrms_carousel_1" data-slide-to="1"></li>
<li data-target="#hrms_carousel_1" data-slide-to="2"></li>
</ol>
<div class="carousel-inner" role="listbox">
<div class="item active" style="text-align: center;">
<img class="img-responsive center-block" src="/static/img/company1.jpg" alt="company1">
<div class="carousel-caption">
<h3>漂亮大气的办公楼</h3>
</div>
</div>
<div class="item">
<img class="img-responsive center-block" src="/static/img/company2.jpg" alt="company2">
<div class="carousel-caption">
<h3>休闲的放松场所</h3>
</div>
</div>
<div class="item">
<img class="img-responsive center-block" src="/static/img/company3.jpg" alt="company3">
<div class="carousel-caption">
<h3>舒适的办公环境</h3>
</div>
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#chrms_carousel_1" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#hrms_carousel_1" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div><!-- /#hrms_carousel_1 -->
</div><!-- /.panel-body -->
</div><!-- /.panel -->
</div><!-- /.hrms_main_ad -->
</div><!-- /.hrms_body -->
<!-- 尾部 -->
<%@ include file="./commom/foot.jsp"%>
</div><!-- /.hrms_container -->
</body>
</html>
三、系统数据库后台代码(departmentService.java):
package com.hrms.service;
import com.hrms.bean.Department;
import com.hrms.mapper.DepartmentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class DepartmentService {
@Autowired
DepartmentMapper departmentMapper;
public int deleteDeptById(Integer deptId){
return departmentMapper.deleteDeptById(deptId);
}
public int updateDeptById(Integer deptId, Department department){
return departmentMapper.updateDeptById(deptId, department);
}
public int addDept(Department department){
return departmentMapper.insertDept(department);
}
public int getDeptCount(){
return departmentMapper.countDepts();
}
public List<Department> getDeptList(Integer offset, Integer limit){
return departmentMapper.selectDeptsByLimitAndOffset(offset, limit);
};
public Department getDeptById(Integer deptId){
return departmentMapper.selectOneById(deptId);
}
public Department getDeptByName(String deptName){
return departmentMapper.selectOneByName(deptName);
}
public List<Department> getDeptName(){
return departmentMapper.selectDeptList();
}
}