/*
Navicat MySQL Data Transfer

Source Server         : 233
Source Server Version : 80019
Source Host           : localhost:3306
Source Database       : test

Target Server Type    : MYSQL
Target Server Version : 80019
File Encoding         : 65001

Date: 2020-05-06 23:23:43
*/

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for distribution
-- ----------------------------
DROP TABLE IF EXISTS `distribution`;
CREATE TABLE `distribution` (
  `dis_id` int NOT NULL,
  `dm_id` int DEFAULT NULL,
  `recv_id` int DEFAULT NULL,
  `dis_num` int DEFAULT NULL,
  `ts_id` int DEFAULT NULL,
  PRIMARY KEY (`dis_id`),
  KEY `dm_id` (`dm_id`) USING BTREE,
  KEY `recv_id` (`recv_id`) USING BTREE,
  KEY `ts_id` (`ts_id`) USING BTREE,
  CONSTRAINT `distribution_ibfk_1` FOREIGN KEY (`dm_id`) REFERENCES `donated_materials` (`dm_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `distribution_ibfk_2` FOREIGN KEY (`recv_id`) REFERENCES `receiver` (`recv_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `distribution_ibfk_3` FOREIGN KEY (`ts_id`) REFERENCES `transport` (`ts_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of distribution
-- ----------------------------
INSERT INTO `distribution` VALUES ('1', '1', '1', '984', '1');
INSERT INTO `distribution` VALUES ('2', '1', '2', '6', '2');
INSERT INTO `distribution` VALUES ('3', '2', '3', '100', '3');
INSERT INTO `distribution` VALUES ('4', '2', '4', '43', '4');
INSERT INTO `distribution` VALUES ('5', '2', '5', '357', '5');
INSERT INTO `distribution` VALUES ('6', '2', '5', '3', '6');
INSERT INTO `distribution` VALUES ('7', '3', '6', '2', '7');
INSERT INTO `distribution` VALUES ('8', '4', '7', '302', '8');
INSERT INTO `distribution` VALUES ('9', '4', '8', '109', '9');
INSERT INTO `distribution` VALUES ('10', '4', '9', '132', '10');
INSERT INTO `distribution` VALUES ('11', '4', '10', '95', '11');
INSERT INTO `distribution` VALUES ('12', '4', '11', '82', '12');
INSERT INTO `distribution` VALUES ('13', '4', '12', '72', '13');
INSERT INTO `distribution` VALUES ('14', '5', '13', '1', '14');
INSERT INTO `distribution` VALUES ('15', '6', '14', '516', '15');
INSERT INTO `distribution` VALUES ('16', '7', '15', '1', '16');
INSERT INTO `distribution` VALUES ('17', '7', '16', '1', '17');
INSERT INTO `distribution` VALUES ('18', '8', '15', '1', '18');
INSERT INTO `distribution` VALUES ('19', '8', '16', '1', '19');
INSERT INTO `distribution` VALUES ('20', '9', '15', '1', '20');
INSERT INTO `distribution` VALUES ('21', '9', '16', '1', '21');
INSERT INTO `distribution` VALUES ('22', '10', '6', '1', '22');
INSERT INTO `distribution` VALUES ('23', '11', '17', '12637', '23');

-- ----------------------------
-- Table structure for donated_materials
-- ----------------------------
DROP TABLE IF EXISTS `donated_materials`;
CREATE TABLE `donated_materials` (
  `dm_id` int NOT NULL AUTO_INCREMENT,
  `dm_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `dm_num` int DEFAULT NULL,
  PRIMARY KEY (`dm_id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of donated_materials
-- ----------------------------
INSERT INTO `donated_materials` VALUES ('1', '新型冠状病毒抗体检测', '1441');
INSERT INTO `donated_materials` VALUES ('2', '新型冠状病毒核酸检测', '646');
INSERT INTO `donated_materials` VALUES ('3', '云终端', '5');
INSERT INTO `donated_materials` VALUES ('4', '石阡矿泉水', '960');
INSERT INTO `donated_materials` VALUES ('5', '全自动化学发光免疫分析仪', '1');
INSERT INTO `donated_materials` VALUES ('6', '医疗用bunker masdes3口罩', '10000');
INSERT INTO `donated_materials` VALUES ('7', '自动脱盖离心机', '2');
INSERT INTO `donated_materials` VALUES ('8', '生物安全柜', '2');
INSERT INTO `donated_materials` VALUES ('9', '血液成分分离机', '2');
INSERT INTO `donated_materials` VALUES ('10', '急性透析和体外血液治疗机', '1');
INSERT INTO `donated_materials` VALUES ('11', 'FFP口罩', '13824');

-- ----------------------------
-- Table structure for donation
-- ----------------------------
DROP TABLE IF EXISTS `donation`;
CREATE TABLE `donation` (
  `donor_id` int NOT NULL,
  `dm_id` int NOT NULL,
  `dona_num` int DEFAULT NULL,
  `dona_values` float DEFAULT NULL,
  `dona_date` date DEFAULT NULL,
  PRIMARY KEY (`donor_id`,`dm_id`),
  KEY `dm_id` (`dm_id`) USING BTREE,
  CONSTRAINT `donation_ibfk_1` FOREIGN KEY (`donor_id`) REFERENCES `donor` (`donor_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `donation_ibfk_2` FOREIGN KEY (`dm_id`) REFERENCES `donated_materials` (`dm_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of donation
-- ----------------------------
INSERT INTO `donation` VALUES ('1', '1', '1441', '115680', '2020-04-02');
INSERT INTO `donation` VALUES ('1', '2', '646', '127200', '2020-04-02');
INSERT INTO `donation` VALUES ('1', '11', '13824', '402593', '2020-03-16');
INSERT INTO `donation` VALUES ('2', '3', '5', '24750', '2020-04-02');
INSERT INTO `donation` VALUES ('3', '4', '960', '85824', '2020-04-02');
INSERT INTO `donation` VALUES ('4', '5', '1', '1200000', '2020-04-02');
INSERT INTO `donation` VALUES ('5', '6', '10000', '90303.7', '2020-03-31');
INSERT INTO `donation` VALUES ('6', '7', '2', '44000', '2020-03-31');
INSERT INTO `donation` VALUES ('6', '8', '2', '59600', '2020-03-31');
INSERT INTO `donation` VALUES ('6', '9', '2', '540000', '2020-03-31');
INSERT INTO `donation` VALUES ('7', '10', '1', '380000', '2020-03-24');

-- ----------------------------
-- Table structure for donor
-- ----------------------------
DROP TABLE IF EXISTS `donor`;
CREATE TABLE `donor` (
  `donor_id` int NOT NULL AUTO_INCREMENT,
  `donor_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `donor_adr` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `donor_cn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  PRIMARY KEY (`donor_id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of donor
-- ----------------------------
INSERT INTO `donor` VALUES ('1', '贵州省贵商总会', '贵州贵阳', '13608572345');
INSERT INTO `donor` VALUES ('2', '锐捷网络股份有限公司', '贵州贵阳', '17786075611');
INSERT INTO `donor` VALUES ('3', '贵州高原清泉有限公司', '贵州石阡', '18639529792');
INSERT INTO `donor` VALUES ('4', '贵州喜宏伟商贸有限公司', '贵州黔南', '13398729087');
INSERT INTO `donor` VALUES ('5', '智利贵州商会', '贵州贵阳', '无');
INSERT INTO `donor` VALUES ('6', '贵州福瑞德医疗器械有限公司', '贵州贵阳', '18990219231');
INSERT INTO `donor` VALUES ('7', '珠海宝瑞医疗器械有限公司', '贵州贵阳', '16397281121');

-- ----------------------------
-- Table structure for manager
-- ----------------------------
DROP TABLE IF EXISTS `manager`;
CREATE TABLE `manager` (
  `mng_id` int NOT NULL,
  `mng_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `mng_cn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  PRIMARY KEY (`mng_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of manager
-- ----------------------------
INSERT INTO `manager` VALUES ('2001', '孙子涵', '18975892013');
INSERT INTO `manager` VALUES ('2002', '陈饶', '17894037621');
INSERT INTO `manager` VALUES ('2003', '倪鹏', '13609828792');

-- ----------------------------
-- Table structure for notarization
-- ----------------------------
DROP TABLE IF EXISTS `notarization`;
CREATE TABLE `notarization` (
  `nota_id` int NOT NULL,
  `recv_id` int DEFAULT NULL,
  `notary_id` int DEFAULT NULL,
  `nota_date` date DEFAULT NULL,
  PRIMARY KEY (`nota_id`),
  KEY `recv_id` (`recv_id`) USING BTREE,
  KEY `notary_id` (`notary_id`) USING BTREE,
  CONSTRAINT `notarization_ibfk_1` FOREIGN KEY (`recv_id`) REFERENCES `receiver` (`recv_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `notarization_ibfk_2` FOREIGN KEY (`notary_id`) REFERENCES `notary` (`notary_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of notarization
-- ----------------------------
INSERT INTO `notarization` VALUES ('5001', '1', '4001', '2020-04-02');
INSERT INTO `notarization` VALUES ('5002', '2', '4001', '2020-04-02');
INSERT INTO `notarization` VALUES ('5003', '3', '4001', '2020-04-02');
INSERT INTO `notarization` VALUES ('5004', '4', '4001', '2020-04-02');
INSERT INTO `notarization` VALUES ('5005', '5', '4001', '2020-04-02');
INSERT INTO `notarization` VALUES ('5006', '6', '4001', '2020-04-02');
INSERT INTO `notarization` VALUES ('5007', '7', '4002', '2020-04-02');
INSERT INTO `notarization` VALUES ('5008', '8', '4002', '2020-04-02');
INSERT INTO `notarization` VALUES ('5009', '9', '4002', '2020-04-02');
INSERT INTO `notarization` VALUES ('5010', '10', '4002', '2020-04-02');
INSERT INTO `notarization` VALUES ('5011', '11', '4002', '2020-04-02');
INSERT INTO `notarization` VALUES ('5012', '12', '4002', '2020-04-02');
INSERT INTO `notarization` VALUES ('5013', '13', '4002', '2020-04-02');
INSERT INTO `notarization` VALUES ('5014', '14', '4001', '2020-03-31');
INSERT INTO `notarization` VALUES ('5015', '15', '4001', '2020-03-31');
INSERT INTO `notarization` VALUES ('5016', '16', '4002', '2020-03-31');
INSERT INTO `notarization` VALUES ('5017', '6', '4001', '2020-03-24');
INSERT INTO `notarization` VALUES ('5018', '17', '4001', '2020-03-18');

-- ----------------------------
-- Table structure for notary
-- ----------------------------
DROP TABLE IF EXISTS `notary`;
CREATE TABLE `notary` (
  `notary_id` int NOT NULL,
  `notary_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `notary_cn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  PRIMARY KEY (`notary_id`),
  KEY `check_ibfk_2` (`notary_name`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of notary
-- ----------------------------
INSERT INTO `notary` VALUES ('4001', '蔡咏梅', '18985009233');
INSERT INTO `notary` VALUES ('4002', '邓守权', '18508515353');

-- ----------------------------
-- Table structure for receiver
-- ----------------------------
DROP TABLE IF EXISTS `receiver`;
CREATE TABLE `receiver` (
  `recv_id` int NOT NULL AUTO_INCREMENT,
  `recv_adr` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `recv_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `recv_cn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  PRIMARY KEY (`recv_id`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of receiver
-- ----------------------------
INSERT INTO `receiver` VALUES ('1', '贵州贵阳', '贵州宏立城集团', '13986572912');
INSERT INTO `receiver` VALUES ('2', '贵州贵阳', '贵州诚翔投资管理集团', '无');
INSERT INTO `receiver` VALUES ('3', '贵州贵阳', '贵州益佰制药股份有限公司', '17787218987');
INSERT INTO `receiver` VALUES ('4', '贵州贵阳', '贵州神奇药业有限公司', '13312230522');
INSERT INTO `receiver` VALUES ('5', '贵州毕节', '贵州合力购物有限责任公司', '17764598021');
INSERT INTO `receiver` VALUES ('6', '贵州遵义', '贵州医科大学附属医院', '无');
INSERT INTO `receiver` VALUES ('7', '贵州贵阳', '贵州群生豪生酒店', '867329543');
INSERT INTO `receiver` VALUES ('8', '贵州贵阳', '贵阳大成精舍酒店', '864395641');
INSERT INTO `receiver` VALUES ('9', '贵州贵阳', '贵阳新世界房地产有限公司', '18275267381');
INSERT INTO `receiver` VALUES ('10', '贵州息烽', '贵州万象温泉度假酒店', '无');
INSERT INTO `receiver` VALUES ('11', '贵州贵阳', '贵州贵安置业投资有限公司', '无');
INSERT INTO `receiver` VALUES ('12', '贵州贵阳', '贵州北斗湾酒店', '885386413');
INSERT INTO `receiver` VALUES ('13', '贵州贵阳', '贵州黔南州人民医院', '894356273');
INSERT INTO `receiver` VALUES ('14', '贵州金沙', '贵州金沙县中医院', '880982123');
INSERT INTO `receiver` VALUES ('15', '贵州贵阳', '贵州医科大学第二附属医院', '868869323');
INSERT INTO `receiver` VALUES ('16', '贵州贵阳', '黔东南州人民附属医院', '882123191');
INSERT INTO `receiver` VALUES ('17', '湖北武汉', '武汉防控中心', '无');

-- ----------------------------
-- Table structure for stock
-- ----------------------------
DROP TABLE IF EXISTS `stock`;
CREATE TABLE `stock` (
  `dm_id` int NOT NULL,
  `storeh_id` int NOT NULL,
  `sk_ivt` int DEFAULT NULL,
  PRIMARY KEY (`dm_id`,`storeh_id`),
  KEY `storeh_id` (`storeh_id`) USING BTREE,
  CONSTRAINT `stock_ibfk_1` FOREIGN KEY (`dm_id`) REFERENCES `donated_materials` (`dm_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `stock_ibfk_2` FOREIGN KEY (`storeh_id`) REFERENCES `storehouse` (`storeh_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of stock
-- ----------------------------
INSERT INTO `stock` VALUES ('1', '1001', '1441');
INSERT INTO `stock` VALUES ('2', '1001', '646');
INSERT INTO `stock` VALUES ('3', '1003', '5');
INSERT INTO `stock` VALUES ('4', '1002', '960');
INSERT INTO `stock` VALUES ('5', '1003', '1');
INSERT INTO `stock` VALUES ('6', '1001', '10000');
INSERT INTO `stock` VALUES ('7', '1003', '2');
INSERT INTO `stock` VALUES ('8', '1003', '2');
INSERT INTO `stock` VALUES ('9', '1003', '2');
INSERT INTO `stock` VALUES ('10', '1003', '1');
INSERT INTO `stock` VALUES ('11', '1001', '13824');

-- ----------------------------
-- Table structure for storehouse
-- ----------------------------
DROP TABLE IF EXISTS `storehouse`;
CREATE TABLE `storehouse` (
  `storeh_id` int NOT NULL AUTO_INCREMENT,
  `storeh_adr` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `mng_id` int DEFAULT NULL,
  PRIMARY KEY (`storeh_id`),
  KEY `mng_id` (`mng_id`) USING BTREE,
  CONSTRAINT `storehouse_ibfk_1` FOREIGN KEY (`mng_id`) REFERENCES `manager` (`mng_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=InnoDB AUTO_INCREMENT=1004 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of storehouse
-- ----------------------------
INSERT INTO `storehouse` VALUES ('1001', '贵州贵阳', '2001');
INSERT INTO `storehouse` VALUES ('1002', '贵州贵阳', '2002');
INSERT INTO `storehouse` VALUES ('1003', '贵州贵阳', '2003');

-- ----------------------------
-- Table structure for transport
-- ----------------------------
DROP TABLE IF EXISTS `transport`;
CREATE TABLE `transport` (
  `ts_id` int NOT NULL AUTO_INCREMENT,
  `storeh_id` int NOT NULL,
  `recv_id` int NOT NULL,
  `ts_date` date DEFAULT NULL,
  PRIMARY KEY (`ts_id`),
  KEY `storeh_id` (`storeh_id`) USING BTREE,
  KEY `recv_id` (`recv_id`) USING BTREE,
  CONSTRAINT `transport_ibfk_1` FOREIGN KEY (`storeh_id`) REFERENCES `storehouse` (`storeh_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `transport_ibfk_2` FOREIGN KEY (`recv_id`) REFERENCES `receiver` (`recv_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of transport
-- ----------------------------
INSERT INTO `transport` VALUES ('1', '1001', '1', '2020-04-02');
INSERT INTO `transport` VALUES ('2', '1001', '2', '2020-04-02');
INSERT INTO `transport` VALUES ('3', '1001', '3', '2020-04-02');
INSERT INTO `transport` VALUES ('4', '1001', '4', '2020-04-02');
INSERT INTO `transport` VALUES ('5', '1001', '5', '2020-04-02');
INSERT INTO `transport` VALUES ('6', '1001', '5', '2020-04-02');
INSERT INTO `transport` VALUES ('7', '1003', '6', '2020-04-02');
INSERT INTO `transport` VALUES ('8', '1002', '7', '2020-04-02');
INSERT INTO `transport` VALUES ('9', '1002', '8', '2020-04-02');
INSERT INTO `transport` VALUES ('10', '1002', '9', '2020-04-02');
INSERT INTO `transport` VALUES ('11', '1002', '10', '2020-04-03');
INSERT INTO `transport` VALUES ('12', '1002', '11', '2020-04-02');
INSERT INTO `transport` VALUES ('13', '1003', '12', '2020-04-03');
INSERT INTO `transport` VALUES ('14', '1001', '13', '2020-03-31');
INSERT INTO `transport` VALUES ('15', '1003', '14', '2020-03-31');
INSERT INTO `transport` VALUES ('16', '1003', '15', '2020-03-31');
INSERT INTO `transport` VALUES ('17', '1003', '16', '2020-03-31');
INSERT INTO `transport` VALUES ('18', '1003', '15', '2020-03-31');
INSERT INTO `transport` VALUES ('19', '1003', '16', '2020-03-31');
INSERT INTO `transport` VALUES ('20', '1003', '15', '2020-03-31');
INSERT INTO `transport` VALUES ('21', '1003', '16', '2020-03-31');
INSERT INTO `transport` VALUES ('22', '1003', '6', '2020-03-24');
INSERT INTO `transport` VALUES ('23', '1001', '17', '2020-03-18');
