CREATE TABLE `customer_management_statistics` (
  `id` VARCHAR(36) NOT NULL COMMENT '主键ID',
  `tenant_id` VARCHAR(64) DEFAULT NULL COMMENT '租户ID',
  `dealership_id` VARCHAR(64) DEFAULT NULL COMMENT '经销商ID',
  `dealership_name` VARCHAR(255) DEFAULT NULL COMMENT '经销商名称',
  `sales_id` VARCHAR(64) DEFAULT NULL COMMENT '销售ID',
  `count_by_dealership` INT DEFAULT 0 COMMENT '按经销商统计数量',
  `count_by_sales` INT DEFAULT 0 COMMENT '按销售统计数量',
  `count_by_project` INT DEFAULT 0 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 '统计日期索引'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='客户统计表';

