create_machine_record.sql 2.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. -- 硬件数据同步
  2. create table business_machine_record(
  3. machine_record_id varchar(30) not null comment '记录ID',
  4. b_id VARCHAR(30) NOT NULL COMMENT '业务Id',
  5. machine_id varchar(30) not null comment '设备ID',
  6. machine_code varchar(30) not null comment '设备编码',
  7. name varchar(30) not null comment '用户名称',
  8. open_type_cd varchar(12) not null comment '开门方式,1000 人脸开门 2000 钥匙开门',
  9. community_id varchar(30) not null comment '小区ID',
  10. tel varchar(11) not null comment '手机号',
  11. id_card varchar(20) not null comment '用户身份证',
  12. record_type_cd varchar(12) not null comment '记录类型,8888 开门记录 6666 访客留影',
  13. file_id varchar(64) comment '文件ID',
  14. file_time timestamp default CURRENT_TIMESTAMP COMMENT '文件生成时间',
  15. create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  16. operate VARCHAR(4) NOT NULL COMMENT '数据状态,添加ADD,修改MOD 删除DEL'
  17. );
  18. -- 数据同步
  19. create table machine_record(
  20. machine_record_id varchar(30) not null comment '记录ID',
  21. b_id VARCHAR(30) NOT NULL COMMENT '业务Id',
  22. machine_id varchar(30) not null comment '设备ID',
  23. machine_code varchar(30) not null comment '设备编码',
  24. name varchar(30) not null comment '用户名称',
  25. open_type_cd varchar(12) not null comment '开门方式,1000 人脸开门 2000 钥匙开门',
  26. community_id varchar(30) not null comment '小区ID',
  27. tel varchar(11) not null comment '手机号',
  28. id_card varchar(20) not null comment '用户身份证',
  29. record_type_cd varchar(12) not null comment '记录类型,8888 开门记录 6666 访客留影',
  30. file_id varchar(64) comment '文件ID',
  31. file_time timestamp default CURRENT_TIMESTAMP COMMENT '文件生成时间',
  32. create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  33. status_cd VARCHAR(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,S 保存,0, 在用 1失效',
  34. UNIQUE KEY (machine_record_id)
  35. );