/*
SQLyog 企业版 - MySQL GUI v8.14
MySQL - 5.6.22-log : Database - soso
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`soso` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `soso`;
/*Table structure for table `tb_card` */
DROP TABLE IF EXISTS `tb_card`;
CREATE TABLE `tb_card` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`cardNumber` char(11) COLLATE utf8mb4_bin NOT NULL COMMENT '手机号码',
`status` int(1) DEFAULT '0' COMMENT '状态: 0:可用 1:禁用',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_card` (`cardNumber`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
/*Data for the table `tb_card` */
insert into `tb_card`(`id`,`cardNumber`,`status`) values (1,'13652363333',1),(2,'15812346677',1),(3,'18890985868',1),(4,'13677478866',1),(5,'13666557788',1),(6,'13612476521',0),(7,'13609087438',1),(8,'13689011047',0),(9,'13698674344',0),(10,'13678239812',0),(11,'13677411438',0);
/*Table structure for table `tb_consuminfo` */
DROP TABLE IF EXISTS `tb_consuminfo`;
CREATE TABLE `tb_consuminfo` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`card_number` char(11) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '手机号码',
`type` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '消费类型',
`consum_data` int(11) DEFAULT NULL COMMENT '消费数据',
`consume_date` datetime DEFAULT NULL COMMENT '消费日期',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
/*Data for the table `tb_consuminfo` */
insert into `tb_consuminfo`(`id`,`card_number`,`type`,`consum_data`,`consume_date`) values (6,'15812346677','通话',90,'2022-09-13 22:10:44'),(7,'15812346677','短信',5,'2022-09-13 22:12:04'),(12,'18890985868','短信',5,'2022-09-14 11:06:54'),(13,'13652363333','短信',50,'2022-09-14 11:15:18'),(15,'13612476521','套餐开通',68,'2023-05-16 11:14:03');
/*Table structure for table `tb_mobole_card` */
DROP TABLE IF EXISTS `tb_mobole_card`;
CREATE TABLE `tb_mobole_card` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`card_number` char(11) COLLATE utf8mb4_bin NOT NULL COMMENT '手机号码',
`username` varchar(20) COLLATE utf8mb4_bin NOT NULL COMMENT '用户名',
`password` varchar(20) COLLATE utf8mb4_bin NOT NULL COMMENT '密码',
`ser_package` int(11) NOT NULL COMMENT '所属套餐',
`money` double(7,2) DEFAULT NULL COMMENT '账户余额',
`status` int(1) DEFAULT '0' COMMENT '状态:0:正常 1:冻结',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
/*Data for the table `tb_mobole_card` */
insert into `tb_mobole_card`(`id`,`card_number`,`username`,`password`,`ser_package`,`money`,`status`) values (1,'13677478866','zhangsan','123',1,10.00,0),(2,'13666557788','lisi','123456',3,10.00,1),(6,'13652363333','张三','123',2,21.00,0),(7,'15812346677','李四','123456',1,10.00,0),(8,'18890985868','王五','123',2,51.50,0),(9,'13612476521','张三丰','0010101',2,82.00,0),(10,'13609087438','张无忌','123456',2,100.00,0);
/*Table structure for table `tb_monthly_consumption_records` */
DROP TABLE IF EXISTS `tb_monthly_consumption_records`;
CREATE TABLE `tb_monthly_consumption_records` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`card_number` char(11) COLLATE utf8mb4_bin NOT NULL COMMENT '手机号码',
`consum_amount` double(7,2) DEFAULT '0.00' COMMENT '当月消费金额',
`real_talk_time` int(11) DEFAULT '0' COMMENT '当月实际通话时长(单位:分钟)',
`real_SMS_count` int(11) DEFAULT '0' COMMENT '当月实际发送短信条数',
`real_flow` int(11) DEFAULT '0' COMMENT '当月实际上网流量',
`consume_date` date DEFAULT NULL COMMENT '日期',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
/*Data for the table `tb_monthly_consumption_records` */
insert into `tb_monthly_consumption_records`(`id`,`card_number`,`consum_amount`,`real_talk_time`,`real_SMS_count`,`real_flow`,`consume_date`) values (1,'13677478866',0.00,590,80,0,'2022-09-01'),(12,'15812346677',0.00,90,5,0,'2022-09-01'),(13,'13677478866',10.00,650,50,0,'2022-08-01'),(17,'18890985868',0.00,0,0,0,'2022-09-01'),(18,'13652363333',5.00,0,50,0,'2022-09-01'),(19,'13612476521',204.00,0,0,0,'2023-05-16'),(20,'18890985868',0.00,0,0,2048,'2023-05-17');
/*Table structure for table `tb_recharge_record` */
DROP TABLE IF EXISTS `tb_recharge_record`;
CREATE TABLE `tb_recharge_record` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`amount` double(7,2) NOT NULL COMMENT '充值金额',
`recharge_date` datetime DEFAULT NULL COMMENT '充值时间',
`card_number` char(11) COLLATE utf8mb4_bin NOT NULL COMMENT '手机号',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
/*Data for the table `tb_recharge_record` */
insert into `tb_recharge_record`(`id`,`amount`,`recharge_date`,`card_number`) values (1,50.00,'2022-08-30 18:19:28','13666557788'),(5,100.00,'2022-09-09 17:04:05','13652363333'),(6,100.00,'2022-09-09 17:10:05','15812346677'),(7,100.00,'2022-09-13 15:51:50','18890985868'),(8,60.00,'2023-05-17 14:58:26','13612476521'),(9,20.00,'2023-05-17 15:06:33','18890985868');
/*Table structure for table `tb_scene` */
DROP TABLE IF EXISTS `tb_scene`;
CREATE TABLE `tb_scene` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`type` varchar(30) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '场景类型',
`data` int(11) DEFAULT NULL COMMENT '场景消费数据',
`description` varchar(200) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '场景描述',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
/*Data for the table `tb_scene` */
insert into `tb_scene`(`id`,`type`,`data`,`description`) values (1,'通话',90,'问候客户,谁知其如此难缠,通话90分钟'),(2,'通话',30,'询问妈妈身体状况,本地通话30分钟'),(3,'短信',5,'参与环境保护实施方案问卷调查,发送短信5条'),(4,'短信',50,'告诉朋友本人已换手机号码,发送短信50条'),(5,'上网',1024,'和女朋友微信视频聊天,使用流量1GB'),(6,'上网',2048,'晚上手机在线追剧,一不留神睡着了,使用流量2GB');
/*Table structure for table `tb_serpackage` */
DROP TABLE IF EXISTS `tb_serpackage`;
CREATE TABLE `tb_serpackage` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`talk_time` int(11) DEFAULT NULL COMMENT '通话时长',
`sms_count` int(11) DEFAULT NULL COMMENT '短信条数',
`price` double(7,2) DEFAULT NULL COMMENT '套餐月资费',
`flow` int(11) DEFAULT NULL COMMENT '上网流量',
`name` varchar(20) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '套餐类型',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
/*Data for the table `tb_serpackage` */
insert into `tb_serpackage`(`id`,`talk_time`,`sms_count`,`price`,`flow`,`name`) values (1,600,100,58.00,0,'话痨套餐'),(2,0,0,68.00,20480,'网虫套餐'),(3,300,50,78.00,10240,'超人套餐');
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;