基于Jsp+Servlet的汽车保险系统(原创毕业设计源码)

2021/9/8 22:06:21

本文主要是介绍基于Jsp+Servlet的汽车保险系统(原创毕业设计源码),对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

项目类型:JAVA WEB项目
项目名称:基于Jsp+Servlet的汽车保险系统
用户类型:3个角色(管理员+用户)
系统类型:前端网站+后台系统
设计模式:Jsp+Servlet
开发工具:Eclipse /IDEA都可以使用
数据库:Mysql+Navicat
数据库表:6张
适用:软件工程、计算机科学与技术等JAVA课程的学习和实验

 视频演示在下方

原创项目,开发不易,感谢支持!!

项目来源:公众号“学长源码”咨询

用户端功能介绍

网站首页

注册与登录

用户办理汽车保险

办理过的保险、理赔

个人信息修改

业务员端功能介绍

保险处理 对于用的的理赔进行受理

客户理赔记录

个人信息管理

管理员端功能介绍

客户管理

保险管理

业务员管理

演示视频

<iframe allowfullscreen="true" data-mediaembed="bilibili" id="lxEEPBOf-1631108696734" src="https://player.bilibili.com/player.html?aid=292969424"></iframe>

毕设源码项目——基于Jsp+Servlet的汽车保险系统

数据库表

项目结构

多用户登录代码实战

用户登录表单

      <form action="LoginServlet?action=login" method="post"  id="loginForm" name="loginForm">
            <legend>登录</legend>
            <div class="layui-form-item" style="margin-bottom: 4px;">
              <div class="layui-inline veri-code">
                <div class="layui-input-inline">
                  <input type="text" name="userName" id="userName" lay-verify="required" placeholder="请输入用户名或者手机号" autocomplete="off" class="layui-input">
                <span id="msg3" style="color:red">${message}</span>
                </div>
              </div>
              <div class="layui-inline veri-code">
                <div class="layui-input-inline">
                  <input id="password" type="password" name="password" lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
                </div>
              </div>
              
               <div class="layui-inline veri-code">
                <div class="layui-input-inline">
                 <select name="type" id="type" style="height: 35px;width: 100%;">
                  <option value="">请选择角色</option>
                    <option value="1">管理员</option> 
                    <option value="2">用户</option>
                    <option value="3">业务员</option>
                </select>
                </div>
              </div>
         
         
            </div>
            <div class="layui-form-item login-btn">
              <div class="layui-input-block">
                <button class="layui-btn"  lay-submit="" id="login" lay-filter="demo1" >登录</button>
              </div>
            </div>
          </form>

LoginServlet

package com.qcbx.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.qcbx.entity.Admin;
import com.qcbx.entity.Saler;
import com.qcbx.entity.User;
import com.qcbx.service.LoginService;
import com.qcbx.service.impl.LoginServiceImpl;

public class LoginServlet extends HttpServlet{
	
	private LoginService ls = new LoginServiceImpl();

	@Override
	protected void doPost(HttpServletRequest request, HttpServletResponse response)
				throws ServletException, IOException {
		    String action=request.getParameter("action");//接受请求的参数
		   // check(request,response,action);
		   if(action != null && action.equals("toLogin")) {//去登录页面
		    	toLogin(request, response);
			}else if(action != null && action.equals("login")) {//登录
		    	login(request, response);
			}else if(action != null && action.equals("LoginOutAct")) {//退出
				LoginOutAct(request, response);
			}else if(action != null && action.equals("welcome")) {//默认页面
				welcome(request, response);
			}else if(action != null && action.equals("toRegsite")) {//去注册
				toRegsite(request, response);
			}else if(action != null && action.equals("registe")) {//注册
				registe(request, response);
			}
		   
		}

	/**
	 * 注册
	 * @param request
	 * @param response
	 */
	private void registe(HttpServletRequest request,
			HttpServletResponse response) {

		
	}

	/**
	 * 去注册页面
	 * @param request
	 * @param response
	 */
	private void toRegsite(HttpServletRequest request,
			HttpServletResponse response) {
	    try {
			request.getRequestDispatcher("/client/register.jsp").forward(request, response);
		 } catch (Exception e) {
		 	e.printStackTrace();
		 }
		
	}

