libra_bot_c_agent_monitor.sql 2.1 KB

12345678910111213141516171819202122232425262728293031
  1. create table c_agent_monitor
  2. (
  3. id bigint unsigned auto_increment comment '主键'
  4. primary key,
  5. saas_id varchar(16) default '' not null comment '租户隔离',
  6. agent_num varchar(32) default '' not null comment '坐席工号',
  7. out_id varchar(32) default '' not null comment '外部id',
  8. identity_type tinyint default 0 not null comment '身份标识',
  9. check_state tinyint default 1 not null comment '是否签入 0:是 1: 否 默认未签入',
  10. check_scene varchar(16) default '' not null comment '迁入场景',
  11. check_in_time timestamp default CURRENT_TIMESTAMP not null comment '签入时间',
  12. check_out_time timestamp default CURRENT_TIMESTAMP not null comment '签出时间',
  13. service_state tinyint default 0 not null comment '坐席服务状态 0: 未登录(签出) 1: 置忙 2: 置闲 3: 通话中 4: 后处理 5: 拨号中',
  14. busy_time timestamp default CURRENT_TIMESTAMP not null comment '置忙时间',
  15. idle_time timestamp default CURRENT_TIMESTAMP not null comment '置闲时间',
  16. call_time timestamp default CURRENT_TIMESTAMP not null comment '接通时间',
  17. hang_time timestamp default CURRENT_TIMESTAMP not null comment '挂断时间',
  18. heart_state tinyint default 0 not null comment '心跳状态 0: 默认 1:正常 2: 异常',
  19. heart_time timestamp default CURRENT_TIMESTAMP not null comment '正常心跳时间',
  20. session_id varchar(64) default '' not null comment 'sessionId',
  21. is_delete tinyint default 0 not null comment '删除标识',
  22. update_time timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间',
  23. create_time timestamp default CURRENT_TIMESTAMP not null comment '创建时间',
  24. constraint uniq_saas_id_agent_num
  25. unique (saas_id, agent_num)
  26. )
  27. comment '坐席监控表';
  28. create index idx_saas_id_out_id
  29. on c_agent_monitor (saas_id, out_id);