-- Ether业主小程序测试数据 - OPS服务
-- PostgreSQL语法 - 根据实际表结构

-- 清理旧测试数据
DELETE FROM ops_complaint WHERE complaint_no LIKE 'CP%';
DELETE FROM ops_work_order WHERE order_no LIKE 'WO%';

-- 插入测试工单
INSERT INTO ops_work_order (id, order_no, project_id, reporter_id, reporter_name, order_type, title, description, status, priority, source, created_at, updated_at) VALUES
('e9357f9a-1e11-45e4-b3a6-f2447bdde1a1', 'WO2024001', 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', 'b9357f9a-1e11-45e4-b3a6-f2447bdde1a9', '张三', 'REPAIR', '厨房水龙头漏水', '厨房水龙头漏水严重，需要维修', 'CREATED', 'NORMAL', 'C_APP', NOW(), NOW()),
('e9357f9a-1e11-45e4-b3a6-f2447bdde1a2', 'WO2024002', 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', 'b9357f9a-1e11-45e4-b3a6-f2447bdde1a9', '张三', 'REPAIR', '电梯故障', '3号楼电梯经常卡顿', 'IN_PROGRESS', 'HIGH', 'C_APP', NOW(), NOW());

-- 插入测试投诉建议
INSERT INTO ops_complaint (id, complaint_no, type, title, content, reporter_id, reporter_name, project_id, status, created_at, updated_at) VALUES
('a9357f9a-1e11-45e4-b3a6-f2447bdde1a1', 'CP2024001', 'COMPLAINT', '小区绿化问题', '小区绿化带杂草丛生，希望物业及时处理', 'b9357f9a-1e11-45e4-b3a6-f2447bdde1a9', '张三', 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', 'PROCESSING', NOW(), NOW()),
('a9357f9a-1e11-45e4-b3a6-f2447bdde1a2', 'CP2024002', 'SUGGESTION', '增加健身设施建议', '建议在小区内增加一些健身器材', 'b9357f9a-1e11-45e4-b3a6-f2447bdde1a9', '张三', 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', 'SUBMITTED', NOW(), NOW());

SELECT 'OPS测试数据插入完成' AS result;
