录音统计,代码优化
This commit is contained in:
@@ -73,3 +73,47 @@ CREATE TABLE `device_management` (
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='设备管理表';
|
||||
|
||||
|
||||
|
||||
-- 用于存储门店录音相关的统计数据
|
||||
CREATE TABLE `recording_statistics` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
||||
`dealership_id` bigint(20) NOT NULL COMMENT '门店ID',
|
||||
`dealership_name` varchar(100) NOT NULL COMMENT '门店名称',
|
||||
|
||||
-- 门店录音总时长相关字段
|
||||
`dealership_total_duration` bigint(20) NOT NULL DEFAULT 0 COMMENT '门店录音总时长(秒)',
|
||||
`dealership_recording_count` int(11) NOT NULL DEFAULT 0 COMMENT '门店录音数量',
|
||||
`dealership_avg_duration` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '门店录音平均时长(秒)',
|
||||
|
||||
-- 个人录音相关字段
|
||||
`personal_total_duration` bigint(20) NOT NULL DEFAULT 0 COMMENT '个人录音总时长(秒)',
|
||||
`personal_recording_count` int(11) NOT NULL DEFAULT 0 COMMENT '个人录音数量',
|
||||
`personal_avg_duration` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '个人录音平均时长(秒)',
|
||||
|
||||
-- 项目录音相关字段
|
||||
`project_recording_count` int(11) NOT NULL DEFAULT 0 COMMENT '项目录音总数',
|
||||
`project_avg_duration` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '项目录音平均时长(秒)',
|
||||
|
||||
-- 统计日期
|
||||
`statistics_date` date NOT NULL COMMENT '统计日期',
|
||||
|
||||
-- 时间戳字段
|
||||
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_statistics_date` (`statistics_date`) COMMENT '统计日期索引',
|
||||
KEY `idx_dealership_id` (`dealership_id`) COMMENT '门店ID索引',
|
||||
KEY `idx_created_at` (`created_at`) COMMENT '创建时间索引'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='门店录音统计表';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user