基于SSM的租赁管理系统0.3_20161225_数据库设计
数据库设计
1. 概念模型

2. 类模型

3. 生成SQL
use test;
/*==============================================================*/
/* DBMS name: MySQL 5.0 */
/* Created on: 2016/12/25 19:51:49 */
/*==============================================================*/ drop table if exists cars; drop table if exists checks; drop table if exists clients; drop table if exists items; drop table if exists loginlog; drop table if exists privileges; drop table if exists rents; drop table if exists role_privilege; drop table if exists roles; drop table if exists systemlog; drop table if exists user_role; drop table if exists users; /*==============================================================*/
/* Table: cars */
/*==============================================================*/
create table cars
(
carid int not null,
carno varchar(40),
type varchar(30),
color varchar(30),
value decimal,
rentprice decimal,
deposit decimal,
isrented bool,
description varchar(500),
primary key (carid)
); /*==============================================================*/
/* Table: checks */
/*==============================================================*/
create table checks
(
checkid int not null,
uid int,
rentid int,
checkdate datetime,
status varchar(30),
problem varchar(80),
indemnify decimal,
primary key (checkid)
); /*==============================================================*/
/* Table: clients */
/*==============================================================*/
create table clients
(
cid int not null,
cname varchar(40),
cidentity varchar(40),
phone varchar(20),
address varchar(80),
sex varchar(10),
occupation varchar(40),
primary key (cid)
); /*==============================================================*/
/* Table: items */
/*==============================================================*/
create table items
(
iid int not null,
iname varchar(40),
icon varchar(80),
primary key (iid)
); /*==============================================================*/
/* Table: loginlog */
/*==============================================================*/
create table loginlog
(
lid int not null,
uid int,
ip varchar(40),
logintime datetime,
primary key (lid)
); /*==============================================================*/
/* Table: privileges */
/*==============================================================*/
create table privileges
(
pid int not null,
iid int,
pname varchar(40),
purl varchar(80),
primary key (pid)
); /*==============================================================*/
/* Table: rents */
/*==============================================================*/
create table rents
(
rentid int not null,
uid int,
cid int,
carid int,
imprest decimal,
price decimal,
realpay decimal,
begindate datetime,
enddate datetime,
realenddate datetime,
rentstatus varchar(20),
primary key (rentid)
); /*==============================================================*/
/* Table: role_privilege */
/*==============================================================*/
create table role_privilege
(
rid int not null,
pid int not null,
primary key (rid, pid)
); /*==============================================================*/
/* Table: roles */
/*==============================================================*/
create table roles
(
rid int not null,
rname varchar(40),
primary key (rid)
); /*==============================================================*/
/* Table: systemlog */
/*==============================================================*/
create table systemlog
(
sid int not null,
uid int,
action varchar(50),
actiontime datetime,
primary key (sid)
); /*==============================================================*/
/* Table: user_role */
/*==============================================================*/
create table user_role
(
uid int not null,
rid int not null,
primary key (uid, rid)
); /*==============================================================*/
/* Table: users */
/*==============================================================*/
create table users
(
uid int not null,
username varchar(40),
password varchar(40),
uidentity varchar(40),
realname varchar(40),
sex varchar(10),
address varchar(80),
phone varchar(20),
position varchar(20),
enrolldate datetime,
primary key (uid)
); alter table checks add constraint FK_check_rent foreign key (rentid)
references rents (rentid) on delete restrict on update restrict; alter table checks add constraint FK_check_user foreign key (uid)
references users (uid) on delete restrict on update restrict; alter table loginlog add constraint FK_loginlog_user foreign key (uid)
references users (uid) on delete restrict on update restrict; alter table privileges add constraint FK_privilege_item foreign key (iid)
references items (iid) on delete restrict on update restrict; alter table rents add constraint FK_rent_car foreign key (carid)
references cars (carid) on delete restrict on update restrict; alter table rents add constraint FK_rent_client foreign key (cid)
references clients (cid) on delete restrict on update restrict; alter table rents add constraint FK_rent_user foreign key (uid)
references users (uid) on delete restrict on update restrict; alter table role_privilege add constraint FK_role_privilege foreign key (rid)
references roles (rid) on delete restrict on update restrict; alter table role_privilege add constraint FK_role_privilege2 foreign key (pid)
references privileges (pid) on delete restrict on update restrict; alter table systemlog add constraint FK_syslog_user foreign key (uid)
references users (uid) on delete restrict on update restrict; alter table user_role add constraint FK_user_role foreign key (uid)
references users (uid) on delete restrict on update restrict; alter table user_role add constraint FK_user_role2 foreign key (rid)
references roles (rid) on delete restrict on update restrict;
基于SSM的租赁管理系统0.3_20161225_数据库设计的更多相关文章
- 基于SSM的租赁管理系统0.1_20161225_项目需求
基于SSM的汽车租赁系统项目计划书 1.产品定位 本系统供提供租赁服务的企业内部使用,供企业员工进行线下操作. 2.需求分析 2.1 能为工作人员提供员工信息的管理功能,具有RBAC基于角色的权限管理 ...
- 基于SSM的租赁管理系统0.2_20161225_开发环境
项目环境搭建 1. 开发环境 Sybase PowerDesigner 15.1.0 + MySQL 5.7.15 + Navicat 11.0.9 + eclipse EE Mars 2.0 + F ...
- 基于SSM的租赁管理系统1.0_20161225_框架搭建
搭建SSM底层框架 1. 利用mybatis反向工程generatorSqlmapCustom完成对数据库十表的映射 generatorConfig.xml <?xml version=&quo ...
- 基于SSM的健身房管理系统
基于SSM的健身房管理系统 The project was made in 2020-05-05~2020-05-10 谨以此片博文记录下我的第一个Java小Demo 项目展示 用户登录页 用户注册页 ...
- 基于ssm的客户管理系统
查看更多系统:系统大全,课程设计.毕业设计,请点击这里查看 01 概述 一个简单的客户关系管理系统 管理用户的基本数据 客户的分配 客户的流失 已经客户的状态 02 技术 ssm + jdk1.8 + ...
- 基于UML的毕业设计管理系统的分析与设计
基于UML的毕业设计管理系统的分析与设计 <本段与标题无关,自行略过 最近各种忙,天气不错,导师心情不错:“我们要写一个关于UML的专著”,一句话:“一个完整的系统贯穿整个UML的知识”:我:“ ...
- 文献综述七:基于SSM的网上商城的开发与设计
一.基本信息 标题:基于SSM的网上商城的开发与设计 时间:2018 出版源:Computer Knowledge and Technology 文件分类:对框架的研究 二.研究背景 为了解决现在电商 ...
- 五、Java多人博客系统-2.0版本-数据库设计
数据库设计表如下:文章类别表.文章表.评论表.留言表. 文章列表表:存放文章类别,首页菜单生成也是从这个表取的. 文章表:存放文章标题.发表时间.内容等信息. 评论表:文章评论内容. 留言表:用户发表 ...
- 基于SSM小区物业管理系统
随着计算机的不断发展和广泛应用,人们的工作效率得到不断的提高.互联网的发展,更是缩短了人们之间的距离.如何充分利用互联网,这是大家共同关心的问题.本文主要介绍了关于小区管理系统的实现方法,设计规划了小 ...
随机推荐
- 小猪cms微信二次开发之怎样分页
$db=D('Classify'); $zid=$db->where(array('id'=>$this->_GET('fid'),'token'=>$this->tok ...
- Android源码——Activity进程内启动
进程内启动Activity MainActivity组件向ActivityManagerService发送一个启动SubActivityInProcess组件的进程间通信请求: ActivityMan ...
- struts-hibernate-ajax完成区县和街道级联下拉框功能(二补充使用json解析list结果集,ajax循环json层级处理)
针对<struts-hibernate-ajax完成区县和街道级联下拉框功能>进行补充,上一篇中,要在action中拼接JSON格式字符串,很容易手抖.直接用json处理一下转成json格 ...
- MVC POST在ACTION上进行多个模型的数据绑定
首先声明,接下来的东西并不符合本人认同的严谨的MVC模式. 用MVC做项目的过程中,越来越多的用到不严谨的MVC编程. 比如,在"cshtml"文件中写: @Html.Raw(DB ...
- 浅谈Nginx负载均衡和F5的区别
前言 笔者最近在负责某集团网站时,同时用到了Nginx与F5,如图所示,负载均衡器F5作为处理外界请求的第一道"墙",将请求分发到web服务器后,web服务器上的Nginx再进行处 ...
- apache配置 php中没有php5apache2_4.dll
apache配置 php中没有php5apache2_4.dll 今天,在win7系统下安装Apache+PHP+MySQL时,终于体会到了版本多也不一定是好事,各种不兼容,主要是因为动态包的多少问题 ...
- ES6 语法笔记
//如果使用let,声明的变量仅在块级作用域内有效 { var a = 1; let b = 2; } console.log(a); // 1 console.log(b); // Uncaught ...
- Jquery 小技巧
[每个程序员都会的35个jQuery的小技巧]收集的35个jQuery的小技巧/代码片段,可以帮你快速开发
- Activiti5.10简易教程一
Activiti5.10简易教程一 一搭建环境 1.1 JDK 6+ activiti 运行在版本 6 以上的 JDK 上.转到 Oracle Java SE 下载页面,点击按钮“下载 JDK ” ...
- CH模拟赛 还教室
/* 区间操作,可以推一推式子,方差为平方的平均数-平均数的平方,维护区间和与区间平方和,平方和的维护方法类似,式子推一推就行了,注意约分 */ #include<iostream> #i ...