基于javaweb+mysql的ssm汽车出租管理系统(java+ssm+jsp+jquery+mysql)
私信源码获取及调试交流
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SSM汽车出租管理系统(java+ssm+jsp+jquery+mysql)
项目介绍
本项目包含管理员、用户、技术人员、工作人员等四种角色;
管理员角色包含以下功能: 管理员登录,员工管理,车辆管理,公告管理,图片管理,统计管理等功能。
用户角色包含以下功能: 用户首页,用户登录,查看车辆,查看我的预定,预定租车,查看预定详情等功能。
技术人员角色包含以下功能: 技术人员登录,车辆状态管理等功能。
工作人员角色包含以下功能: 工作人员登录,车辆租赁管理,预定管理,留言管理,会员管理等功能。
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.数据库:MySql 5.7版本; 6.是否Maven项目:否;
技术栈
- 后端:Spring+SpringMVC+Mybatis 2. 前端:JSP+CSS+JavaScript+jquery
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中jdbc.properties配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入localhost:8080/ 登录
</TD>
</TR>
<TR height=4>
<TD colSpan=2></TD>
</TR>
</TABLE>
<TABLE cellSpacing=0 cellPadding=0 width=150 border=0>
<TR height=22>
<TD style="PADDING-LEFT: 30px" background=images/menu_bt.jpg>
<A class=menuParent onclick=expand(4)
href="javascript:void(0);">客户信息</A>
</TD>
</TR>
<TR height=4>
<TD></TD>
</TR>
</TABLE>
<TABLE id=child4 style="DISPLAY: none" cellSpacing=0 cellPadding=0
width=150 border=0>
<TR height=20>
<TD align=middle width=30><IMG height=9
src="images/menu_icon.gif" width=9></TD>
<TD><A class=menuChild href="userlist2.do" target=main>客户信息查询</A>
</TD>
</TR>
<TR height=4>
<TD colSpan=2></TD>
</TR>
</TABLE>
request.setAttribute("bean", bean);
request.setAttribute("title", "会员充值/续费页");
//return "vip/vipcharge.jsp";
}
}
<select id="selectBeanById" parameterType="com.entity.Yuding"
resultMap="yudingResultMap" >
select * from t_yuding where id=#{id}
</select>
<select id="selectBeanList" parameterType="string"
resultMap="yudingResultMap" >
select * from t_yuding
where 1=1
<if test="chepai != '' and chepai != null">
and chepai like '%' #{chepai} '%'
</if>
<if test="sfz != '' and sfz != null">
and sfz like '%' #{sfz} '%'
</if>
<if test="kehuid != 0">
and kehuid= #{kehuid}
</if>
<if test="workid != 0">
and workid= #{workid}
</if>
<if test="zhuangtai != '' and zhuangtai != null">
and zhuangtai like '%' #{zhuangtai} '%'
</if>
order by id desc
limit #{start}, #{limit}
</select>
<select id="selectBeanCount" parameterType="string"
resultType="int" >
select count(id) from t_yuding
where 1=1
<if test="chepai != '' and chepai != null">
and chepai like '%' #{chepai} '%'
</if>
<if test="sfz != '' and sfz != null">
and sfz like '%' #{sfz} '%'
</TR>
<TR height=20>
<TD align=middle width=30><IMG height=9
src="images/menu_icon.gif" width=9></TD>
<TD><A class=menuChild href="userlist4.do" target=main>普通客户</A>
</TD>
</TR>
<TR height=4>
<TD colSpan=2></TD>
</TR>
</TABLE>
</c:if>
<c:if test="${manage.role==3}">
<TABLE cellSpacing=0 cellPadding=0 width=150 border=0>
<TR height=22>
<TD style="PADDING-LEFT: 30px" background=images/menu_bt.jpg>
<A class=menuParent onclick=expand(1)
href="javascript:void(0);">车辆状态</A>
</TD>
</TR>
<TR height=4>
<TD></TD>
</TR>
</TABLE>
<TABLE id=child1 style="DISPLAY: none" cellSpacing=0 cellPadding=0
width=150 border=0>
<TR height=20>
<TD align=middle width=30><IMG height=9
src="images/menu_icon.gif" width=9></TD>
<TD><A class=menuChild href="jilulist3.do" target=main>待确认车辆</A>
this.discount = discount;
}
}
@Service("yudingService")
public class YudingServiceImpl implements YudingService {
@Resource
private YudingDao yudingDao;
public void insertBean(Yuding bean) {
yudingDao.insertBean(bean);
}
public void deleteBean(int id) {
yudingDao.deleteBean(id);
}
public void updateBean(Yuding bean){
yudingDao.updateBean(bean);
}
//根据ID查询对象
public Yuding selectBeanById(int id){
and kehuid=#{kehuid}
</if>
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
"http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd">
<mapper namespace="com.dao.YudingDao">
<resultMap id="yudingResultMap" type="com.entity.Yuding">
<id property="id" column="id"/>
<result property="xingming" column="xingming"/>
<result property="sfz" column="sfz"/>
<result property="dianhua" column="dianhua"/>
<result property="sfz2" column="sfz2"/>
<result property="jsz" column="jsz"/>
<result property="kehuid" column="kehuid"/>
<result property="zhuangtai" column="zhuangtai"/>
<result property="shijian1" column="shijian1"/>
<result property="shijian2" column="shijian2"/>
<result property="chepai" column="chepai"/>
<result property="carid" column="carid"/>
<result property="workid" column="workid"/>
<result property="beizhu" column="beizhu"/>
</resultMap>
<!-- 插入到数据库 -->
<insert id="insertBean"
parameterType="com.entity.Yuding">
insert into t_yuding (xingming,sfz,dianhua,sfz2,jsz,kehuid,zhuangtai,shijian1,shijian2,chepai,carid,workid,beizhu)
values (#{xingming},#{sfz},#{dianhua},#{sfz2},#{jsz},#{kehuid},#{zhuangtai},#{shijian1},#{shijian2},#{chepai},#{carid},#{workid},#{beizhu})
</insert>
<!-- 根据ID删除数据库的记录 -->
<delete id="deleteBean"
parameterType="int">
delete from t_yuding
<TABLE height=4 cellSpacing=0 cellPadding=0 width=1002 align=center
bgColor=#ffffff border=0>
<TBODY>
<TR>
<TD width=5><IMG height=3 src="qtimages/zjgdj_64.gif" width=5></TD>
<TD background=qtimages/zjgdj_65.gif><IMG height=3
src="qtimages/zjgdj_65.gif" width=1></TD>
<TD width=4><IMG height=3 src="qtimages/zjgdj_67.gif"
width=4></TD></TR></TBODY></TABLE>
<TABLE height=8 cellSpacing=0 cellPadding=0 width=1002 align=center
bgColor=#ffffff border=0>
<TBODY>
<TR>
<TD></TD></TR></TBODY></TABLE>
<%@ include file="qtdown.jsp"%>
</body>
</html>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
"http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd">
<mapper namespace="com.dao.UserDao">
<resultMap id="userResultMap" type="com.entity.User">
<id property="id" column="id"/>
<result property="username" column="username"/>
<result property="password" column="password"/>
<result property="createtime" column="createtime"/>
<result property="role" column="role"/>
<result property="name" column="name"/>
<result property="tej" column="tej"/>
<result property="sfz" column="sfz"/>
</resultMap>
<resultMap id="vipResultMap" type="com.entity.Vip">
<id property="id" column="id"/>
<result property="username" column="username"/>
<result property="points" column="points"/>
<result property="level" column="level"/>
<result property="enddate" column="enddate"/>
<result property="consumed" column="consumed"/>
</resultMap>
<!-- 插入到数据库 -->
<insert id="insertBean"
parameterType="com.entity.User">
insert into t_user (
username,
btn:{btn_bgColor:"#2d2d2d",btn_bgHoverColor:"#1072aa",btn_fontColor:"#FFF",btn_fontHoverColor:"#FFF",btn_borderColor:"#4a4a4a",btn_borderHoverColor:"#1188c0",btn_borderWidth:1}
});
})
</script>
<div id="MainMenu" class="ddsmoothmenu" >
<ul>
</ul>
</div>
<!-- js图片和图片得文字说明 -->
<div id="banner" style="margin-top: -40px;margin-left: 1px;" align="center" >
<c:forEach items="${piclist}" var="pic">
<a href="${pic.href }" ><img src="<%=basePath %>${pic.path }" alt="${pic.info }" width="284" height="251"/></a>
</c:forEach>
</div>
</TD>
<TD vAlign=bottom width=8> </TD>
<TD width="514" vAlign=top>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD vAlign=top><TABLE height=24 cellSpacing=0 cellPadding=0 width="100%"
border=0><TBODY>
<TR
style="BACKGROUND: url(qtimages/zjgdj_sy_15.gif) repeat-x 50% top">
<TD width=13></TD>
<TD style="FONT-SIZE: 14px; COLOR: #fff; BACKGROUND-REPEAT: no-repeat" align=middle width=89 background=qtimages/zjgdj_sy_16.gif>
<STRONG><a href="gonggaolist.do" ><font class="STYLE1">最新公告</font></a></STRONG>
</TD>
<TD width=27></TD>
<TD style="PADDING-RIGHT: 8px" align=right></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD style="PADDING-RIGHT: 8px; PADDING-LEFT: 8px; PADDING-BOTTOM: 8px; PADDING-TOP: 8px" vAlign=top class="newsline"><table class="newsline" cellspacing="0" cellpadding="0" width="98%" align="center" border="0">
<tbody>
<c:forEach items="${gonggaolist}" var="gonggao">
<tr>
<td width="4%" height="28" align="center" ><img src="qtimages/1011211706367381564.gif" width="3" height="5"></td>
<td width="80%" height="28"><a
</TR>
<TR height=20>
<TD align=middle width=30><IMG height=9
src="images/menu_icon.gif" width=9></TD>
<TD><A class=menuChild href="yuelist.do" target=main>月收入统计</A>
</TD>
</TR>
<TR height=20>
<TD align=middle width=30><IMG height=9
src="images/menu_icon.gif" width=9></TD>
<TD><A class=menuChild href="carlist4.do" target=main>车辆收入统计</A>
</TD>
</TR>
<TR height=4>
<TD colSpan=2></TD>
</TR>
</TABLE>
</c:if>
<!-- 工作1 -->
<c:if test="${manage.role==2}">
<TABLE cellSpacing=0 cellPadding=0 width=150 border=0>
<TR height=22>
<TD style="PADDING-LEFT: 30px" background=images/menu_bt.jpg>
<A class=menuParent onclick=expand(1)
href="javascript:void(0);">车辆租赁</A>
</TD>
</TR>
<TR height=4>
<TD></TD>
</TR>
</TABLE>
<TABLE id=child1 style="DISPLAY: none" cellSpacing=0 cellPadding=0
width=150 border=0>
this.workid = workid;
}
public User getWork() {
return work;
}
public void setWork(User work) {
this.work = work;
}
public int getJishuid() {
return jishuid;
}
public void setJishuid(int jishuid) {
this.jishuid = jishuid;
}
public User getJishu() {
return jishu;
}
public void setJishu(User jishu) {
this.jishu = jishu;
}
public String getSfz() {
return sfz;
}
public void setSfz(String sfz) {
this.sfz = sfz;
}
public String getDianhua() {
return dianhua;
}
public void setDianhua(String dianhua) {
this.dianhua = dianhua;
}
public String getXingming() {
return xingming;
}
public void setXingming(String xingming) {
this.xingming = xingming;
}
List<Liuyan> list = liuyanService.selectBeanList((currentpage - 1)
* pageSize, pageSize, ltitle,null,0,user.getId());
//列表返回页面
request.setAttribute("list", list);
//获取总数量
int total = liuyanService.selectBeanCount(ltitle,null,0,user.getId());
//分页信息返回页面
request.setAttribute("pagerinfo", Pager.getPagerNormal(total, pageSize,
currentpage, "liuyanlist2.do", "共有" + total + "条记录"));
//查询按钮
request.setAttribute("url", "liuyanlist2.do");
//添加,更新,删除等按钮
request.setAttribute("url2", "liuyan");
request.setAttribute("title", "我处理的留言");
return "liuyan/liuyanlist2.jsp";
}
//跳转到查看留言详情页面
@RequestMapping("/liuyanupdate3.do")
public String liuyanupdate3(HttpServletRequest request,int id) throws ParseException{
Liuyan bean = liuyanService.selectBeanById(id);
request.setAttribute("bean", bean);
request.setAttribute("title", "查看留言详情");
return "liuyan/liuyanupdate3.jsp";
}
//客户信息查询
@RequestMapping("/userlist2.do")
public String userlist2(HttpServletRequest request,String pagenum,String username){
}
//跳转到查看留言详情页面
@RequestMapping("/liuyanupdate3.do")
public String liuyanupdate3(HttpServletRequest request,int id) throws ParseException{
Liuyan bean = liuyanService.selectBeanById(id);
request.setAttribute("bean", bean);
request.setAttribute("title", "查看留言详情");
return "liuyan/liuyanupdate3.jsp";
}
//客户信息查询
@RequestMapping("/userlist2.do")
public String userlist2(HttpServletRequest request,String pagenum,String username){
//查询条件返回页面
if (username != null && !"".equals(username)) {
request.setAttribute("username", username);
}
//分页功能默认第一页
int currentpage = 1;
//获取当前页
if (pagenum != null) {
currentpage = Integer.parseInt(pagenum);
}
//查询列表
//根据ID查询对象
public User selectBeanById(int id){
return userDao.selectBeanById(id);
}
public List<User> selectBeanList(int start,int limit,String username ){
return userDao.selectBeanList(start,limit,username);
}
public int selectBeanCount(String username){
return userDao.selectBeanCount(username);
}
public List<User> selectBeanList2(int start,int limit,String username ){
return userDao.selectBeanList2(start,limit,username);
}
public int selectBeanCount2(String username){
return userDao.selectBeanCount2(username);
}
public List<Vip> selectBeanList3(int start,int limit,String username ){
return userDao.selectBeanList3(start,limit,username);
}
public int selectBeanCount3(String username){
request.setAttribute("xingming", xingming);
}
if (sfz != null && !"".equals(sfz)) {
request.setAttribute("sfz", sfz);
}
//分页功能默认第一页
int currentpage = 1;
//获取当前页
if (pagenum != null) {
currentpage = Integer.parseInt(pagenum);
}
HttpSession session = request.getSession();
User user = (User)session.getAttribute("manage");
//查询列表
List<Jilu> list = jiluService.selectBeanList((currentpage - 1)
* pageSize, pageSize, chepai,sfz,xingming,null,0,user.getId(),0);
for(Jilu jilu:list){
jilu.setCar(carService.selectBeanById(jilu.getCarid()));
}
//列表返回页面
request.setAttribute("list", list);
//获取总数量
int total = jiluService.selectBeanCount(chepai,sfz,xingming,null,0,user.getId(),0);
//分页信息返回页面
request.setAttribute("pagerinfo", Pager.getPagerNormal(total, pageSize,
currentpage, "jilulist4.do", "共有" + total + "条记录"));
//查询按钮
request.setAttribute("url", "jilulist4.do");
//添加,更新,删除等按钮
this.carid = carid;
}
public Car getCar() {
return car;
}
public void setCar(Car car) {
this.car = car;
}
public int getKehuid() {
return kehuid;
}
public void setKehuid(int kehuid) {
this.kehuid = kehuid;
}
public User getKehu() {
return kehu;
}
public void setKehu(User kehu) {
this.kehu = kehu;
}
public int getWorkid() {
return workid;
}
public void setWorkid(int workid) {
this.workid = workid;
}
public User getWork() {
return work;
}
public void setWork(User work) {
this.work = work;
}
this.carid = carid;
}
public Car getCar() {
return car;
}
public void setCar(Car car) {
this.car = car;
}
public int getKehuid() {
return kehuid;
}
public void setKehuid(int kehuid) {
this.kehuid = kehuid;
}
public User getKehu() {
return kehu;
}
public void setKehu(User kehu) {
this.kehu = kehu;
}
public int getWorkid() {
return workid;
}
public void setWorkid(int workid) {
this.workid = workid;
}
public User getWork() {
return work;
}
public void setWork(User work) {
<if test="username != '' and username != null">
and username like '%' #{username} '%'
</if>
order by id desc
limit #{start}, #{limit}
</select>
<select id="selectBeanCount2" parameterType="string"
resultType="int" >
select
count(id)
from
t_user
where 1=1
<if test="username != '' and username != null">
and username like '%' #{username} '%'
</if>
</select>
<select id="selectBeanList3" parameterType="string"
resultMap="vipResultMap" >
select
*
from
t_vip
where 1=1
<if test="username != '' and username != null">
and username like '%' #{username} '%'
</if>
order by id desc
limit #{start}, #{limit}
</select>
<select id="selectBeanCount3" parameterType="string"
resultType="int" >
select
count(id)
from
t_vip
where 1=1
<if test="username != '' and username != null">
and username like '%' #{username} '%'
</if>
</select>
<select id="selectBeanList4" parameterType="string"
resultMap="userResultMap" >
@RequestMapping("/liuyanlist2.do")
public String liuyanlist2(HttpServletRequest request,String pagenum,String ltitle ){
HttpSession session = request.getSession();
User user = (User)session.getAttribute("manage");
//查询条件返回页面
if (ltitle != null && !"".equals(ltitle)) {
request.setAttribute("ltitle", ltitle);
}
//分页功能默认第一页
int currentpage = 1;
//获取当前页
if (pagenum != null) {
currentpage = Integer.parseInt(pagenum);
}
//查询列表
List<Liuyan> list = liuyanService.selectBeanList((currentpage - 1)
* pageSize, pageSize, ltitle,null,0,user.getId());
//列表返回页面
request.setAttribute("list", list);
//获取总数量
int total = liuyanService.selectBeanCount(ltitle,null,0,user.getId());
//分页信息返回页面
request.setAttribute("pagerinfo", Pager.getPagerNormal(total, pageSize,
currentpage, "liuyanlist2.do", "共有" + total + "条记录"));
//查询按钮
request.setAttribute("url", "liuyanlist2.do");
//添加,更新,删除等按钮
request.setAttribute("url2", "liuyan");
request.setAttribute("title", "我处理的留言");
return "liuyan/liuyanlist2.jsp";
}
//跳转到查看留言详情页面
@RequestMapping("/liuyanupdate3.do")