	private void check(HttpServletRequest request,
			HttpServletResponse response, String action) {
		if(request.getSession().getAttribute("user") == null 
	    		&& request.getSession().getAttribute("saler") == null
	    		&& request.getSession().getAttribute("admin") == null
	    		&& !action.equals("login") && !action.equals("toRegsite")
	    		&& !action.equals("registe")){
			toLogin(request, response);
	    }
		
	}

	/**
	 * 退出
	 * @param request
	 * @param response
	 */
	private void LoginOutAct(HttpServletRequest request,
			HttpServletResponse response) {
		try {
			request.getSession().removeAttribute("admin");
			request.getSession().removeAttribute("saler");
			request.getSession().removeAttribute("user");
			request.getSession().removeAttribute("flag");
			//response.sendRedirect(request.getContextPath()+"/LoginServlet?action=toLogin");
			response.sendRedirect(request.getContextPath()+"/BxServlet?action=bxUserList");
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}

	/**
	 * 登录
	 * @param request
	 * @param response
	 */
	private void login(HttpServletRequest request, HttpServletResponse response) {
		removeAll(request,response);
		String userName = request.getParameter("userName");
		String password = request.getParameter("password");
		String type = request.getParameter("type");
		if(type != null && type.equals("1")){
			Admin admin = new Admin();
			admin.setUserName(userName);
			admin.setPwd(password);
			Admin admin1 = ls.selectAdmin(admin);
		    try {
				 if (admin1 == null){
		        	  request.setAttribute("message", "管理员用户不存在或者密码错误");
					  request.getRequestDispatcher("/client/login.jsp").forward(request, response);
		         }else {
		        	  request.getSession().setAttribute("admin",admin1);
		        	  request.getSession().setAttribute("flag",1);
		              request.getRequestDispatcher("/WEB-INF/view/main.jsp").forward(request, response);
		         }				
			 } catch (Exception e) {
			 	e.printStackTrace();
			 }
			 
		}else if(type != null && type.equals("2")){
			User user =new User();
			user.setPhone(userName);
			user.setPwd(password);
			User user1 = ls.selectUser(user);
			try{
				if(user1 == null){
					request.setAttribute("message", "用户手机号不存在或者密码错误");
					request.getRequestDispatcher("/client/login.jsp").forward(request, response);
				}else{
				    request.getSession().setAttribute("user",user1);
	        	    request.getSession().setAttribute("flag",2);
	                //request.getRequestDispatcher("/client/shouye.jsp").forward(request, response);
	    			response.sendRedirect(request.getContextPath()+"/BxServlet?action=bxUserList");
				}
			}catch(Exception e){
			 	e.printStackTrace();
			}
		}else if(type != null && type.equals("3")){
			Saler saler = new Saler();
			saler.setPhone(userName);
			saler.setPwd(password);
			Saler saler1 = ls.selectSaler(saler);
			try{
				if(saler1 == null){
					request.setAttribute("message", "业务员手机号不存在或者密码错误");
					request.getRequestDispatcher("/client/login.jsp").forward(request, response);
				}else{
				    request.getSession().setAttribute("saler",saler1);
	        	    request.getSession().setAttribute("flag",3);
	                request.getRequestDispatcher("/WEB-INF/view/main.jsp").forward(request, response);
				}
			}catch(Exception e){
			 	e.printStackTrace();
			}
		}else{
			try{
				request.setAttribute("message", "请选择角色");
				request.getRequestDispatcher("/client/login.jsp").forward(request, response);
			}catch(Exception e){
			 	e.printStackTrace();
			}
		}
	}
	

	/**
	 * 去登陆页面
	 * @param request
	 * @param response
	 */
	private void toLogin(HttpServletRequest request,
			HttpServletResponse response) {
	 	 try {
			    request.getRequestDispatcher("/client/login.jsp").forward(request, response);
			}catch(Exception e){
				e.printStackTrace();
			}  
		   	return;
	}
	
	private void removeAll(HttpServletRequest request,
			HttpServletResponse response) {
		request.removeAttribute("admin");
		request.removeAttribute("saler");
		request.removeAttribute("user");
		request.removeAttribute("flag");
	}
	
	private void welcome(HttpServletRequest request,
			HttpServletResponse response) {
        try {
			request.getRequestDispatcher("/WEB-INF/view/console.jsp").forward(request,response);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doPost(request, response);
	}
}

LoginService

package com.qcbx.service;

import com.qcbx.entity.Admin;
import com.qcbx.entity.Saler;
import com.qcbx.entity.User;

public interface LoginService {

	Admin selectAdmin(Admin admin);

	User selectUser(User user);

	Saler selectSaler(Saler saler);

}

LoginServiceImpl

package com.qcbx.service.impl;

import com.qcbx.dao.LoginDao;
import com.qcbx.dao.impl.LoginDaoImpl;
import com.qcbx.entity.Admin;
import com.qcbx.entity.Saler;
import com.qcbx.entity.User;
import com.qcbx.service.LoginService;

public class LoginServiceImpl implements LoginService{
	
	private LoginDao ld = new LoginDaoImpl();

	@Override
	public Admin selectAdmin(Admin admin) {
		return ld.selectAdmin(admin);
	}

	@Override
	public User selectUser(User user) {
		return ld.selectUser(user);
	}

	@Override
	public Saler selectSaler(Saler saler) {
		return ld.selectSaler(saler);
	}

}

LoginDao

package com.qcbx.dao;

import com.qcbx.entity.Admin;
import com.qcbx.entity.Saler;
import com.qcbx.entity.User;

public interface LoginDao {

	Admin selectAdmin(Admin admin);

	User selectUser(User user);

	Saler selectSaler(Saler saler);

}

LoginDaoImpl

package com.qcbx.dao.impl;

import java.sql.SQLException;

import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanHandler;

import com.qcbx.dao.LoginDao;
import com.qcbx.entity.Admin;
import com.qcbx.entity.Saler;
import com.qcbx.entity.User;
import com.qcbx.utils.C3p0Utils;

public class LoginDaoImpl implements LoginDao{

	private QueryRunner runner=new QueryRunner(C3p0Utils.getDs());

	
	@Override
	public Admin selectAdmin(Admin admin) {
		try {//返回查询的信息
            return runner.query("select * from admin where userName=? and pwd=?", 
            		new BeanHandler<Admin>(Admin.class),admin.getUserName(),admin.getPwd());
        } catch (SQLException e) {
            throw new RuntimeException("管理员登录异常!",e);//抛出运行异常
        }
		
	}


	@Override
	public User selectUser(User user) {
		try {//返回查询的信息
            return runner.query("select * from user where phone=? and pwd=?", 
            		new BeanHandler<User>(User.class),user.getPhone(),user.getPwd());
        } catch (SQLException e) {
            throw new RuntimeException("用户登录异常!",e);//抛出运行异常
        }
	}


	@Override
	public Saler selectSaler(Saler saler) {
		try {//返回查询的信息
            return runner.query("select * from saler where phone=? and pwd=?", 
            		new BeanHandler<Saler>(Saler.class),saler.getPhone(),saler.getPwd());
        } catch (SQLException e) {
            throw new RuntimeException("业务员登录异常!",e);//抛出运行异常
        }
	}

}

用户增删改查Servlet

package com.qcbx.servlet;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.UUID;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;

import com.qcbx.entity.User;
import com.qcbx.service.UserService;
import com.qcbx.service.impl.UserServiceImpl;

public class UserServlet extends HttpServlet{

	private UserService us = new UserServiceImpl();
	
	@Override
	protected void doPost(HttpServletRequest request, HttpServletResponse response)
				throws ServletException, IOException {
		    String action=request.getParameter("action");//接受请求的参数
		    if(action != null && action.equals("userListLike")) {//模糊查询用户列表
		    	userListLike(request, response);
			}else if(action != null && action.equals("userList")){//分页查询用户列表
				userList(request, response);
			}else if(action != null && action.equals("toAddUser")){//去新增用户页面
				toAddUser(request, response);
			}else if(action != null && action.equals("addUser")){//新增用户
				addUser(request, response);
			}else if(action != null && action.equals("toUpdateUser")){//去用户修改页面
				toUpdateUser(request, response);
			}else if(action != null && action.equals("updateUser")){//用户修改
				updateUser(request, response);
			}else if(action != null && action.equals("deleteUser")){//用户删除
				deleteUser(request, response);
			}else if(action != null && action.equals("wdxx")){//页面首页我的信息
				wdxx(request, response);
			}
		    
		}

	/**
	 * 我的信息
	 * @param request
	 * @param response
	 */
	private void wdxx(HttpServletRequest request, HttpServletResponse response) {
		try {
			request.getRequestDispatcher("/client/wdxx.jsp").forward(request,response);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * 删除用户
	 * @param request
	 * @param response
	 */
	private void deleteUser(HttpServletRequest request,
			HttpServletResponse response) {
		String id = request.getParameter("id");
		try {
			us.deleteUser(id);
 			response.sendRedirect(request.getContextPath()+"/UserServlet?action=userList");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * 修改用户
	 * @param request
	 * @param response
	 */
	private void updateUser(HttpServletRequest request,
			HttpServletResponse response) {
		String id = request.getParameter("userId");
		String name = request.getParameter("name");
		String pwd = request.getParameter("pwd");
		String phone = request.getParameter("phone");
		String email = request.getParameter("email");
		String cno = request.getParameter("cno");
		String cname = request.getParameter("cname");
		String cph = request.getParameter("cph");
		String address = request.getParameter("address");
        User user = new User();
        user.setAddress(address);
        user.setCname(cname);
        user.setCno(cno);
        user.setCph(cph);
        user.setEmail(email);
        user.setId(Integer.parseInt(id));
        user.setName(name);
        user.setPhone(phone);
        user.setPwd(pwd);
        us.updateUser(user);
        Object flag = request.getSession().getAttribute("flag");
		if(flag != null && flag.toString().equals("1")){
			try {
	 			response.sendRedirect(request.getContextPath()+"/UserServlet?action=userList");
			} catch (Exception e) {
				e.printStackTrace();
			}
		}else{
			User user1 = us.selectUserById(id);
			request.getSession().setAttribute("user", user1);
			try {
				request.getRequestDispatcher("/client/wdxx.jsp").forward(request,response);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
       
        
	}

	/**
	 * 去用户修改页面
	 * @param request
	 * @param response
	 */
	private void toUpdateUser(HttpServletRequest request,
			HttpServletResponse response) {
		Object flag = request.getSession().getAttribute("flag");
		if(flag != null && flag.toString().equals("1")){
			String id = request.getParameter("id");
			User user = us.selectUserById(id);
			request.getSession().setAttribute("user", user);
			try {
				request.getRequestDispatcher("/WEB-INF/view/user/updateUser.jsp").forward(request,response);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}else{
			try {
				request.getRequestDispatcher("/WEB-INF/view/user/updateUser.jsp").forward(request,response);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
		
	}

	/**
	 * 新增用户
	 * @param request
	 * @param response
	 */
	private void addUser(HttpServletRequest request,
			HttpServletResponse response) {
		String temp = request.getParameter("temp");
		User user = fileUpload(request);
        us.addUser(user);
		if(temp != null && temp.equals("1")){
			try {
				response.sendRedirect(request.getContextPath()+"/LoginServlet?action=toLogin");
			} catch (IOException e) {
				e.printStackTrace();
			}
		}else{
			try {
				response.sendRedirect(request.getContextPath()+"/UserServlet?action=userList");
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
        

	}

	/**
	 * 新增用户车辆图片上传
	 * @param request
	 * @return
	 */
	private User fileUpload(HttpServletRequest request) {
		User user=new User();
		try {
		DiskFileItemFactory factory = new DiskFileItemFactory();
		ServletFileUpload upload = new ServletFileUpload(factory);
		List<FileItem> list = upload.parseRequest(request);
		for(FileItem item : list){
			if(item.isFormField()){
				String name = item.getFieldName();
				String value = item.getString("UTF-8");
				BeanUtils.setProperty(user, name, value);
			}else{
				String filename = item.getName();
				String savefilename = makeFileName(filename);
				String savepath="C:\\WorkspaceForZGN\\qcbx\\WebContent\\img\\";
				InputStream in = item.getInputStream();
				FileOutputStream out = new FileOutputStream(savepath + "\\" + savefilename);
				int len = 0;
				byte buffer[] = new byte[1024];
				while((len = in.read(buffer)) > 0){
					out.write(buffer, 0, len);
				}
				in.close();
				out.close();
				item.delete();
				user.setImgUrl("/img/"+savefilename);
				System.out.println(user.getImgUrl());
			}
		}
	        return user;
		} catch (Exception e) {
			e.printStackTrace();
			throw new RuntimeException(e);
		}
	}


	private String makeFileName(String filename) {
		String ext = filename.substring(filename.lastIndexOf(".") + 1);
		return UUID.randomUUID().toString() + "." + ext;
	}


	/**
	 * 去新增用户页面
	 * @param request
	 * @param response
	 */
	private void toAddUser(HttpServletRequest request,
			HttpServletResponse response) {
		try {
			request.getRequestDispatcher("/WEB-INF/view/user/addUser.jsp").forward(request,response);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}


	/**
	 * 分页查询用户列表
	 * @param request
	 * @param response
	 */
	private void userList(HttpServletRequest request,
			HttpServletResponse response) {
		    String p=request.getParameter("p");//接收页码
	        int pageSize=4;//每页显示5条
	        int pageNum=1; //默认第一页
	        if(p!=null){
	            pageNum= Integer.parseInt(p);
	        }
	        //调用分页查询
	        List<User> list=us.getUserListPage(pageNum,pageSize);
	        //携带参数到页面
	       // request.setAttribute("userList",bList); //绑定参数
	        int nums=us.queryUserCount(); //查询总数
	        //计算总页数
	        int totalPage=(nums%pageSize==0)? (nums/pageSize):(nums/pageSize+1);
	        request.setAttribute("cp",pageNum); //当前页
	        request.setAttribute("tp",totalPage); //总页数
			try {
	         request.removeAttribute("msg");
	         request.setAttribute("list" ,list);
	           request.getRequestDispatcher("/WEB-INF/view/user/userList.jsp").forward(request, response);
			} catch (Exception e) {
				e.printStackTrace();
			}
	}


	/**
	 * 模糊查询用户列表
	 * @param request
	 * @param response
	 */
	private void userListLike(HttpServletRequest request,
			HttpServletResponse response) {
		try {
	   		   String name = request.getParameter("name");
	           List<User> list=us.selectUserList(name);
	           request.removeAttribute("msg");
	           request.setAttribute("list" ,list);
	           request.getRequestDispatcher("/WEB-INF/view/user/userList.jsp").forward(request, response);
			} catch (Exception e) {
				e.printStackTrace();
			}		
	}


	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doPost(request, response);
	}
}

数据库表的建立

/*
 Navicat Premium Data Transfer

 Source Server         : project
 Source Server Type    : MySQL
 Source Server Version : 50715
 Source Host           : localhost:3306
 Source Schema         : db_qcbx

 Target Server Type    : MySQL
 Target Server Version : 50715
 File Encoding         : 65001

 Date: 01/04/2021 16:21:47
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for admin
-- ----------------------------
DROP TABLE IF EXISTS `admin`;
CREATE TABLE `admin`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `userName` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户名',
  `pwd` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '密码',
  `nickName` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '昵称',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of admin
-- ----------------------------
INSERT INTO `admin` VALUES (1, 'admin', '123456', '管理员');

-- ----------------------------
-- Table structure for bx
-- ----------------------------
DROP TABLE IF EXISTS `bx`;
CREATE TABLE `bx`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `bname` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '保险名称',
  `detail` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '保险内容',
  `fxrq` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '发行日期',
  `s_id` int(11) NULL DEFAULT NULL COMMENT '业务员,关联saler表的id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of bx
-- ----------------------------
INSERT INTO `bx` VALUES (1, '第三者责任险', '这个是赔付第三方人和物的,一般是建议购买50万,如果经济允许我是建议你购买100万的,因为有人员伤亡的时候50万是不够赔付的。', '2021-03-29 14:39', 1);
INSERT INTO `bx` VALUES (3, '车损险', '你是新车新手的话我是建议你购买的,买了车损险,发生出险事故时候修自己的车是有保险公司赔付的。', '2021-03-29 14:48', 1);
INSERT INTO `bx` VALUES (4, '交强险', '交强险 这个是必须买的,这个是没什么疑问,这个是国家规定的,不买是不能上路,上牌年检的。', '2021-03-29 14:52', 3);

-- ----------------------------
-- Table structure for jl
-- ----------------------------
DROP TABLE IF EXISTS `jl`;
CREATE TABLE `jl`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `bname` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '保险名称',
  `detail` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '保险内容',
  `blrq` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '办理日期',
  `blsc` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '保险办理时长',
  `blr` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '办理人姓名',
  `cname` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '车辆名称',
  `cph` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '车号牌',
  `type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '车辆类型',
  `imgUrl` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '车辆图片',
  `u_id` int(10) NULL DEFAULT NULL COMMENT '办理人id',
  `b_id` int(10) NULL DEFAULT NULL COMMENT '保险id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of jl
-- ----------------------------
INSERT INTO `jl` VALUES (1, '第三者责任险', '这个是赔付第三方人和物的,一般是建议购买50万,如果经济允许我是建议你购买100万的,因为有人员伤亡的时候50万是不够赔付的。', '2021-03-30 10:44', '2年', '张三', '宝马530', '苏M99999', '小轿车', '/img/4f21ad35-4db9-4e36-9b47-52c86a8b1a40.jpg', 1, 1);
INSERT INTO `jl` VALUES (2, '交强险', '交强险 这个是必须买的,这个是没什么疑问,这个是国家规定的,不买是不能上路,上牌年检的。', '2021-03-30 14:19', '1年', '张三', '宝马530', '苏M99999', '小轿车', '/img/4f21ad35-4db9-4e36-9b47-52c86a8b1a40.jpg', 1, 4);

-- ----------------------------
-- Table structure for lpsh
-- ----------------------------
DROP TABLE IF EXISTS `lpsh`;
CREATE TABLE `lpsh`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键、自增',
  `bname` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '保险名称',
  `detail` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '保险内容',
  `blrq` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '办理日期',
  `blr` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '办理人',
  `blsc` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '保险办理时长',
  `bz` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
  `status` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '0表示拒绝理赔,1表示审核中,2表示理赔成功',
  `s_id` int(11) NULL DEFAULT NULL COMMENT '业务员,关联saler表的id',
  `cname` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '车辆名称',
  `cph` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '车牌号',
  `type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '车辆类型',
  `imgUrl` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '车辆图片',
  `j_id` int(10) NULL DEFAULT NULL COMMENT '办理保险记录表id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of lpsh
-- ----------------------------
INSERT INTO `lpsh` VALUES (1, '第三者责任险', '这个是赔付第三方人和物的,一般是建议购买50万,如果经济允许我是建议你购买100万的,因为有人员伤亡的时候50万是不够赔付的。', '2021-03-30 10:44', '张三', '2年', '保险质量太差了,申请理赔', '2', 1, '宝马530', '苏M99999', '小轿车', '/img/4f21ad35-4db9-4e36-9b47-52c86a8b1a40.jpg', 1);

-- ----------------------------
-- Table structure for saler
-- ----------------------------
DROP TABLE IF EXISTS `saler`;
CREATE TABLE `saler`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '姓名',
  `sex` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '性别',
  `pwd` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '密码',
  `phone` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '手机号',
  `email` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '邮箱',
  `address` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '家庭住址',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of saler
-- ----------------------------
INSERT INTO `saler` VALUES (1, '小明', '男', '123456', '13622221111', 'xiaoming@qq.com', '江苏省南京市');
INSERT INTO `saler` VALUES (3, '小红', '女', '123456', '13622223333', 'xiaohong@qq.com', '江苏省南京市');

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '姓名',
  `sex` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '性别',
  `pwd` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '登录密码',
  `phone` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '手机号',
  `email` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '邮箱',
  `cno` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '身份证号',
  `cname` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '车辆名称',
  `cph` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '车牌号',
  `type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '车辆类型',
  `imgUrl` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '车辆图片',
  `address` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '家庭住址',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of user
-- ----------------------------
INSERT INTO `user` VALUES (1, '张三', '男', '123456', '15365129999', 'zhangsan@qq.com', '321283199805059999', '宝马530', '苏M99999', '小轿车', '/img/4f21ad35-4db9-4e36-9b47-52c86a8b1a40.jpg', '江苏省南京市雨花台区1');
INSERT INTO `user` VALUES (2, '李四', '男', '123456', '13912345678', 'lisi@qq.com', '321283199823239999', '奥迪A6L', '苏M89893', '小轿车', '/img/6d189381-a25f-4aa6-aff5-7d886e5f1589.jpg', '江苏省泰州市泰兴市鼓楼路');

SET FOREIGN_KEY_CHECKS = 1;



这篇关于基于Jsp+Servlet的汽车保险系统(原创毕业设计源码)的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程