-- 创建防疫活动管理表
CREATE TABLE IF NOT EXISTS `epidemic_activities` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `activity_name` varchar(255) NOT NULL COMMENT '活动名称',
  `livestock_category` varchar(100) DEFAULT NULL COMMENT '防疫畜别',
  `disease_category` varchar(100) DEFAULT NULL COMMENT '疫病类别',
  `vaccine_used` varchar(255) DEFAULT NULL COMMENT '使用疫苗',
  `vaccine_batch` varchar(100) DEFAULT NULL COMMENT '疫苗批次',
  `prevention_date` varchar(100) DEFAULT NULL COMMENT '防疫日期',
  `activity_status` enum('active','inactive') DEFAULT 'active' 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_activity_name` (`activity_name`),
  KEY `idx_livestock_category` (`livestock_category`),
  KEY `idx_disease_category` (`disease_category`),
  KEY `idx_activity_status` (`activity_status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='防疫活动管理表';

-- 插入测试数据
INSERT INTO `epidemic_activities` (`activity_name`, `livestock_category`, `disease_category`, `vaccine_used`, `vaccine_batch`, `prevention_date`, `activity_status`) VALUES
('春防', '牛', '口蹄疫', '口蹄疫O型灭活疫苗', '20230401', '2023-04-01至2023-08-01', 'active'),
('秋防', '羊', '布鲁氏菌病', '布鲁氏菌病活疫苗', '20230901', '2023-09-01至2023-12-31', 'active'),
('猪瘟防疫', '猪', '猪瘟', '猪瘟活疫苗', '20230501', '2023-05-01至2023-05-31', 'inactive'),
('禽流感防疫', '鸡', '禽流感', '禽流感H5N1灭活疫苗', '20230601', '2023-06-01至2023-06-30', 'active'),
('狂犬病防疫', '犬', '狂犬病', '狂犬病灭活疫苗', '20230701', '2023-07-01至2023-07-31', 'active');
