# 统一导出任务验证数据样本

## 目标

为 `device` 与 `iot_card` 场景准备两类样本：

- 小数据集：便于快速验证状态流转（10~30 条）
- 大数据集：便于验证分片执行（>= 5000 条）

## 1. device 场景

### 1.1 小数据集（示例）

```sql
-- 建议在测试库执行，按实际字段补齐 creator/updater
INSERT INTO tb_device (creator, updater, virtual_no, device_name, device_model, device_type, max_sim_slots, manufacturer, status)
VALUES
  (1, 1, 'EXP-DEV-S-0001', '导出设备样本1', 'M1', 'tracker', 4, 'JH', 1),
  (1, 1, 'EXP-DEV-S-0002', '导出设备样本2', 'M1', 'tracker', 4, 'JH', 1),
  (1, 1, 'EXP-DEV-S-0003', '导出设备样本3', 'M2', 'router', 4, 'JH', 1);
```

### 1.2 大数据集（示例）

```sql
-- 生成 5000 条设备样本
INSERT INTO tb_device (creator, updater, virtual_no, device_name, device_model, device_type, max_sim_slots, manufacturer, status)
SELECT
  1,
  1,
  'EXP-DEV-L-' || LPAD(gs::text, 6, '0'),
  '导出设备大样本' || gs,
  'M-L',
  'tracker',
  4,
  'JH',
  1
FROM generate_series(1, 5000) gs;
```

## 2. iot_card 场景

### 2.1 小数据集（示例）

```sql
INSERT INTO tb_iot_card (
  creator, updater, iccid, iccid_19, carrier_id, carrier_type, carrier_name,
  msisdn, status, activation_status, real_name_status, network_status
)
VALUES
  (1, 1, '89860000000000000001', '8986000000000000000', 1, 'CMCC', '中国移动', '13900000001', 1, 0, 0, 1),
  (1, 1, '89860000000000000002', '8986000000000000000', 1, 'CMCC', '中国移动', '13900000002', 1, 0, 0, 1),
  (1, 1, '89860000000000000003', '8986000000000000000', 1, 'CMCC', '中国移动', '13900000003', 1, 0, 0, 1);
```

### 2.2 大数据集（示例）

```sql
INSERT INTO tb_iot_card (
  creator, updater, iccid, iccid_19, carrier_id, carrier_type, carrier_name,
  msisdn, status, activation_status, real_name_status, network_status
)
SELECT
  1,
  1,
  '8986001' || LPAD(gs::text, 13, '0'),
  LEFT('8986001' || LPAD(gs::text, 13, '0'), 19),
  1,
  'CMCC',
  '中国移动',
  '138' || LPAD(gs::text, 8, '0'),
  1,
  0,
  0,
  1
FROM generate_series(1, 5000) gs;
```

## 3. 清理建议

```sql
DELETE FROM tb_device WHERE virtual_no LIKE 'EXP-DEV-%';
DELETE FROM tb_iot_card WHERE iccid LIKE '8986001%';
```
