基于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模块继承
TextAction 继承 UserAction 继承 BaseAction 继承 Action TextAction 路径 PigCms\Lib\Action\User UserAction 路径 ...
- marked.js简易手册
marked.js简易手册 本文介绍的是marked.js.秉持"来之即用"的原则,对它进行简要的翻译和归纳, 安装 在网上引用或者是引用本地文件即可.要么就用命令行: npm i ...
- 【先定一个小目标】Redis 安装成windows服务-开机自启
1.第一步安装成windows服务的,开机自启动 redis-server --service-install redis.windows.conf 2.启动\关闭 redis-server --se ...
- 2MyBatis入门--深入浅出MyBatis技术原理与实践(笔记)
什么是 MyBatis ? MyBatis 是支持定制化 SQL.存储过程以及高级映射的优秀的持久层框架.MyBatis 避免了几乎所有的 JDBC 代码和手动设置参数以及获取结果集.MyBatis ...
- fedora配置163为yum的源
一种方法: 1.下载 http://mirrors.163.com/.help/fedora-163.repo 和 http://mirrors.163.com/.help/fedora-updat ...
- Altium Designer 的entry sheet ,offsheet和port作用(转载)
1.图纸结构 图纸包括两种结构关系: 一种是层次式图纸,该连接关系是纵向的,也就是某一层次的图纸只能和相邻的上级或下级有关系: 另一种是扁平式图纸,该连接关系是横向的,任何两张图纸之间都可以建立信号连 ...
- Linux平台开发指南
声明:以下内容摘自http://www.me115.com/post/25.html 以下技术和工具是Linux平台下工作的基础,熟练掌握: C++ 工作语言,重要性不言而喻: 入门: <C++ ...
- Git学习笔记与IntelliJ IDEA整合
Git学习笔记与IntelliJ IDEA整合 一.Git学习笔记(基于Github) 1.安装和配置Git 下载地址:http://git-scm.com/downloads Git简要使用说明:h ...
- 3D游戏编程大师技巧──2D引擎的编译问题
接上一篇文章,这里将介绍2D引擎的编译,从现在开始才真正进入<3D游戏编程大师技巧>的学习.本书的第一.二章只是简介了游戏编程和windows编程,从第三章开始才是介绍<window ...
- HTML+CSS布局技巧及兼容问题【阅读季】
在IE6和IE7中,行高值必须大于字体的2px以上才能保证字体的完整显示或当作为链接时能显示下划线. IE6 下去掉 input等元素 的边框 border: 0 none; 所有浏览器都可以了 边框 ...