
-- ----------------------------
-- Table structure for alarm_config
-- ----------------------------
DROP TABLE IF EXISTS "public"."alarm_config";
CREATE TABLE "public"."alarm_config" (
  "id" int8 NOT NULL,
  "thing_id" int8,
  "thing_code" varchar(255) COLLATE "pg_catalog"."default",
  "attr_id" int8,
  "attr_code" varchar(255) COLLATE "pg_catalog"."default",
  "alarm_rule" varchar(255) COLLATE "pg_catalog"."default",
  "alarm_val" varchar(255) COLLATE "pg_catalog"."default",
  "fine_rule" varchar(255) COLLATE "pg_catalog"."default",
  "fine_val" varchar(255) COLLATE "pg_catalog"."default",
  "type" varchar(255) COLLATE "pg_catalog"."default",
  "begin_time" varchar(255) COLLATE "pg_catalog"."default",
  "end_time" varchar(255) COLLATE "pg_catalog"."default",
  "remark" varchar(255) COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "sort" int8
)
;
COMMENT ON COLUMN "public"."alarm_config"."id" IS 'id';
COMMENT ON COLUMN "public"."alarm_config"."thing_id" IS '��ʵ��id';
COMMENT ON COLUMN "public"."alarm_config"."thing_code" IS '�����';
COMMENT ON COLUMN "public"."alarm_config"."attr_id" IS '����id';
COMMENT ON COLUMN "public"."alarm_config"."attr_code" IS '���Ա���';
COMMENT ON COLUMN "public"."alarm_config"."alarm_rule" IS '�澯���� > < >= <= =';
COMMENT ON COLUMN "public"."alarm_config"."alarm_val" IS '�澯ֵ';
COMMENT ON COLUMN "public"."alarm_config"."fine_rule" IS '��ֵ���� > < >= <= =';
COMMENT ON COLUMN "public"."alarm_config"."fine_val" IS '��ֵֵ';
COMMENT ON COLUMN "public"."alarm_config"."type" IS '���� 1��ƽ�ȼ�   2ҹ������';
COMMENT ON COLUMN "public"."alarm_config"."begin_time" IS '��ʼʱ��';
COMMENT ON COLUMN "public"."alarm_config"."end_time" IS '����ʱ��';
COMMENT ON COLUMN "public"."alarm_config"."remark" IS '��ע';
COMMENT ON COLUMN "public"."alarm_config"."creator" IS '������';
COMMENT ON COLUMN "public"."alarm_config"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."alarm_config"."updater" IS '������';
COMMENT ON COLUMN "public"."alarm_config"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."alarm_config"."sort" IS '1�������2�������3�ȶ�����4.ƽ������';
COMMENT ON TABLE "public"."alarm_config" IS '����ƽ��ҹ�����ܸ澯���ñ�';

-- ----------------------------
-- Records of alarm_config
-- ----------------------------

-- ----------------------------
-- Table structure for alarm_dict
-- ----------------------------
DROP TABLE IF EXISTS "public"."alarm_dict";
CREATE TABLE "public"."alarm_dict" (
  "id" int8 NOT NULL,
  "pid" int8,
  "dict_type" varchar(100) COLLATE "pg_catalog"."default",
  "dict_name" varchar(255) COLLATE "pg_catalog"."default",
  "dict_value" varchar(255) COLLATE "pg_catalog"."default",
  "sort" int4,
  "remark" varchar(255) COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."alarm_dict"."id" IS 'id';
COMMENT ON COLUMN "public"."alarm_dict"."pid" IS '�����ֵ�id';
COMMENT ON COLUMN "public"."alarm_dict"."dict_type" IS '�ֵ�����';
COMMENT ON COLUMN "public"."alarm_dict"."dict_name" IS '�ֵ�����';
COMMENT ON COLUMN "public"."alarm_dict"."dict_value" IS '�ֵ�ֵ';
COMMENT ON COLUMN "public"."alarm_dict"."sort" IS '����';
COMMENT ON COLUMN "public"."alarm_dict"."remark" IS '��ע';
COMMENT ON COLUMN "public"."alarm_dict"."creator" IS '������';
COMMENT ON COLUMN "public"."alarm_dict"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."alarm_dict"."updater" IS '������';
COMMENT ON COLUMN "public"."alarm_dict"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."alarm_dict" IS '�澯�ֵ����';

-- ----------------------------
-- Records of alarm_dict
-- ----------------------------

-- ----------------------------
-- Table structure for alarm_dispose_log
-- ----------------------------
DROP TABLE IF EXISTS "public"."alarm_dispose_log";
CREATE TABLE "public"."alarm_dispose_log" (
  "id" int8 NOT NULL,
  "alarm_log_id" int8,
  "describe" varchar COLLATE "pg_catalog"."default",
  "status" varchar(5) COLLATE "pg_catalog"."default",
  "images" varchar COLLATE "pg_catalog"."default",
  "dispose_result" varchar(255) COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."alarm_dispose_log"."alarm_log_id" IS '�澯��¼';
COMMENT ON COLUMN "public"."alarm_dispose_log"."describe" IS '��������';
COMMENT ON COLUMN "public"."alarm_dispose_log"."status" IS '����״̬';
COMMENT ON COLUMN "public"."alarm_dispose_log"."images" IS 'ͼƬ�б�';
COMMENT ON COLUMN "public"."alarm_dispose_log"."dispose_result" IS '������';
COMMENT ON TABLE "public"."alarm_dispose_log" IS '�澯������־';

-- ----------------------------
-- Records of alarm_dispose_log
-- ----------------------------

-- ----------------------------
-- Table structure for alarm_rule
-- ----------------------------
DROP TABLE IF EXISTS "public"."alarm_rule";
CREATE TABLE "public"."alarm_rule" (
  "id" int8 NOT NULL,
  "name" varchar(500) COLLATE "pg_catalog"."default",
  "type" varchar(5) COLLATE "pg_catalog"."default",
  "level" varchar(5) COLLATE "pg_catalog"."default",
  "enable" bool DEFAULT true,
  "condition" varchar(1000) COLLATE "pg_catalog"."default",
  "content" varchar(500) COLLATE "pg_catalog"."default",
  "remark" varchar(500) COLLATE "pg_catalog"."default",
  "trigger_type" varchar(5) COLLATE "pg_catalog"."default",
  "element_info" varchar COLLATE "pg_catalog"."default",
  "repeat" bool,
  "condition_name" varchar COLLATE "pg_catalog"."default",
  "status" varchar(5) COLLATE "pg_catalog"."default",
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."alarm_rule"."name" IS '�澯����';
COMMENT ON COLUMN "public"."alarm_rule"."type" IS '�澯����';
COMMENT ON COLUMN "public"."alarm_rule"."level" IS '���س̶�';
COMMENT ON COLUMN "public"."alarm_rule"."enable" IS '�Ƿ����';
COMMENT ON COLUMN "public"."alarm_rule"."condition" IS '��������';
COMMENT ON COLUMN "public"."alarm_rule"."content" IS '�澯����';
COMMENT ON COLUMN "public"."alarm_rule"."remark" IS '��ע';
COMMENT ON COLUMN "public"."alarm_rule"."trigger_type" IS '��������(job: 0��socket: 1)';
COMMENT ON COLUMN "public"."alarm_rule"."element_info" IS '����ֵ';
COMMENT ON COLUMN "public"."alarm_rule"."repeat" IS '�ظ��澯';
COMMENT ON COLUMN "public"."alarm_rule"."condition_name" IS '��������';
COMMENT ON COLUMN "public"."alarm_rule"."status" IS '����״̬(0:������,1:������,2:�Ѵ���)';
COMMENT ON COLUMN "public"."alarm_rule"."tenant_code" IS '�����⻧';
COMMENT ON COLUMN "public"."alarm_rule"."company_id" IS '��ҵ����id';
COMMENT ON COLUMN "public"."alarm_rule"."dept_id" IS '����id';
COMMENT ON TABLE "public"."alarm_rule" IS '�澯����';

-- ----------------------------
-- Records of alarm_rule
-- ----------------------------

-- ----------------------------
-- Table structure for alarm_rule_action
-- ----------------------------
DROP TABLE IF EXISTS "public"."alarm_rule_action";
CREATE TABLE "public"."alarm_rule_action" (
  "id" int8 NOT NULL,
  "rule_id" int8,
  "action_type" varchar(5) COLLATE "pg_catalog"."default",
  "action_id" int8,
  "action_configure" varchar COLLATE "pg_catalog"."default",
  "setting_id" int8,
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."alarm_rule_action"."id" IS '����';
COMMENT ON COLUMN "public"."alarm_rule_action"."rule_id" IS '��������';
COMMENT ON COLUMN "public"."alarm_rule_action"."action_type" IS '��������(��Ϣ������...)';
COMMENT ON COLUMN "public"."alarm_rule_action"."action_id" IS '��������(��Ϣ��������...)';
COMMENT ON COLUMN "public"."alarm_rule_action"."action_configure" IS '������������';
COMMENT ON COLUMN "public"."alarm_rule_action"."setting_id" IS '��������id';
COMMENT ON COLUMN "public"."alarm_rule_action"."tenant_code" IS '�����⻧';
COMMENT ON COLUMN "public"."alarm_rule_action"."company_id" IS '��ҵ����id';
COMMENT ON COLUMN "public"."alarm_rule_action"."dept_id" IS '����id';
COMMENT ON TABLE "public"."alarm_rule_action" IS '�澯����';

-- ----------------------------
-- Records of alarm_rule_action
-- ----------------------------

-- ----------------------------
-- Table structure for alarm_rule_entity
-- ----------------------------
DROP TABLE IF EXISTS "public"."alarm_rule_entity";
CREATE TABLE "public"."alarm_rule_entity" (
  "id" int8 NOT NULL,
  "rule_id" int8 NOT NULL,
  "thing_id" int8 NOT NULL,
  "thing_code" varchar(100) COLLATE "pg_catalog"."default",
  "entity_id" varchar(40) COLLATE "pg_catalog"."default",
  "thing_attr" varchar(20) COLLATE "pg_catalog"."default",
  "label" varchar(50) COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."alarm_rule_entity"."id" IS '����';
COMMENT ON COLUMN "public"."alarm_rule_entity"."rule_id" IS '��������';
COMMENT ON COLUMN "public"."alarm_rule_entity"."thing_id" IS '��ʵ������';
COMMENT ON COLUMN "public"."alarm_rule_entity"."thing_code" IS '�����';
COMMENT ON COLUMN "public"."alarm_rule_entity"."entity_id" IS '�豸ID';
COMMENT ON COLUMN "public"."alarm_rule_entity"."thing_attr" IS '������';
COMMENT ON COLUMN "public"."alarm_rule_entity"."label" IS 'AA/AB/AC';
COMMENT ON COLUMN "public"."alarm_rule_entity"."creator" IS '������';
COMMENT ON COLUMN "public"."alarm_rule_entity"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."alarm_rule_entity"."updater" IS '������';
COMMENT ON COLUMN "public"."alarm_rule_entity"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."alarm_rule_entity" IS '�澯�豸';

-- ----------------------------
-- Records of alarm_rule_entity
-- ----------------------------

-- ----------------------------
-- Table structure for alarm_rule_log
-- ----------------------------
DROP TABLE IF EXISTS "public"."alarm_rule_log";
CREATE TABLE "public"."alarm_rule_log" (
  "id" int8 NOT NULL,
  "rule_id" int8,
  "action_id" int8,
  "content" varchar COLLATE "pg_catalog"."default",
  "status" varchar(5) COLLATE "pg_catalog"."default",
  "alarm_time" timestamp(6),
  "dispose_time" timestamp(6),
  "creator" int8,
  "dispose_user_id" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "alarm_type" varchar(255) COLLATE "pg_catalog"."default",
  "alarm_thing_code" varchar(255) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."alarm_rule_log"."rule_id" IS '�澯��������/����澯��������';
COMMENT ON COLUMN "public"."alarm_rule_log"."action_id" IS '����id';
COMMENT ON COLUMN "public"."alarm_rule_log"."content" IS '�澯����+�澯����';
COMMENT ON COLUMN "public"."alarm_rule_log"."status" IS '����״̬';
COMMENT ON COLUMN "public"."alarm_rule_log"."alarm_time" IS '�澯ʱ��';
COMMENT ON COLUMN "public"."alarm_rule_log"."dispose_time" IS '����ʱ��';
COMMENT ON COLUMN "public"."alarm_rule_log"."dispose_user_id" IS '������';
COMMENT ON COLUMN "public"."alarm_rule_log"."alarm_type" IS '�澯���� 1ͨ�ø澯��2����澯';
COMMENT ON COLUMN "public"."alarm_rule_log"."alarm_thing_code" IS '�澯����룬����澯У�������';
COMMENT ON TABLE "public"."alarm_rule_log" IS '�澯��־';

-- ----------------------------
-- Records of alarm_rule_log
-- ----------------------------

-- ----------------------------
-- Table structure for alarm_rule_setting
-- ----------------------------
DROP TABLE IF EXISTS "public"."alarm_rule_setting";
CREATE TABLE "public"."alarm_rule_setting" (
  "id" int8 NOT NULL,
  "setting_type" varchar(255) COLLATE "pg_catalog"."default",
  "setting_ids" varchar COLLATE "pg_catalog"."default",
  "action_type" varchar(255) COLLATE "pg_catalog"."default",
  "action_id" int8,
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."alarm_rule_setting"."id" IS '����';
COMMENT ON COLUMN "public"."alarm_rule_setting"."setting_type" IS '�澯ѡ������';
COMMENT ON COLUMN "public"."alarm_rule_setting"."setting_ids" IS '�澯id����';
COMMENT ON COLUMN "public"."alarm_rule_setting"."action_type" IS '��������(��Ϣ������...)';
COMMENT ON COLUMN "public"."alarm_rule_setting"."action_id" IS '��������(��Ϣ��������...)';
COMMENT ON COLUMN "public"."alarm_rule_setting"."tenant_code" IS '�����⻧';
COMMENT ON COLUMN "public"."alarm_rule_setting"."company_id" IS '��ҵ����id';
COMMENT ON COLUMN "public"."alarm_rule_setting"."dept_id" IS '����id';
COMMENT ON TABLE "public"."alarm_rule_setting" IS '�澯��������';

-- ----------------------------
-- Records of alarm_rule_setting
-- ----------------------------

-- ----------------------------
-- Table structure for alert_config
-- ----------------------------
DROP TABLE IF EXISTS "public"."alert_config";
CREATE TABLE "public"."alert_config" (
  "id" int8 NOT NULL,
  "filter_rule_id" int8,
  "alert_name" varchar(255) COLLATE "pg_catalog"."default",
  "alert_type" varchar(255) COLLATE "pg_catalog"."default",
  "alert_level" varchar(255) COLLATE "pg_catalog"."default",
  "alert_content" text COLLATE "pg_catalog"."default",
  "repeat" bool,
  "remark" varchar(255) COLLATE "pg_catalog"."default",
  "begin_time" int8,
  "end_time" int8,
  "msg_push_id" int8,
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."alert_config"."id" IS '����';
COMMENT ON COLUMN "public"."alert_config"."filter_rule_id" IS '���˹���id';
COMMENT ON COLUMN "public"."alert_config"."alert_name" IS '�澯����';
COMMENT ON COLUMN "public"."alert_config"."alert_type" IS '�澯����';
COMMENT ON COLUMN "public"."alert_config"."alert_level" IS '�澯�ȼ�';
COMMENT ON COLUMN "public"."alert_config"."alert_content" IS '�澯����';
COMMENT ON COLUMN "public"."alert_config"."repeat" IS '�Ƿ���ظ�';
COMMENT ON COLUMN "public"."alert_config"."remark" IS '��ע';
COMMENT ON COLUMN "public"."alert_config"."begin_time" IS '�澯��ʼʱ��';
COMMENT ON COLUMN "public"."alert_config"."end_time" IS '�澯����ʱ��';
COMMENT ON COLUMN "public"."alert_config"."msg_push_id" IS '��Ϣ������������';
COMMENT ON COLUMN "public"."alert_config"."creator" IS '������';
COMMENT ON COLUMN "public"."alert_config"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."alert_config"."updater" IS '������';
COMMENT ON COLUMN "public"."alert_config"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."alert_config" IS 'ͨ�ø澯����';

-- ----------------------------
-- Records of alert_config
-- ----------------------------

-- ----------------------------
-- Table structure for alert_dispose_log
-- ----------------------------
DROP TABLE IF EXISTS "public"."alert_dispose_log";
CREATE TABLE "public"."alert_dispose_log" (
  "id" int8 NOT NULL,
  "alert_log_id" int8,
  "describe" varchar COLLATE "pg_catalog"."default",
  "status" varchar(25) COLLATE "pg_catalog"."default",
  "images" varchar COLLATE "pg_catalog"."default",
  "dispose_result" varchar(255) COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."alert_dispose_log"."alert_log_id" IS '�澯��¼';
COMMENT ON COLUMN "public"."alert_dispose_log"."describe" IS '��������';
COMMENT ON COLUMN "public"."alert_dispose_log"."status" IS '����״̬��0-������1-�����У�2-�Ѵ���';
COMMENT ON COLUMN "public"."alert_dispose_log"."images" IS 'ͼƬ�б�';
COMMENT ON COLUMN "public"."alert_dispose_log"."dispose_result" IS '������';
COMMENT ON TABLE "public"."alert_dispose_log" IS '�澯������־';

-- ----------------------------
-- Records of alert_dispose_log
-- ----------------------------

-- ----------------------------
-- Table structure for alert_log
-- ----------------------------
DROP TABLE IF EXISTS "public"."alert_log";
CREATE TABLE "public"."alert_log" (
  "id" int8 NOT NULL,
  "config_id" int8,
  "content" varchar COLLATE "pg_catalog"."default",
  "status" varchar(25) COLLATE "pg_catalog"."default",
  "alert_time" int8,
  "dispose_time" int8,
  "dispose_user_id" int8,
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."alert_log"."id" IS '����';
COMMENT ON COLUMN "public"."alert_log"."config_id" IS '�澯����id';
COMMENT ON COLUMN "public"."alert_log"."content" IS '�澯����+���˹���ʽ';
COMMENT ON COLUMN "public"."alert_log"."status" IS '����״̬��0-������1-�����У�2-�Ѵ���';
COMMENT ON COLUMN "public"."alert_log"."alert_time" IS '�澯ʱ��';
COMMENT ON COLUMN "public"."alert_log"."dispose_time" IS '����ʱ��';
COMMENT ON COLUMN "public"."alert_log"."dispose_user_id" IS '������';
COMMENT ON TABLE "public"."alert_log" IS '�澯��־';

-- ----------------------------
-- Records of alert_log
-- ----------------------------

-- ----------------------------
-- Table structure for calc_log
-- ----------------------------
DROP TABLE IF EXISTS "public"."calc_log";
CREATE TABLE "public"."calc_log" (
  "id" int8 NOT NULL,
  "calc_target_config_id" int8 NOT NULL,
  "formula" varchar(255) COLLATE "pg_catalog"."default",
  "source_info" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "status" int4 NOT NULL,
  "time" int8,
  "result" varchar(255) COLLATE "pg_catalog"."default",
  "duration" int8,
  "error_info" text COLLATE "pg_catalog"."default",
  "calc_count" int4 DEFAULT 0,
  "tenant_code" int8 NOT NULL,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."calc_log"."id" IS '����';
COMMENT ON COLUMN "public"."calc_log"."calc_target_config_id" IS '����Ŀ�������ñ�id';
COMMENT ON COLUMN "public"."calc_log"."formula" IS '���㹫ʽ';
COMMENT ON COLUMN "public"."calc_log"."source_info" IS '����Դ��Ϣ��json��ʽ';
COMMENT ON COLUMN "public"."calc_log"."status" IS '����״̬��1-�Ѽ��㡢2-δ���㡢3-�����쳣��4-��ƥ��';
COMMENT ON COLUMN "public"."calc_log"."time" IS '����ʱ��';
COMMENT ON COLUMN "public"."calc_log"."result" IS '��������ֻ���Ѽ���ļ�¼����ֵ';
COMMENT ON COLUMN "public"."calc_log"."duration" IS '�����ʱ,��λms';
COMMENT ON COLUMN "public"."calc_log"."error_info" IS '������Ϣ';
COMMENT ON COLUMN "public"."calc_log"."calc_count" IS '�������';
COMMENT ON COLUMN "public"."calc_log"."tenant_code" IS '�⻧����';
COMMENT ON COLUMN "public"."calc_log"."company_id" IS '��ҵid';
COMMENT ON COLUMN "public"."calc_log"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."calc_log"."creator" IS '������';
COMMENT ON COLUMN "public"."calc_log"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."calc_log"."updater" IS '������';
COMMENT ON COLUMN "public"."calc_log"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."calc_log" IS '�������־��';

-- ----------------------------
-- Records of calc_log
-- ----------------------------

-- ----------------------------
-- Table structure for calc_source_config
-- ----------------------------
DROP TABLE IF EXISTS "public"."calc_source_config";
CREATE TABLE "public"."calc_source_config" (
  "id" int8 NOT NULL,
  "calc_target_config_id" int8 NOT NULL,
  "source_thing_name" varchar(100) COLLATE "pg_catalog"."default",
  "source_thing_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "source_attr_name" varchar(100) COLLATE "pg_catalog"."default",
  "source_attr_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "source_attr_alias" varchar(10) COLLATE "pg_catalog"."default",
  "tenant_code" int8 NOT NULL,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."calc_source_config"."id" IS '����';
COMMENT ON COLUMN "public"."calc_source_config"."calc_target_config_id" IS '����Ŀ�������ñ�id';
COMMENT ON COLUMN "public"."calc_source_config"."source_thing_name" IS 'Դ������';
COMMENT ON COLUMN "public"."calc_source_config"."source_thing_code" IS 'Դ�����';
COMMENT ON COLUMN "public"."calc_source_config"."source_attr_name" IS 'Դ��������';
COMMENT ON COLUMN "public"."calc_source_config"."source_attr_code" IS 'Դ���Ա���';
COMMENT ON COLUMN "public"."calc_source_config"."source_attr_alias" IS 'Դ�����ڼ��㹫ʽ�еı���';
COMMENT ON COLUMN "public"."calc_source_config"."tenant_code" IS '�⻧����';
COMMENT ON COLUMN "public"."calc_source_config"."company_id" IS '��ҵid';
COMMENT ON COLUMN "public"."calc_source_config"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."calc_source_config"."creator" IS '������';
COMMENT ON COLUMN "public"."calc_source_config"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."calc_source_config"."updater" IS '������';
COMMENT ON COLUMN "public"."calc_source_config"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."calc_source_config" IS '����㣨Ŀ������ñ�';

-- ----------------------------
-- Records of calc_source_config
-- ----------------------------

-- ----------------------------
-- Table structure for calc_target_config
-- ----------------------------
DROP TABLE IF EXISTS "public"."calc_target_config";
CREATE TABLE "public"."calc_target_config" (
  "id" int8 NOT NULL,
  "config_type" int4 NOT NULL,
  "target_thing_name" varchar(100) COLLATE "pg_catalog"."default",
  "target_thing_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "target_attr_name" varchar(100) COLLATE "pg_catalog"."default",
  "target_attr_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "formula" varchar(255) COLLATE "pg_catalog"."default",
  "formula_description" varchar(255) COLLATE "pg_catalog"."default",
  "remark" varchar(255) COLLATE "pg_catalog"."default",
  "enable" bool,
  "tenant_code" int8 NOT NULL,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."calc_target_config"."id" IS '����';
COMMENT ON COLUMN "public"."calc_target_config"."config_type" IS '�������ͣ�����ӳ�䡢�ۺ�ӳ�䡢ָ����㡢�߼�����';
COMMENT ON COLUMN "public"."calc_target_config"."target_thing_name" IS 'Ŀ��������';
COMMENT ON COLUMN "public"."calc_target_config"."target_thing_code" IS 'Ŀ�������';
COMMENT ON COLUMN "public"."calc_target_config"."target_attr_name" IS 'Ŀ����������';
COMMENT ON COLUMN "public"."calc_target_config"."target_attr_code" IS 'Ŀ�����Ա���';
COMMENT ON COLUMN "public"."calc_target_config"."formula" IS '���㹫ʽ';
COMMENT ON COLUMN "public"."calc_target_config"."formula_description" IS '���㹫ʽ��������';
COMMENT ON COLUMN "public"."calc_target_config"."remark" IS '��ע';
COMMENT ON COLUMN "public"."calc_target_config"."enable" IS '�Ƿ����ü���';
COMMENT ON COLUMN "public"."calc_target_config"."tenant_code" IS '�⻧����';
COMMENT ON COLUMN "public"."calc_target_config"."company_id" IS '��ҵid';
COMMENT ON COLUMN "public"."calc_target_config"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."calc_target_config"."creator" IS '������';
COMMENT ON COLUMN "public"."calc_target_config"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."calc_target_config"."updater" IS '������';
COMMENT ON COLUMN "public"."calc_target_config"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."calc_target_config" IS '����㣨Ŀ������ñ�';

-- ----------------------------
-- Records of calc_target_config
-- ----------------------------

-- ----------------------------
-- Table structure for carbon_ts_kv
-- ----------------------------
DROP TABLE IF EXISTS "public"."carbon_ts_kv";
CREATE TABLE "public"."carbon_ts_kv" (
  "thing_id" int8 NOT NULL,
  "thing_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "attr_key" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "ts" int8 NOT NULL,
  "val" varchar COLLATE "pg_catalog"."default",
  "day_time" date,
  "create_time" int8,
  "update_time" int8,
  "attribute_type" varchar(10) COLLATE "pg_catalog"."default" NOT NULL
)
;
COMMENT ON COLUMN "public"."carbon_ts_kv"."thing_id" IS '��ҵ�豸id';
COMMENT ON COLUMN "public"."carbon_ts_kv"."thing_code" IS '�豸����';
COMMENT ON COLUMN "public"."carbon_ts_kv"."attr_key" IS '���Ա���';
COMMENT ON COLUMN "public"."carbon_ts_kv"."ts" IS 'ʱ���';
COMMENT ON COLUMN "public"."carbon_ts_kv"."val" IS 'ң��ֵ';
COMMENT ON COLUMN "public"."carbon_ts_kv"."day_time" IS 'ʱ��';
COMMENT ON COLUMN "public"."carbon_ts_kv"."create_time" IS '����ʱ��';
COMMENT ON COLUMN "public"."carbon_ts_kv"."update_time" IS '����ʱ��';
COMMENT ON COLUMN "public"."carbon_ts_kv"."attribute_type" IS '�������ͣ�dd, mm, yy';
COMMENT ON TABLE "public"."carbon_ts_kv" IS '��ҵң�����ݻ���';

-- ----------------------------
-- Records of carbon_ts_kv
-- ----------------------------

-- ----------------------------
-- Table structure for eq_attacment
-- ----------------------------
DROP TABLE IF EXISTS "public"."eq_attacment";
CREATE TABLE "public"."eq_attacment" (
  "id" int8 NOT NULL,
  "thing_id" int8,
  "creator" int8,
  "create_date" timestamp(6),
  "updater" int8,
  "update_date" timestamp(6),
  "url" varchar(255) COLLATE "pg_catalog"."default",
  "type" varchar(16) COLLATE "pg_catalog"."default",
  "modular_type" varchar(16) COLLATE "pg_catalog"."default",
  "name" varchar(255) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."eq_attacment"."thing_id" IS '�豸id/ά��id/����id...�������id';
COMMENT ON COLUMN "public"."eq_attacment"."creator" IS '������';
COMMENT ON COLUMN "public"."eq_attacment"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_attacment"."updater" IS '������';
COMMENT ON COLUMN "public"."eq_attacment"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_attacment"."url" IS 'ͼƬ���ļ�url';
COMMENT ON COLUMN "public"."eq_attacment"."type" IS '0ͼƬ��1����';
COMMENT ON COLUMN "public"."eq_attacment"."modular_type" IS 'ģ�飺0�豸���� 1��Դ����';
COMMENT ON COLUMN "public"."eq_attacment"."name" IS '����';
COMMENT ON TABLE "public"."eq_attacment" IS '������';

-- ----------------------------
-- Records of eq_attacment
-- ----------------------------

-- ----------------------------
-- Table structure for eq_bx
-- ----------------------------
DROP TABLE IF EXISTS "public"."eq_bx";
CREATE TABLE "public"."eq_bx" (
  "id" int8 NOT NULL,
  "fault_type" varchar(16) COLLATE "pg_catalog"."default",
  "wx_team" varchar(255) COLLATE "pg_catalog"."default",
  "urgent_level" varchar(16) COLLATE "pg_catalog"."default",
  "shutdown" varchar(16) COLLATE "pg_catalog"."default" DEFAULT 0,
  "dept_id" int8,
  "tenant_code" int8,
  "creator" int8,
  "create_date" timestamp(0),
  "updater" int8,
  "update_date" timestamp(0),
  "fault_desc" varchar(512) COLLATE "pg_catalog"."default",
  "eq_id" int8 NOT NULL,
  "happen_date" timestamp(0),
  "bx_user" varchar(255) COLLATE "pg_catalog"."default",
  "bx_user_mobile" varchar(255) COLLATE "pg_catalog"."default",
  "fault_level" varchar(16) COLLATE "pg_catalog"."default",
  "reviewer" int8,
  "wx_status" varchar(16) COLLATE "pg_catalog"."default",
  "bx_no" varchar(64) COLLATE "pg_catalog"."default",
  "wx_user_id" varchar(255) COLLATE "pg_catalog"."default",
  "wx_level" varchar(255) COLLATE "pg_catalog"."default",
  "fault_reason" varchar(255) COLLATE "pg_catalog"."default",
  "repair_status" varchar(16) COLLATE "pg_catalog"."default",
  "repair_time" date,
  "in_wx" varchar(5) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."eq_bx"."id" IS 'id';
COMMENT ON COLUMN "public"."eq_bx"."fault_type" IS '��������';
COMMENT ON COLUMN "public"."eq_bx"."wx_team" IS 'ά�ް���';
COMMENT ON COLUMN "public"."eq_bx"."urgent_level" IS '�����̶�';
COMMENT ON COLUMN "public"."eq_bx"."shutdown" IS '�Ƿ�ͣ����0��ͣ�� 1ͣ����Ĭ��0';
COMMENT ON COLUMN "public"."eq_bx"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."eq_bx"."tenant_code" IS '�⻧����';
COMMENT ON COLUMN "public"."eq_bx"."creator" IS '������';
COMMENT ON COLUMN "public"."eq_bx"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_bx"."updater" IS '������';
COMMENT ON COLUMN "public"."eq_bx"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_bx"."fault_desc" IS '��������';
COMMENT ON COLUMN "public"."eq_bx"."eq_id" IS '�豸id';
COMMENT ON COLUMN "public"."eq_bx"."happen_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_bx"."bx_user" IS '������';
COMMENT ON COLUMN "public"."eq_bx"."bx_user_mobile" IS '�������ֻ���';
COMMENT ON COLUMN "public"."eq_bx"."fault_level" IS '���ϵȼ�';
COMMENT ON COLUMN "public"."eq_bx"."reviewer" IS '�����';
COMMENT ON COLUMN "public"."eq_bx"."wx_status" IS 'ά��״̬��0:δ����1�������У�2����ɣ�';
COMMENT ON COLUMN "public"."eq_bx"."bx_no" IS '���޵���';
COMMENT ON COLUMN "public"."eq_bx"."wx_user_id" IS 'ά����ĳ�Ա';
COMMENT ON COLUMN "public"."eq_bx"."wx_level" IS 'ά�޼���';
COMMENT ON COLUMN "public"."eq_bx"."fault_reason" IS '����ԭ��';
COMMENT ON COLUMN "public"."eq_bx"."repair_status" IS '����״̬��ACTIVE:�Ѽ��INACTIVE��δ���';
COMMENT ON COLUMN "public"."eq_bx"."repair_time" IS '��������ʱ��';
COMMENT ON COLUMN "public"."eq_bx"."in_wx" IS '�Ƿ���뱨��';
COMMENT ON TABLE "public"."eq_bx" IS '�豸����';

-- ----------------------------
-- Records of eq_bx
-- ----------------------------

-- ----------------------------
-- Table structure for eq_by
-- ----------------------------
DROP TABLE IF EXISTS "public"."eq_by";
CREATE TABLE "public"."eq_by" (
  "id" int8 NOT NULL,
  "by_team" varchar(255) COLLATE "pg_catalog"."default",
  "by_level" varchar(16) COLLATE "pg_catalog"."default",
  "shutdown" varchar(16) COLLATE "pg_catalog"."default" DEFAULT 0,
  "creator" int8,
  "create_date" timestamp(0),
  "updater" int8,
  "update_date" timestamp(0),
  "work_desc" varchar(512) COLLATE "pg_catalog"."default",
  "eq_by_plan_id" int8 NOT NULL,
  "by_status" varchar(16) COLLATE "pg_catalog"."default",
  "by_no" varchar(64) COLLATE "pg_catalog"."default",
  "shutdown_time" varchar(64) COLLATE "pg_catalog"."default",
  "by_start_time" timestamp(6),
  "by_end_time" timestamp(6),
  "by_fee" varchar(255) COLLATE "pg_catalog"."default",
  "by_user" varchar(255) COLLATE "pg_catalog"."default",
  "by_time" varchar(255) COLLATE "pg_catalog"."default",
  "dept_id" int8,
  "tenant_code" int8
)
;
COMMENT ON COLUMN "public"."eq_by"."id" IS 'id';
COMMENT ON COLUMN "public"."eq_by"."by_team" IS '��������';
COMMENT ON COLUMN "public"."eq_by"."by_level" IS '��������';
COMMENT ON COLUMN "public"."eq_by"."shutdown" IS '�Ƿ�ͣ����0��ͣ�� 1ͣ����Ĭ��0';
COMMENT ON COLUMN "public"."eq_by"."creator" IS '������';
COMMENT ON COLUMN "public"."eq_by"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_by"."updater" IS '������';
COMMENT ON COLUMN "public"."eq_by"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_by"."work_desc" IS '��������';
COMMENT ON COLUMN "public"."eq_by"."eq_by_plan_id" IS '�豸�����ƻ�id';
COMMENT ON COLUMN "public"."eq_by"."by_status" IS '����״̬';
COMMENT ON COLUMN "public"."eq_by"."by_no" IS '��������';
COMMENT ON COLUMN "public"."eq_by"."shutdown_time" IS 'ͣ��ʱ������λ���ӣ�';
COMMENT ON COLUMN "public"."eq_by"."by_start_time" IS '������ʼʱ��';
COMMENT ON COLUMN "public"."eq_by"."by_end_time" IS '��������ʱ��';
COMMENT ON COLUMN "public"."eq_by"."by_fee" IS '��������';
COMMENT ON COLUMN "public"."eq_by"."by_user" IS '������Ա';
COMMENT ON COLUMN "public"."eq_by"."by_time" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_by"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."eq_by"."tenant_code" IS '�⻧����';
COMMENT ON TABLE "public"."eq_by" IS '�豸����';

-- ----------------------------
-- Records of eq_by
-- ----------------------------

-- ----------------------------
-- Table structure for eq_by_detail
-- ----------------------------
DROP TABLE IF EXISTS "public"."eq_by_detail";
CREATE TABLE "public"."eq_by_detail" (
  "id" int8 NOT NULL,
  "by_id" int8,
  "name" varchar(255) COLLATE "pg_catalog"."default",
  "description" varchar(255) COLLATE "pg_catalog"."default",
  "bw_no" varchar(16) COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" timestamp(6),
  "updater" int8,
  "update_date" timestamp(6),
  "by_yesno" varchar(16) COLLATE "pg_catalog"."default",
  "by_template_id" int8,
  "by_template_detail_id" int8
)
;
COMMENT ON COLUMN "public"."eq_by_detail"."by_id" IS '����id';
COMMENT ON COLUMN "public"."eq_by_detail"."name" IS '��λ����';
COMMENT ON COLUMN "public"."eq_by_detail"."description" IS '����';
COMMENT ON COLUMN "public"."eq_by_detail"."bw_no" IS '���';
COMMENT ON COLUMN "public"."eq_by_detail"."creator" IS '������';
COMMENT ON COLUMN "public"."eq_by_detail"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_by_detail"."updater" IS '������';
COMMENT ON COLUMN "public"."eq_by_detail"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_by_detail"."by_yesno" IS '�Ƿ�����0δ������1������Ĭ��1';
COMMENT ON COLUMN "public"."eq_by_detail"."by_template_id" IS '����ģ��id';
COMMENT ON COLUMN "public"."eq_by_detail"."by_template_detail_id" IS '������λid';
COMMENT ON TABLE "public"."eq_by_detail" IS '������ϸ';

-- ----------------------------
-- Records of eq_by_detail
-- ----------------------------

-- ----------------------------
-- Table structure for eq_by_plan
-- ----------------------------
DROP TABLE IF EXISTS "public"."eq_by_plan";
CREATE TABLE "public"."eq_by_plan" (
  "id" int8 NOT NULL,
  "by_team" varchar(255) COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" timestamp(0),
  "updater" int8,
  "update_date" timestamp(0),
  "by_status" varchar(16) COLLATE "pg_catalog"."default",
  "by_no" varchar(64) COLLATE "pg_catalog"."default",
  "by_plan_time" timestamp(6),
  "by_level" varchar(16) COLLATE "pg_catalog"."default",
  "by_user" varchar(255) COLLATE "pg_catalog"."default",
  "by_desc" varchar(255) COLLATE "pg_catalog"."default",
  "things_id" int8,
  "by_template_id" varchar(2000) COLLATE "pg_catalog"."default",
  "remind_time" varchar(64) COLLATE "pg_catalog"."default",
  "plan_status" varchar(16) COLLATE "pg_catalog"."default",
  "loop_type" varchar(16) COLLATE "pg_catalog"."default",
  "loop_cycle" varchar(16) COLLATE "pg_catalog"."default",
  "plan_end_time" timestamp(0),
  "cycle_unit" varchar(20) COLLATE "pg_catalog"."default",
  "remind_time_unit" varchar(20) COLLATE "pg_catalog"."default",
  "dept_id" int8,
  "tenant_code" int8,
  "is_remind" varchar(16) COLLATE "pg_catalog"."default",
  "group_id" int8
)
;
COMMENT ON COLUMN "public"."eq_by_plan"."id" IS 'id';
COMMENT ON COLUMN "public"."eq_by_plan"."by_team" IS '��������';
COMMENT ON COLUMN "public"."eq_by_plan"."creator" IS '������';
COMMENT ON COLUMN "public"."eq_by_plan"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_by_plan"."updater" IS '������';
COMMENT ON COLUMN "public"."eq_by_plan"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_by_plan"."by_status" IS '����״̬';
COMMENT ON COLUMN "public"."eq_by_plan"."by_no" IS '��������';
COMMENT ON COLUMN "public"."eq_by_plan"."by_plan_time" IS '�����ƻ�ʱ��';
COMMENT ON COLUMN "public"."eq_by_plan"."by_level" IS '��������';
COMMENT ON COLUMN "public"."eq_by_plan"."by_user" IS '������Ա';
COMMENT ON COLUMN "public"."eq_by_plan"."by_desc" IS '��������';
COMMENT ON COLUMN "public"."eq_by_plan"."things_id" IS '�豸id';
COMMENT ON COLUMN "public"."eq_by_plan"."by_template_id" IS '����ģ��id�������������';
COMMENT ON COLUMN "public"."eq_by_plan"."remind_time" IS '����ʱ�䣨��ǰ���������ѣ�';
COMMENT ON COLUMN "public"."eq_by_plan"."plan_status" IS '�ƻ�״̬���Ƿ�ͣ��0���ã�1ͣ��';
COMMENT ON COLUMN "public"."eq_by_plan"."loop_type" IS 'ѭ�����ͣ�0���� 1���';
COMMENT ON COLUMN "public"."eq_by_plan"."loop_cycle" IS 'ѭ�����ڣ��죩';
COMMENT ON COLUMN "public"."eq_by_plan"."plan_end_time" IS '�����ƻ���ֹʱ��';
COMMENT ON COLUMN "public"."eq_by_plan"."cycle_unit" IS 'ѭ�����ڵ�λ hour/day';
COMMENT ON COLUMN "public"."eq_by_plan"."remind_time_unit" IS '����ʱ�䵥λ hour/day';
COMMENT ON COLUMN "public"."eq_by_plan"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."eq_by_plan"."tenant_code" IS '�⻧����';
COMMENT ON COLUMN "public"."eq_by_plan"."is_remind" IS '�Ƿ������ѹ� 0δ���� 1����';
COMMENT ON COLUMN "public"."eq_by_plan"."group_id" IS '�û���id';
COMMENT ON TABLE "public"."eq_by_plan" IS '�豸�����ƻ�';

-- ----------------------------
-- Records of eq_by_plan
-- ----------------------------

-- ----------------------------
-- Table structure for eq_by_plan_part
-- ----------------------------
DROP TABLE IF EXISTS "public"."eq_by_plan_part";
CREATE TABLE "public"."eq_by_plan_part" (
  "id" int8 NOT NULL,
  "use_count" varchar(16) COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" timestamp(0),
  "updater" int8,
  "update_date" timestamp(0),
  "eq_by_plan_id" int8,
  "eq_part_id" int8
)
;
COMMENT ON COLUMN "public"."eq_by_plan_part"."id" IS 'id';
COMMENT ON COLUMN "public"."eq_by_plan_part"."use_count" IS '��������';
COMMENT ON COLUMN "public"."eq_by_plan_part"."creator" IS '������';
COMMENT ON COLUMN "public"."eq_by_plan_part"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_by_plan_part"."updater" IS '������';
COMMENT ON COLUMN "public"."eq_by_plan_part"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_by_plan_part"."eq_by_plan_id" IS '�豸�����ƻ�id';
COMMENT ON COLUMN "public"."eq_by_plan_part"."eq_part_id" IS '�豸����id';
COMMENT ON TABLE "public"."eq_by_plan_part" IS '�����ƻ���������';

-- ----------------------------
-- Records of eq_by_plan_part
-- ----------------------------

-- ----------------------------
-- Table structure for eq_by_template
-- ----------------------------
DROP TABLE IF EXISTS "public"."eq_by_template";
CREATE TABLE "public"."eq_by_template" (
  "id" int8 NOT NULL,
  "name" varchar(255) COLLATE "pg_catalog"."default",
  "by_tool" varchar(255) COLLATE "pg_catalog"."default",
  "by_purpose" varchar(16) COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" timestamp(6),
  "updater" int8,
  "update_date" timestamp(6),
  "description" varchar(2000) COLLATE "pg_catalog"."default",
  "device_type_id" int8,
  "dept_id" int8,
  "tenant_code" int8
)
;
COMMENT ON COLUMN "public"."eq_by_template"."name" IS '����ģ��';
COMMENT ON COLUMN "public"."eq_by_template"."by_tool" IS '��������';
COMMENT ON COLUMN "public"."eq_by_template"."by_purpose" IS '����Ŀ��';
COMMENT ON COLUMN "public"."eq_by_template"."creator" IS '������';
COMMENT ON COLUMN "public"."eq_by_template"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_by_template"."updater" IS '������';
COMMENT ON COLUMN "public"."eq_by_template"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_by_template"."description" IS '����';
COMMENT ON COLUMN "public"."eq_by_template"."device_type_id" IS '�豸����id';
COMMENT ON COLUMN "public"."eq_by_template"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."eq_by_template"."tenant_code" IS '�⻧����';
COMMENT ON TABLE "public"."eq_by_template" IS '����ģ��';

-- ----------------------------
-- Records of eq_by_template
-- ----------------------------

-- ----------------------------
-- Table structure for eq_by_template_detail
-- ----------------------------
DROP TABLE IF EXISTS "public"."eq_by_template_detail";
CREATE TABLE "public"."eq_by_template_detail" (
  "id" int8 NOT NULL,
  "by_template_id" int8,
  "name" varchar(255) COLLATE "pg_catalog"."default",
  "description" varchar(255) COLLATE "pg_catalog"."default",
  "bw_no" varchar(16) COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" timestamp(6),
  "updater" int8,
  "update_date" timestamp(6)
)
;
COMMENT ON COLUMN "public"."eq_by_template_detail"."by_template_id" IS '����ģ��id';
COMMENT ON COLUMN "public"."eq_by_template_detail"."name" IS '��λ����';
COMMENT ON COLUMN "public"."eq_by_template_detail"."description" IS '����';
COMMENT ON COLUMN "public"."eq_by_template_detail"."bw_no" IS '���';
COMMENT ON COLUMN "public"."eq_by_template_detail"."creator" IS '������';
COMMENT ON COLUMN "public"."eq_by_template_detail"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_by_template_detail"."updater" IS '������';
COMMENT ON COLUMN "public"."eq_by_template_detail"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."eq_by_template_detail" IS '����ģ����ϸ';

-- ----------------------------
-- Records of eq_by_template_detail
-- ----------------------------

-- ----------------------------
-- Table structure for eq_check_result
-- ----------------------------
DROP TABLE IF EXISTS "public"."eq_check_result";
CREATE TABLE "public"."eq_check_result" (
  "id" int8 NOT NULL,
  "check_record_id" int8,
  "type" varchar(5) COLLATE "pg_catalog"."default",
  "check_result" text COLLATE "pg_catalog"."default",
  "thing_id" int8,
  "creator" int8,
  "create_date" timestamp(6),
  "updater" int8,
  "update_date" timestamp(6),
  "check_start" timestamp(6),
  "check_end" timestamp(6),
  "check_status" varchar(5) COLLATE "pg_catalog"."default" DEFAULT 0,
  "check_plan_id" int8
)
;
COMMENT ON COLUMN "public"."eq_check_result"."check_record_id" IS 'Ѳ���¼id';
COMMENT ON COLUMN "public"."eq_check_result"."type" IS '1:Ѳ���¼';
COMMENT ON COLUMN "public"."eq_check_result"."check_result" IS '�����';
COMMENT ON COLUMN "public"."eq_check_result"."thing_id" IS '�豸��id';
COMMENT ON COLUMN "public"."eq_check_result"."creator" IS '������';
COMMENT ON COLUMN "public"."eq_check_result"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_check_result"."updater" IS '������';
COMMENT ON COLUMN "public"."eq_check_result"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_check_result"."check_start" IS 'Ѳ�쿪ʼʱ��';
COMMENT ON COLUMN "public"."eq_check_result"."check_end" IS 'Ѳ�����ʱ��';
COMMENT ON COLUMN "public"."eq_check_result"."check_status" IS 'Ѳ��״̬ 0:δ�죨һ�û����ж�Ϊδ�죩 1:�Ѽ� 2:�쳣(�豸��������δ��Ļ�����쳣���ж�Ϊ�쳣)';
COMMENT ON COLUMN "public"."eq_check_result"."check_plan_id" IS 'Ѳ��ƻ�id';

-- ----------------------------
-- Records of eq_check_result
-- ----------------------------

-- ----------------------------
-- Table structure for eq_check_setting
-- ----------------------------
DROP TABLE IF EXISTS "public"."eq_check_setting";
CREATE TABLE "public"."eq_check_setting" (
  "id" int8 NOT NULL,
  "thing_id" int8,
  "standard_id" int8,
  "user_id" int8,
  "creator" int8,
  "create_date" timestamp(6),
  "updater" int8,
  "update_date" timestamp(6),
  "type" varchar(16) COLLATE "pg_catalog"."default",
  "patrolcheck_plan_id" int8
)
;
COMMENT ON COLUMN "public"."eq_check_setting"."id" IS 'id';
COMMENT ON COLUMN "public"."eq_check_setting"."thing_id" IS '�豸id';
COMMENT ON COLUMN "public"."eq_check_setting"."standard_id" IS '��׼id';
COMMENT ON COLUMN "public"."eq_check_setting"."user_id" IS '������id(����)';
COMMENT ON COLUMN "public"."eq_check_setting"."creator" IS '������';
COMMENT ON COLUMN "public"."eq_check_setting"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_check_setting"."updater" IS '������';
COMMENT ON COLUMN "public"."eq_check_setting"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_check_setting"."type" IS '����0��� 1Ѳ��';
COMMENT ON COLUMN "public"."eq_check_setting"."patrolcheck_plan_id" IS 'Ѳ��ƻ�id';
COMMENT ON TABLE "public"."eq_check_setting" IS '�豸�������';

-- ----------------------------
-- Records of eq_check_setting
-- ----------------------------

-- ----------------------------
-- Table structure for eq_check_standard
-- ----------------------------
DROP TABLE IF EXISTS "public"."eq_check_standard";
CREATE TABLE "public"."eq_check_standard" (
  "id" int8 NOT NULL,
  "group_id" int8,
  "name" varchar(100) COLLATE "pg_catalog"."default",
  "check_tool" varchar(255) COLLATE "pg_catalog"."default",
  "check_purpose" varchar(255) COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" timestamp(6),
  "updater" int8,
  "update_date" timestamp(6),
  "tip" varchar(2000) COLLATE "pg_catalog"."default",
  "device_type_id" int8,
  "dept_id" int8,
  "tenant_code" int8
)
;
COMMENT ON COLUMN "public"."eq_check_standard"."group_id" IS '�豸����id';
COMMENT ON COLUMN "public"."eq_check_standard"."name" IS '��׼����';
COMMENT ON COLUMN "public"."eq_check_standard"."check_tool" IS '��鹤��';
COMMENT ON COLUMN "public"."eq_check_standard"."check_purpose" IS '���Ŀ��';
COMMENT ON COLUMN "public"."eq_check_standard"."creator" IS '������';
COMMENT ON COLUMN "public"."eq_check_standard"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_check_standard"."updater" IS '������';
COMMENT ON COLUMN "public"."eq_check_standard"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_check_standard"."tip" IS '��ע';
COMMENT ON COLUMN "public"."eq_check_standard"."device_type_id" IS '�豸����id';
COMMENT ON COLUMN "public"."eq_check_standard"."tenant_code" IS '�⻧code';
COMMENT ON TABLE "public"."eq_check_standard" IS '����׼';

-- ----------------------------
-- Records of eq_check_standard
-- ----------------------------

-- ----------------------------
-- Table structure for eq_check_standard_detail
-- ----------------------------
DROP TABLE IF EXISTS "public"."eq_check_standard_detail";
CREATE TABLE "public"."eq_check_standard_detail" (
  "id" int8 NOT NULL,
  "standard_id" int8,
  "name" varchar(255) COLLATE "pg_catalog"."default",
  "reference_value" varchar(255) COLLATE "pg_catalog"."default",
  "upper_limit" varchar(16) COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" timestamp(6),
  "updater" int8,
  "update_date" timestamp(6),
  "lower_limit" varchar(16) COLLATE "pg_catalog"."default",
  "type" varchar(5) COLLATE "pg_catalog"."default",
  "remark" varchar(255) COLLATE "pg_catalog"."default",
  "data_gather" varchar(10) COLLATE "pg_catalog"."default",
  "dict_code" varchar(64) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."eq_check_standard_detail"."standard_id" IS '����׼id';
COMMENT ON COLUMN "public"."eq_check_standard_detail"."name" IS '�������';
COMMENT ON COLUMN "public"."eq_check_standard_detail"."reference_value" IS '�ο�ֵ';
COMMENT ON COLUMN "public"."eq_check_standard_detail"."upper_limit" IS '����';
COMMENT ON COLUMN "public"."eq_check_standard_detail"."creator" IS '������';
COMMENT ON COLUMN "public"."eq_check_standard_detail"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_check_standard_detail"."updater" IS '������';
COMMENT ON COLUMN "public"."eq_check_standard_detail"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_check_standard_detail"."lower_limit" IS '����';
COMMENT ON COLUMN "public"."eq_check_standard_detail"."type" IS '�ж����� 0:������ֵ�ж�  1:���������ж� 2:�ɼ�����ж�';
COMMENT ON COLUMN "public"."eq_check_standard_detail"."remark" IS '��ע';
COMMENT ON COLUMN "public"."eq_check_standard_detail"."data_gather" IS '�Ƿ�ɼ�';
COMMENT ON COLUMN "public"."eq_check_standard_detail"."dict_code" IS '���Ա��룬���ʱ���Ÿ���';
COMMENT ON TABLE "public"."eq_check_standard_detail" IS '����׼��ϸ';

-- ----------------------------
-- Records of eq_check_standard_detail
-- ----------------------------

-- ----------------------------
-- Table structure for eq_file_delete
-- ----------------------------
DROP TABLE IF EXISTS "public"."eq_file_delete";
CREATE TABLE "public"."eq_file_delete" (
  "id" int8 NOT NULL,
  "url" varchar(255) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."eq_file_delete"."id" IS 'oss��id';
COMMENT ON COLUMN "public"."eq_file_delete"."url" IS '�ļ�·��';

-- ----------------------------
-- Records of eq_file_delete
-- ----------------------------

-- ----------------------------
-- Table structure for eq_file_manage
-- ----------------------------
DROP TABLE IF EXISTS "public"."eq_file_manage";
CREATE TABLE "public"."eq_file_manage" (
  "id" int8 NOT NULL,
  "file_name" varchar(255) COLLATE "pg_catalog"."default",
  "file_type" varchar(5) COLLATE "pg_catalog"."default",
  "file_suffix" varchar(255) COLLATE "pg_catalog"."default",
  "file_path" varchar(255) COLLATE "pg_catalog"."default",
  "parent_id" int8,
  "creator" int8,
  "create_date" timestamp(0),
  "updater" int8,
  "update_date" timestamp(0),
  "file_size" numeric(20,2),
  "file_store_path" varchar(255) COLLATE "pg_catalog"."default",
  "file_id_path" varchar(255) COLLATE "pg_catalog"."default",
  "file_desc" varchar(255) COLLATE "pg_catalog"."default",
  "dept_id" int8,
  "tenant_code" int8
)
;
COMMENT ON COLUMN "public"."eq_file_manage"."file_name" IS '�ļ���';
COMMENT ON COLUMN "public"."eq_file_manage"."file_type" IS '�ļ����� 0:Ŀ¼ 1:�ļ�';
COMMENT ON COLUMN "public"."eq_file_manage"."file_suffix" IS '�ļ���׺ �ļ�������1��ʱ�����ֵ';
COMMENT ON COLUMN "public"."eq_file_manage"."file_path" IS '�ļ�·��';
COMMENT ON COLUMN "public"."eq_file_manage"."parent_id" IS '�ļ���id';
COMMENT ON COLUMN "public"."eq_file_manage"."creator" IS '������';
COMMENT ON COLUMN "public"."eq_file_manage"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_file_manage"."updater" IS '������';
COMMENT ON COLUMN "public"."eq_file_manage"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_file_manage"."file_size" IS '�ļ���С';
COMMENT ON COLUMN "public"."eq_file_manage"."file_store_path" IS '�ļ�ʵ�ʴ洢·��';
COMMENT ON COLUMN "public"."eq_file_manage"."file_id_path" IS '�ļ�����id����';
COMMENT ON COLUMN "public"."eq_file_manage"."file_desc" IS '�ļ�����';
COMMENT ON COLUMN "public"."eq_file_manage"."tenant_code" IS '�⻧code';

-- ----------------------------
-- Records of eq_file_manage
-- ----------------------------

-- ----------------------------
-- Table structure for eq_part_record
-- ----------------------------
DROP TABLE IF EXISTS "public"."eq_part_record";
CREATE TABLE "public"."eq_part_record" (
  "id" int8 NOT NULL,
  "use_count" varchar(16) COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" timestamp(0),
  "updater" int8,
  "update_date" timestamp(0),
  "eq_operate_id" int8,
  "eq_part_id" int8,
  "type" varchar(16) COLLATE "pg_catalog"."default",
  "dept_id" int8,
  "tenant_code" int8
)
;
COMMENT ON COLUMN "public"."eq_part_record"."id" IS 'id';
COMMENT ON COLUMN "public"."eq_part_record"."use_count" IS '��������';
COMMENT ON COLUMN "public"."eq_part_record"."creator" IS '������';
COMMENT ON COLUMN "public"."eq_part_record"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_part_record"."updater" IS '������';
COMMENT ON COLUMN "public"."eq_part_record"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_part_record"."eq_operate_id" IS '�豸����id�������豸�������豸ά�޵ȣ�';
COMMENT ON COLUMN "public"."eq_part_record"."eq_part_id" IS '�豸����id';
COMMENT ON COLUMN "public"."eq_part_record"."type" IS '��������0�豸ά�� 1�豸����';
COMMENT ON COLUMN "public"."eq_part_record"."dept_id" IS '��ҵid';
COMMENT ON COLUMN "public"."eq_part_record"."tenant_code" IS '�⻧code';
COMMENT ON TABLE "public"."eq_part_record" IS '����ʹ�ü�¼';

-- ----------------------------
-- Records of eq_part_record
-- ----------------------------

-- ----------------------------
-- Table structure for eq_patrol_check_plan
-- ----------------------------
DROP TABLE IF EXISTS "public"."eq_patrol_check_plan";
CREATE TABLE "public"."eq_patrol_check_plan" (
  "id" int8 NOT NULL,
  "creator" int8,
  "create_date" timestamp(0),
  "updater" int8,
  "update_date" timestamp(0),
  "name" varchar(255) COLLATE "pg_catalog"."default",
  "check_cycle" int4,
  "plan_start_time" timestamp(0),
  "plan_end_time" timestamp(0),
  "plan_status" varchar(16) COLLATE "pg_catalog"."default",
  "user_id" varchar(255) COLLATE "pg_catalog"."default",
  "remind_time" varchar(16) COLLATE "pg_catalog"."default",
  "dept_id" int8,
  "tenant_code" int8,
  "plan_no" varchar(16) COLLATE "pg_catalog"."default",
  "plan_range_param" int8,
  "check_cycle_unit" varchar(20) COLLATE "pg_catalog"."default",
  "check_end_time" timestamp(6),
  "type" varchar(5) COLLATE "pg_catalog"."default",
  "next_batch_time" timestamp(6),
  "act_user_id" int8,
  "act_check_time" timestamp(6),
  "remark" varchar(255) COLLATE "pg_catalog"."default",
  "patrol_check_plan_no" varchar(20) COLLATE "pg_catalog"."default",
  "execute_plan_status" varchar(5) COLLATE "pg_catalog"."default",
  "remind_time_unit" varchar(20) COLLATE "pg_catalog"."default",
  "is_remind" varchar(16) COLLATE "pg_catalog"."default",
  "group_id" int8
)
;
COMMENT ON COLUMN "public"."eq_patrol_check_plan"."id" IS 'id';
COMMENT ON COLUMN "public"."eq_patrol_check_plan"."creator" IS '������';
COMMENT ON COLUMN "public"."eq_patrol_check_plan"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_patrol_check_plan"."updater" IS '������';
COMMENT ON COLUMN "public"."eq_patrol_check_plan"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_patrol_check_plan"."name" IS 'Ѳ��ƻ�����';
COMMENT ON COLUMN "public"."eq_patrol_check_plan"."check_cycle" IS '�������';
COMMENT ON COLUMN "public"."eq_patrol_check_plan"."plan_start_time" IS '�ƻ���ʼʱ��';
COMMENT ON COLUMN "public"."eq_patrol_check_plan"."plan_end_time" IS '�ƻ�����ʱ��';
COMMENT ON COLUMN "public"."eq_patrol_check_plan"."plan_status" IS '�ƻ�״̬';
COMMENT ON COLUMN "public"."eq_patrol_check_plan"."user_id" IS '�ƻ�ִ����';
COMMENT ON COLUMN "public"."eq_patrol_check_plan"."remind_time" IS '����ʱ�䣨�ƻ���ʼʱ��ǰ���������ѣ�';
COMMENT ON COLUMN "public"."eq_patrol_check_plan"."dept_id" IS '��ҵid';
COMMENT ON COLUMN "public"."eq_patrol_check_plan"."tenant_code" IS '�⻧code';
COMMENT ON COLUMN "public"."eq_patrol_check_plan"."plan_no" IS 'Ѳ��ƻ����';
COMMENT ON COLUMN "public"."eq_patrol_check_plan"."plan_range_param" IS 'ִ�з�Χ����';
COMMENT ON COLUMN "public"."eq_patrol_check_plan"."check_cycle_unit" IS '������ڵ�λ hour/day';
COMMENT ON COLUMN "public"."eq_patrol_check_plan"."check_end_time" IS '��ֹʱ��';
COMMENT ON COLUMN "public"."eq_patrol_check_plan"."type" IS '0:���� 1:���';
COMMENT ON COLUMN "public"."eq_patrol_check_plan"."next_batch_time" IS '�´μ�¼����ʱ��';
COMMENT ON COLUMN "public"."eq_patrol_check_plan"."act_user_id" IS 'ʵ��Ѳ����';
COMMENT ON COLUMN "public"."eq_patrol_check_plan"."act_check_time" IS 'ʵ��Ѳ��ʱ��';
COMMENT ON COLUMN "public"."eq_patrol_check_plan"."remark" IS '��ע';
COMMENT ON COLUMN "public"."eq_patrol_check_plan"."patrol_check_plan_no" IS 'Ѳ��ƻ�����';
COMMENT ON COLUMN "public"."eq_patrol_check_plan"."execute_plan_status" IS 'ִ��״̬ 0����ִ�� 1��ִ���� 2�������';
COMMENT ON COLUMN "public"."eq_patrol_check_plan"."remind_time_unit" IS '����ʱ�䵥λ hour/day';
COMMENT ON COLUMN "public"."eq_patrol_check_plan"."is_remind" IS '�Ƿ������ѹ� 0δ���� 1����';
COMMENT ON COLUMN "public"."eq_patrol_check_plan"."group_id" IS '�û���id';
COMMENT ON TABLE "public"."eq_patrol_check_plan" IS '�豸Ѳ��ƻ�';

-- ----------------------------
-- Records of eq_patrol_check_plan
-- ----------------------------

-- ----------------------------
-- Table structure for eq_patrol_check_record
-- ----------------------------
DROP TABLE IF EXISTS "public"."eq_patrol_check_record";
CREATE TABLE "public"."eq_patrol_check_record" (
  "id" int8 NOT NULL,
  "patrol_check_plan_id" int8,
  "user_id" int8,
  "creator" int8,
  "create_date" timestamp(6),
  "updater" int8,
  "update_date" timestamp(6),
  "no_check_device_count" int4,
  "abnormal_device_count" int4,
  "check_start_time" timestamp(6),
  "check_end_time" timestamp(6),
  "tip" varchar(255) COLLATE "pg_catalog"."default",
  "check_time" timestamp(6),
  "check_plan_time" varchar(50) COLLATE "pg_catalog"."default",
  "patrol_check_record_no" varchar(20) COLLATE "pg_catalog"."default",
  "dept_id" int8,
  "tenant_code" int8
)
;
COMMENT ON COLUMN "public"."eq_patrol_check_record"."patrol_check_plan_id" IS 'Ѳ��ƻ�id';
COMMENT ON COLUMN "public"."eq_patrol_check_record"."user_id" IS '������id';
COMMENT ON COLUMN "public"."eq_patrol_check_record"."creator" IS '������';
COMMENT ON COLUMN "public"."eq_patrol_check_record"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_patrol_check_record"."updater" IS '������';
COMMENT ON COLUMN "public"."eq_patrol_check_record"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_patrol_check_record"."no_check_device_count" IS 'δ���豸��';
COMMENT ON COLUMN "public"."eq_patrol_check_record"."abnormal_device_count" IS '�쳣�豸��';
COMMENT ON COLUMN "public"."eq_patrol_check_record"."check_start_time" IS '��鿪ʼʱ��';
COMMENT ON COLUMN "public"."eq_patrol_check_record"."check_end_time" IS '������ʱ��';
COMMENT ON COLUMN "public"."eq_patrol_check_record"."tip" IS '��ע';
COMMENT ON COLUMN "public"."eq_patrol_check_record"."check_time" IS 'Ѳ��ʱ��';
COMMENT ON COLUMN "public"."eq_patrol_check_record"."check_plan_time" IS '�ƻ�Ѳ��ʱ��';
COMMENT ON COLUMN "public"."eq_patrol_check_record"."patrol_check_record_no" IS 'Ѳ���¼����';
COMMENT ON COLUMN "public"."eq_patrol_check_record"."tenant_code" IS '�⻧code';
COMMENT ON TABLE "public"."eq_patrol_check_record" IS '�豸Ѳ���¼';

-- ----------------------------
-- Records of eq_patrol_check_record
-- ----------------------------

-- ----------------------------
-- Table structure for eq_plan_record
-- ----------------------------
DROP TABLE IF EXISTS "public"."eq_plan_record";
CREATE TABLE "public"."eq_plan_record" (
  "id" int8 NOT NULL,
  "creator" int8,
  "create_date" timestamp(0),
  "updater" int8,
  "update_date" timestamp(0),
  "plan_start_time" timestamp(0),
  "plan_end_time" timestamp(0),
  "user_id" varchar(255) COLLATE "pg_catalog"."default",
  "dept_id" int8,
  "tenant_code" int8,
  "plan_name" varchar(255) COLLATE "pg_catalog"."default",
  "plan_id" int8,
  "thing_id" int8,
  "handle" varchar(16) COLLATE "pg_catalog"."default",
  "type" varchar(16) COLLATE "pg_catalog"."default",
  "reason" varchar(255) COLLATE "pg_catalog"."default",
  "plan_no" varchar(16) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."eq_plan_record"."id" IS 'id';
COMMENT ON COLUMN "public"."eq_plan_record"."creator" IS '������';
COMMENT ON COLUMN "public"."eq_plan_record"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_plan_record"."updater" IS '������';
COMMENT ON COLUMN "public"."eq_plan_record"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_plan_record"."plan_start_time" IS '�ƻ���ʼʱ��';
COMMENT ON COLUMN "public"."eq_plan_record"."plan_end_time" IS '�ƻ�����ʱ��';
COMMENT ON COLUMN "public"."eq_plan_record"."user_id" IS '�ƻ�ִ����';
COMMENT ON COLUMN "public"."eq_plan_record"."dept_id" IS '��ҵid';
COMMENT ON COLUMN "public"."eq_plan_record"."tenant_code" IS '�⻧code';
COMMENT ON COLUMN "public"."eq_plan_record"."plan_name" IS '�ƻ�����';
COMMENT ON COLUMN "public"."eq_plan_record"."plan_id" IS '�ƻ�id';
COMMENT ON COLUMN "public"."eq_plan_record"."thing_id" IS '�豸id';
COMMENT ON COLUMN "public"."eq_plan_record"."handle" IS '�Ƿ��� 0δ���� 1�Ѵ���';
COMMENT ON COLUMN "public"."eq_plan_record"."type" IS '�ƻ����� 0���� 1Ѳ��';
COMMENT ON COLUMN "public"."eq_plan_record"."reason" IS 'δִ��ԭ��';
COMMENT ON COLUMN "public"."eq_plan_record"."plan_no" IS '�ƻ����';
COMMENT ON TABLE "public"."eq_plan_record" IS '�ƻ�δִ�м�¼';

-- ----------------------------
-- Records of eq_plan_record
-- ----------------------------

-- ----------------------------
-- Table structure for eq_plan_remind_record
-- ----------------------------
DROP TABLE IF EXISTS "public"."eq_plan_remind_record";
CREATE TABLE "public"."eq_plan_remind_record" (
  "id" int8 NOT NULL,
  "creator" int8,
  "create_date" timestamp(0),
  "updater" int8,
  "update_date" timestamp(0),
  "type" varchar(16) COLLATE "pg_catalog"."default",
  "no" varchar(64) COLLATE "pg_catalog"."default",
  "start_time" timestamp(6),
  "end_time" timestamp(6),
  "user_id" varchar(255) COLLATE "pg_catalog"."default",
  "dept_id" int8,
  "tenant_code" int8
)
;
COMMENT ON COLUMN "public"."eq_plan_remind_record"."id" IS 'id';
COMMENT ON COLUMN "public"."eq_plan_remind_record"."creator" IS '������';
COMMENT ON COLUMN "public"."eq_plan_remind_record"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_plan_remind_record"."updater" IS '������';
COMMENT ON COLUMN "public"."eq_plan_remind_record"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_plan_remind_record"."type" IS '����0�����ƻ� 1Ѳ��ƻ�';
COMMENT ON COLUMN "public"."eq_plan_remind_record"."no" IS '����';
COMMENT ON COLUMN "public"."eq_plan_remind_record"."start_time" IS '�����ƻ�ʱ��';
COMMENT ON COLUMN "public"."eq_plan_remind_record"."end_time" IS '�ƻ���ֹʱ��';
COMMENT ON COLUMN "public"."eq_plan_remind_record"."user_id" IS '��Աid�����������';
COMMENT ON COLUMN "public"."eq_plan_remind_record"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."eq_plan_remind_record"."tenant_code" IS '�⻧����';
COMMENT ON TABLE "public"."eq_plan_remind_record" IS '�ƻ��������Ѽ�¼';

-- ----------------------------
-- Records of eq_plan_remind_record
-- ----------------------------

-- ----------------------------
-- Table structure for eq_scrap
-- ----------------------------
DROP TABLE IF EXISTS "public"."eq_scrap";
CREATE TABLE "public"."eq_scrap" (
  "id" int8 NOT NULL,
  "creator" int8,
  "create_date" timestamp(0),
  "updater" int8,
  "update_date" timestamp(0),
  "eq_id" int8 NOT NULL,
  "scrap_user_id" int8,
  "examine_user_id" int8,
  "scrap_disposal" varchar(16) COLLATE "pg_catalog"."default",
  "dept_id" int8,
  "tenant_code" int8
)
;
COMMENT ON COLUMN "public"."eq_scrap"."id" IS 'id';
COMMENT ON COLUMN "public"."eq_scrap"."creator" IS '������';
COMMENT ON COLUMN "public"."eq_scrap"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_scrap"."updater" IS '������';
COMMENT ON COLUMN "public"."eq_scrap"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_scrap"."eq_id" IS '�豸id';
COMMENT ON COLUMN "public"."eq_scrap"."scrap_user_id" IS '������id';
COMMENT ON COLUMN "public"."eq_scrap"."examine_user_id" IS '�����id';
COMMENT ON COLUMN "public"."eq_scrap"."scrap_disposal" IS '�����Ƿ��� 0δ���� 1�Ѵ���';
COMMENT ON COLUMN "public"."eq_scrap"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."eq_scrap"."tenant_code" IS '�⻧����';
COMMENT ON TABLE "public"."eq_scrap" IS '�豸����';

-- ----------------------------
-- Records of eq_scrap
-- ----------------------------

-- ----------------------------
-- Table structure for eq_spot_check_plan
-- ----------------------------
DROP TABLE IF EXISTS "public"."eq_spot_check_plan";
CREATE TABLE "public"."eq_spot_check_plan" (
  "id" int8 NOT NULL,
  "thing_id" int8,
  "last_check_time" timestamp(6),
  "use_id" varchar(255) COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" timestamp(0),
  "updater" int8,
  "update_date" timestamp(0),
  "spot_check_no" varchar(20) COLLATE "pg_catalog"."default",
  "dept_id" int8,
  "tenant_code" int8
)
;
COMMENT ON COLUMN "public"."eq_spot_check_plan"."thing_id" IS '�豸thingid';
COMMENT ON COLUMN "public"."eq_spot_check_plan"."last_check_time" IS '�ϴε��ʱ��';
COMMENT ON COLUMN "public"."eq_spot_check_plan"."use_id" IS '������';
COMMENT ON COLUMN "public"."eq_spot_check_plan"."creator" IS '������';
COMMENT ON COLUMN "public"."eq_spot_check_plan"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_spot_check_plan"."updater" IS '������';
COMMENT ON COLUMN "public"."eq_spot_check_plan"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_spot_check_plan"."spot_check_no" IS '���ƻ�����';
COMMENT ON COLUMN "public"."eq_spot_check_plan"."tenant_code" IS '�⻧code';

-- ----------------------------
-- Records of eq_spot_check_plan
-- ----------------------------

-- ----------------------------
-- Table structure for eq_spot_check_record
-- ----------------------------
DROP TABLE IF EXISTS "public"."eq_spot_check_record";
CREATE TABLE "public"."eq_spot_check_record" (
  "id" int8 NOT NULL,
  "thing_id" int8,
  "standard_id" int8,
  "user_id" int8,
  "creator" int8,
  "create_date" timestamp(6),
  "updater" int8,
  "update_date" timestamp(6),
  "check_time" timestamp(6),
  "use_time" varchar(16) COLLATE "pg_catalog"."default",
  "check_result" text COLLATE "pg_catalog"."default",
  "tip" varchar(255) COLLATE "pg_catalog"."default",
  "spot_check_id" int8,
  "spot_check_record_no" varchar(20) COLLATE "pg_catalog"."default",
  "dept_id" int8,
  "tenant_code" int8
)
;
COMMENT ON COLUMN "public"."eq_spot_check_record"."thing_id" IS '�豸id';
COMMENT ON COLUMN "public"."eq_spot_check_record"."standard_id" IS '��׼id�����ã�';
COMMENT ON COLUMN "public"."eq_spot_check_record"."user_id" IS '������id';
COMMENT ON COLUMN "public"."eq_spot_check_record"."creator" IS '������';
COMMENT ON COLUMN "public"."eq_spot_check_record"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_spot_check_record"."updater" IS '������';
COMMENT ON COLUMN "public"."eq_spot_check_record"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_spot_check_record"."check_time" IS '���ʱ��';
COMMENT ON COLUMN "public"."eq_spot_check_record"."use_time" IS '��ʱ��Сʱ��';
COMMENT ON COLUMN "public"."eq_spot_check_record"."check_result" IS '�����';
COMMENT ON COLUMN "public"."eq_spot_check_record"."tip" IS '��ע';
COMMENT ON COLUMN "public"."eq_spot_check_record"."spot_check_id" IS '���ƻ�id';
COMMENT ON COLUMN "public"."eq_spot_check_record"."spot_check_record_no" IS '����¼����';
COMMENT ON COLUMN "public"."eq_spot_check_record"."tenant_code" IS '�⻧code';
COMMENT ON TABLE "public"."eq_spot_check_record" IS '�豸����¼';

-- ----------------------------
-- Records of eq_spot_check_record
-- ----------------------------

-- ----------------------------
-- Table structure for eq_user_group
-- ----------------------------
DROP TABLE IF EXISTS "public"."eq_user_group";
CREATE TABLE "public"."eq_user_group" (
  "id" int8 NOT NULL,
  "user_id" varchar(255) COLLATE "pg_catalog"."default",
  "name" varchar(255) COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" timestamp(0),
  "updater" int8,
  "update_date" timestamp(0),
  "dept_id" int8,
  "tenant_code" int8
)
;
COMMENT ON COLUMN "public"."eq_user_group"."id" IS 'id';
COMMENT ON COLUMN "public"."eq_user_group"."user_id" IS 'usrid,���������';
COMMENT ON COLUMN "public"."eq_user_group"."name" IS '�û�����';
COMMENT ON COLUMN "public"."eq_user_group"."creator" IS '������';
COMMENT ON COLUMN "public"."eq_user_group"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_user_group"."updater" IS '������';
COMMENT ON COLUMN "public"."eq_user_group"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_user_group"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."eq_user_group"."tenant_code" IS '�⻧code';

-- ----------------------------
-- Records of eq_user_group
-- ----------------------------

-- ----------------------------
-- Table structure for eq_wx
-- ----------------------------
DROP TABLE IF EXISTS "public"."eq_wx";
CREATE TABLE "public"."eq_wx" (
  "id" int8 NOT NULL,
  "fault_reason" varchar(255) COLLATE "pg_catalog"."default",
  "wx_team" varchar(255) COLLATE "pg_catalog"."default",
  "urgent_level" varchar(16) COLLATE "pg_catalog"."default",
  "shutdown" varchar(16) COLLATE "pg_catalog"."default" DEFAULT 0,
  "creator" int8,
  "create_date" timestamp(0),
  "updater" int8,
  "update_date" timestamp(0),
  "work_desc" varchar(512) COLLATE "pg_catalog"."default",
  "eq_bx_id" int8 NOT NULL,
  "wx_level" varchar(16) COLLATE "pg_catalog"."default",
  "wx_status" varchar(16) COLLATE "pg_catalog"."default",
  "wx_no" varchar(64) COLLATE "pg_catalog"."default",
  "shutdown_time" varchar(64) COLLATE "pg_catalog"."default",
  "wx_start_time" timestamp(6),
  "wx_end_time" timestamp(6),
  "wx_fee" varchar(255) COLLATE "pg_catalog"."default",
  "wx_type" varchar(16) COLLATE "pg_catalog"."default",
  "tenant_code" int8
)
;
COMMENT ON COLUMN "public"."eq_wx"."id" IS 'id';
COMMENT ON COLUMN "public"."eq_wx"."fault_reason" IS '����ԭ��';
COMMENT ON COLUMN "public"."eq_wx"."wx_team" IS 'ά�ް���';
COMMENT ON COLUMN "public"."eq_wx"."urgent_level" IS '�����̶�';
COMMENT ON COLUMN "public"."eq_wx"."shutdown" IS '�Ƿ�ͣ����0��ͣ�� 1ͣ����Ĭ��0';
COMMENT ON COLUMN "public"."eq_wx"."creator" IS '������';
COMMENT ON COLUMN "public"."eq_wx"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_wx"."updater" IS '������';
COMMENT ON COLUMN "public"."eq_wx"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_wx"."work_desc" IS '��������';
COMMENT ON COLUMN "public"."eq_wx"."eq_bx_id" IS '�豸����id';
COMMENT ON COLUMN "public"."eq_wx"."wx_level" IS 'ά�޼���';
COMMENT ON COLUMN "public"."eq_wx"."wx_status" IS 'ά��״̬';
COMMENT ON COLUMN "public"."eq_wx"."wx_no" IS 'ά�޵���';
COMMENT ON COLUMN "public"."eq_wx"."shutdown_time" IS 'ͣ��ʱ������λ���ӣ�';
COMMENT ON COLUMN "public"."eq_wx"."wx_start_time" IS 'ά�޿�ʼʱ��';
COMMENT ON COLUMN "public"."eq_wx"."wx_end_time" IS 'ά�޽���ʱ��';
COMMENT ON COLUMN "public"."eq_wx"."wx_fee" IS 'ά�޷���';
COMMENT ON COLUMN "public"."eq_wx"."wx_type" IS 'ά�����';
COMMENT ON COLUMN "public"."eq_wx"."tenant_code" IS '�⻧����';
COMMENT ON TABLE "public"."eq_wx" IS '�豸ά��';

-- ----------------------------
-- Records of eq_wx
-- ----------------------------

-- ----------------------------
-- Table structure for eq_wx_plan
-- ----------------------------
DROP TABLE IF EXISTS "public"."eq_wx_plan";
CREATE TABLE "public"."eq_wx_plan" (
  "id" int8 NOT NULL,
  "wx_team" varchar(255) COLLATE "pg_catalog"."default",
  "urgent_level" varchar(5) COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" timestamp(0),
  "updater" int8,
  "update_date" timestamp(0),
  "work_desc" varchar(512) COLLATE "pg_catalog"."default",
  "eq_bx_id" int8,
  "wx_status" varchar(5) COLLATE "pg_catalog"."default",
  "wx_no" varchar(64) COLLATE "pg_catalog"."default",
  "wx_type" varchar(5) COLLATE "pg_catalog"."default",
  "wx_user" varchar(255) COLLATE "pg_catalog"."default",
  "work_time" varchar(5) COLLATE "pg_catalog"."default",
  "thing_id" int8,
  "fault_cause" varchar(5) COLLATE "pg_catalog"."default",
  "wx_level" varchar(5) COLLATE "pg_catalog"."default",
  "stop_status" varchar(5) COLLATE "pg_catalog"."default",
  "stop_time" varchar(20) COLLATE "pg_catalog"."default",
  "start_time" timestamp(6),
  "end_time" timestamp(6),
  "dept_id" int8,
  "tenant_code" int8
)
;
COMMENT ON COLUMN "public"."eq_wx_plan"."id" IS 'id';
COMMENT ON COLUMN "public"."eq_wx_plan"."wx_team" IS 'ά�ް���';
COMMENT ON COLUMN "public"."eq_wx_plan"."urgent_level" IS '�����̶�';
COMMENT ON COLUMN "public"."eq_wx_plan"."creator" IS '������';
COMMENT ON COLUMN "public"."eq_wx_plan"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_wx_plan"."updater" IS '������';
COMMENT ON COLUMN "public"."eq_wx_plan"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_wx_plan"."work_desc" IS '����';
COMMENT ON COLUMN "public"."eq_wx_plan"."eq_bx_id" IS '�豸����id';
COMMENT ON COLUMN "public"."eq_wx_plan"."wx_status" IS 'ά��״̬';
COMMENT ON COLUMN "public"."eq_wx_plan"."wx_no" IS 'ά�޵���';
COMMENT ON COLUMN "public"."eq_wx_plan"."wx_type" IS 'ά�����';
COMMENT ON COLUMN "public"."eq_wx_plan"."wx_user" IS 'ά����Ա';
COMMENT ON COLUMN "public"."eq_wx_plan"."work_time" IS '��������';
COMMENT ON COLUMN "public"."eq_wx_plan"."thing_id" IS '�豸��id';
COMMENT ON COLUMN "public"."eq_wx_plan"."fault_cause" IS '����ԭ��';
COMMENT ON COLUMN "public"."eq_wx_plan"."wx_level" IS 'ά�޼���';
COMMENT ON COLUMN "public"."eq_wx_plan"."stop_status" IS '�Ƿ�ͣ�� 0:��ͣ�� 1:ͣ��';
COMMENT ON COLUMN "public"."eq_wx_plan"."stop_time" IS 'ͣ��ʱ��';
COMMENT ON COLUMN "public"."eq_wx_plan"."start_time" IS '��ʼʱ��';
COMMENT ON COLUMN "public"."eq_wx_plan"."end_time" IS '����ʱ��';
COMMENT ON COLUMN "public"."eq_wx_plan"."tenant_code" IS '�⻧code';
COMMENT ON TABLE "public"."eq_wx_plan" IS '�豸ά�޼ƻ�';

-- ----------------------------
-- Records of eq_wx_plan
-- ----------------------------

-- ----------------------------
-- Table structure for eq_wx_replacement
-- ----------------------------
DROP TABLE IF EXISTS "public"."eq_wx_replacement";
CREATE TABLE "public"."eq_wx_replacement" (
  "id" int8 NOT NULL,
  "wx_plan_id" int8,
  "thing_id" int8,
  "use_count" int4
)
;
COMMENT ON COLUMN "public"."eq_wx_replacement"."wx_plan_id" IS 'ά�޼�¼���ƻ���id';
COMMENT ON COLUMN "public"."eq_wx_replacement"."thing_id" IS '������id';
COMMENT ON COLUMN "public"."eq_wx_replacement"."use_count" IS 'ʹ������';

-- ----------------------------
-- Records of eq_wx_replacement
-- ----------------------------

-- ----------------------------
-- Table structure for filter_log
-- ----------------------------
DROP TABLE IF EXISTS "public"."filter_log";
CREATE TABLE "public"."filter_log" (
  "id" int8 NOT NULL,
  "filter_rule_id" int8 NOT NULL,
  "formula" varchar(255) COLLATE "pg_catalog"."default",
  "source_info" text COLLATE "pg_catalog"."default" NOT NULL,
  "status" int4 NOT NULL,
  "time" int8,
  "result" bool,
  "error_info" text COLLATE "pg_catalog"."default",
  "calc_count" int4 DEFAULT 0,
  "tenant_code" int8 NOT NULL,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."filter_log"."id" IS '����';
COMMENT ON COLUMN "public"."filter_log"."filter_rule_id" IS '���˹������ñ�id';
COMMENT ON COLUMN "public"."filter_log"."formula" IS '��������';
COMMENT ON COLUMN "public"."filter_log"."source_info" IS '������Ϣ��json��ʽ';
COMMENT ON COLUMN "public"."filter_log"."status" IS '����״̬��1-��ƥ�䡢2-��ƥ�䡢3-����ɹ���4-�����쳣��5-��֪ͨ';
COMMENT ON COLUMN "public"."filter_log"."time" IS '����ʱ��';
COMMENT ON COLUMN "public"."filter_log"."result" IS '��������ֻ���Ѽ���ļ�¼����ֵ';
COMMENT ON COLUMN "public"."filter_log"."error_info" IS '������Ϣ';
COMMENT ON COLUMN "public"."filter_log"."calc_count" IS '�������';
COMMENT ON COLUMN "public"."filter_log"."tenant_code" IS '�⻧����';
COMMENT ON COLUMN "public"."filter_log"."company_id" IS '��ҵid';
COMMENT ON COLUMN "public"."filter_log"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."filter_log"."creator" IS '������';
COMMENT ON COLUMN "public"."filter_log"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."filter_log"."updater" IS '������';
COMMENT ON COLUMN "public"."filter_log"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."filter_log" IS '������־��';

-- ----------------------------
-- Records of filter_log
-- ----------------------------

-- ----------------------------
-- Table structure for filter_rule
-- ----------------------------
DROP TABLE IF EXISTS "public"."filter_rule";
CREATE TABLE "public"."filter_rule" (
  "id" int8 NOT NULL,
  "name" varchar(255) COLLATE "pg_catalog"."default",
  "formula" varchar(255) COLLATE "pg_catalog"."default",
  "formula_description" varchar(255) COLLATE "pg_catalog"."default",
  "remark" varchar(255) COLLATE "pg_catalog"."default",
  "enable" bool,
  "tenant_code" int8 NOT NULL,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."filter_rule"."id" IS '����';
COMMENT ON COLUMN "public"."filter_rule"."name" IS '���˹�������';
COMMENT ON COLUMN "public"."filter_rule"."formula" IS '���㹫ʽ';
COMMENT ON COLUMN "public"."filter_rule"."formula_description" IS '���㹫ʽ��������';
COMMENT ON COLUMN "public"."filter_rule"."remark" IS '��ע';
COMMENT ON COLUMN "public"."filter_rule"."enable" IS '�Ƿ�����';
COMMENT ON COLUMN "public"."filter_rule"."tenant_code" IS '�⻧����';
COMMENT ON COLUMN "public"."filter_rule"."company_id" IS '��ҵid';
COMMENT ON COLUMN "public"."filter_rule"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."filter_rule"."creator" IS '������';
COMMENT ON COLUMN "public"."filter_rule"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."filter_rule"."updater" IS '������';
COMMENT ON COLUMN "public"."filter_rule"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."filter_rule" IS '���˹����';

-- ----------------------------
-- Records of filter_rule
-- ----------------------------

-- ----------------------------
-- Table structure for filter_rule_detail
-- ----------------------------
DROP TABLE IF EXISTS "public"."filter_rule_detail";
CREATE TABLE "public"."filter_rule_detail" (
  "id" int8 NOT NULL,
  "filter_rule_id" int8 NOT NULL,
  "thing_name" varchar(100) COLLATE "pg_catalog"."default",
  "thing_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "attr_name" varchar(100) COLLATE "pg_catalog"."default",
  "attr_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "attr_alias" varchar(10) COLLATE "pg_catalog"."default",
  "data_type" int4,
  "agg_type" varchar(10) COLLATE "pg_catalog"."default",
  "agg_interval" int4,
  "timeunit" varchar(20) COLLATE "pg_catalog"."default",
  "tenant_code" int8 NOT NULL,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."filter_rule_detail"."id" IS '����';
COMMENT ON COLUMN "public"."filter_rule_detail"."filter_rule_id" IS '���˹���id';
COMMENT ON COLUMN "public"."filter_rule_detail"."thing_name" IS '������';
COMMENT ON COLUMN "public"."filter_rule_detail"."thing_code" IS '�����';
COMMENT ON COLUMN "public"."filter_rule_detail"."attr_name" IS '��������';
COMMENT ON COLUMN "public"."filter_rule_detail"."attr_code" IS '���Ա���';
COMMENT ON COLUMN "public"."filter_rule_detail"."attr_alias" IS '�����ڼ��㹫ʽ�еı���';
COMMENT ON COLUMN "public"."filter_rule_detail"."data_type" IS '�������ͣ�1-���£�2-���, 3-����';
COMMENT ON COLUMN "public"."filter_rule_detail"."agg_type" IS '�ۺ����ͣ�SUM|AVG|MAX|MIN|COUNT';
COMMENT ON COLUMN "public"."filter_rule_detail"."agg_interval" IS '�ۺ�ʱ����';
COMMENT ON COLUMN "public"."filter_rule_detail"."timeunit" IS '�ۺ�ʱ�䵥λ��MINUTE|HOUR|DAY|MONTH';
COMMENT ON COLUMN "public"."filter_rule_detail"."tenant_code" IS '�⻧����';
COMMENT ON COLUMN "public"."filter_rule_detail"."company_id" IS '��ҵid';
COMMENT ON COLUMN "public"."filter_rule_detail"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."filter_rule_detail"."creator" IS '������';
COMMENT ON COLUMN "public"."filter_rule_detail"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."filter_rule_detail"."updater" IS '������';
COMMENT ON COLUMN "public"."filter_rule_detail"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."filter_rule_detail" IS '���˹��������';

-- ----------------------------
-- Records of filter_rule_detail
-- ----------------------------

-- ----------------------------
-- Table structure for gateway_component
-- ----------------------------
DROP TABLE IF EXISTS "public"."gateway_component";
CREATE TABLE "public"."gateway_component" (
  "id" int8 NOT NULL,
  "name" varchar(100) COLLATE "pg_catalog"."default",
  "type" varchar(255) COLLATE "pg_catalog"."default",
  "description" varchar(500) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."gateway_component"."id" IS '����';
COMMENT ON COLUMN "public"."gateway_component"."name" IS '�������';
COMMENT ON COLUMN "public"."gateway_component"."type" IS '�������';
COMMENT ON COLUMN "public"."gateway_component"."description" IS '�������';
COMMENT ON TABLE "public"."gateway_component" IS '�������';

-- ----------------------------
-- Records of gateway_component
-- ----------------------------

-- ----------------------------
-- Table structure for gateway_component_config
-- ----------------------------
DROP TABLE IF EXISTS "public"."gateway_component_config";
CREATE TABLE "public"."gateway_component_config" (
  "id" int8 NOT NULL,
  "cmpt_id" int8,
  "cmpt_type" varchar(100) COLLATE "pg_catalog"."default",
  "cmpt_cfg_name" varchar(255) COLLATE "pg_catalog"."default",
  "cmpt_cfg_context" text COLLATE "pg_catalog"."default",
  "max_instance_num" int4,
  "active" bool,
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."gateway_component_config"."id" IS '����';
COMMENT ON COLUMN "public"."gateway_component_config"."cmpt_id" IS '���id';
COMMENT ON COLUMN "public"."gateway_component_config"."cmpt_type" IS '�������';
COMMENT ON COLUMN "public"."gateway_component_config"."cmpt_cfg_name" IS '�����������';
COMMENT ON COLUMN "public"."gateway_component_config"."cmpt_cfg_context" IS '�����������';
COMMENT ON COLUMN "public"."gateway_component_config"."max_instance_num" IS '���ʵ��������';
COMMENT ON COLUMN "public"."gateway_component_config"."active" IS '�Ƿ�����';
COMMENT ON TABLE "public"."gateway_component_config" IS '�����������';

-- ----------------------------
-- Records of gateway_component_config
-- ----------------------------

-- ----------------------------
-- Table structure for gateway_component_config_detail
-- ----------------------------
DROP TABLE IF EXISTS "public"."gateway_component_config_detail";
CREATE TABLE "public"."gateway_component_config_detail" (
  "id" int8 NOT NULL,
  "cfg_id" int8,
  "detail_context" varchar(500) COLLATE "pg_catalog"."default",
  "debug" bool,
  "read_write" int4,
  "remark" varchar(2000) COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."gateway_component_config_detail"."id" IS '����';
COMMENT ON COLUMN "public"."gateway_component_config_detail"."cfg_id" IS 'ͨѶ��������';
COMMENT ON COLUMN "public"."gateway_component_config_detail"."detail_context" IS '��������';
COMMENT ON COLUMN "public"."gateway_component_config_detail"."debug" IS '�Ƿ����';
COMMENT ON COLUMN "public"."gateway_component_config_detail"."read_write" IS '����(0-��; 1-д; 2-��д)';
COMMENT ON COLUMN "public"."gateway_component_config_detail"."remark" IS '��ע';
COMMENT ON COLUMN "public"."gateway_component_config_detail"."creator" IS '������';
COMMENT ON COLUMN "public"."gateway_component_config_detail"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."gateway_component_config_detail"."updater" IS '������';
COMMENT ON COLUMN "public"."gateway_component_config_detail"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."gateway_component_config_detail" IS '�����������飨�������⡢ͨ�����Ĵ�����ַλ�ȣ�';

-- ----------------------------
-- Records of gateway_component_config_detail
-- ----------------------------

-- ----------------------------
-- Table structure for gateway_component_instance
-- ----------------------------
DROP TABLE IF EXISTS "public"."gateway_component_instance";
CREATE TABLE "public"."gateway_component_instance" (
  "id" int8 NOT NULL,
  "cmpt_id" int8,
  "cmpt_type" varchar(255) COLLATE "pg_catalog"."default",
  "cmpt_cfg_id" int8,
  "instance_ip" varchar(50) COLLATE "pg_catalog"."default",
  "instance_name" varchar(100) COLLATE "pg_catalog"."default",
  "instance_status" varchar(100) COLLATE "pg_catalog"."default",
  "start_time" int8,
  "dead_dur" int8
)
;
COMMENT ON COLUMN "public"."gateway_component_instance"."id" IS '����';
COMMENT ON COLUMN "public"."gateway_component_instance"."cmpt_id" IS '���id';
COMMENT ON COLUMN "public"."gateway_component_instance"."cmpt_type" IS '�������';
COMMENT ON COLUMN "public"."gateway_component_instance"."cmpt_cfg_id" IS '�������id';
COMMENT ON COLUMN "public"."gateway_component_instance"."instance_ip" IS 'ʵ��ip';
COMMENT ON COLUMN "public"."gateway_component_instance"."instance_name" IS 'ʵ������';
COMMENT ON COLUMN "public"."gateway_component_instance"."instance_status" IS 'ʵ��״̬��STARTING, WAITING, RUNNING, RESTARTING, STOP';
COMMENT ON COLUMN "public"."gateway_component_instance"."start_time" IS 'ʵ������ʱ��';
COMMENT ON COLUMN "public"."gateway_component_instance"."dead_dur" IS 'ʵ��崻�ʱ��';
COMMENT ON TABLE "public"."gateway_component_instance" IS '�������ʵ��';

-- ----------------------------
-- Records of gateway_component_instance
-- ----------------------------

-- ----------------------------
-- Table structure for gateway_component_log
-- ----------------------------
DROP TABLE IF EXISTS "public"."gateway_component_log";
CREATE TABLE "public"."gateway_component_log" (
  "id" int8 NOT NULL,
  "cmpt_cfg_id" int8,
  "cmpt_cfg_detail_id" int8,
  "addr" varchar(255) COLLATE "pg_catalog"."default",
  "input_msg" varchar COLLATE "pg_catalog"."default",
  "output_msg" varchar COLLATE "pg_catalog"."default",
  "error_msg" varchar COLLATE "pg_catalog"."default",
  "origin" varchar(50) COLLATE "pg_catalog"."default",
  "debug" bool,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."gateway_component_log"."id" IS '����';
COMMENT ON COLUMN "public"."gateway_component_log"."cmpt_cfg_id" IS '�������id';
COMMENT ON COLUMN "public"."gateway_component_log"."cmpt_cfg_detail_id" IS '�����������id';
COMMENT ON COLUMN "public"."gateway_component_log"."addr" IS 'ͨ��';
COMMENT ON COLUMN "public"."gateway_component_log"."input_msg" IS 'ԭʼ����';
COMMENT ON COLUMN "public"."gateway_component_log"."output_msg" IS 'ת��������';
COMMENT ON COLUMN "public"."gateway_component_log"."error_msg" IS '������Ϣ';
COMMENT ON COLUMN "public"."gateway_component_log"."origin" IS '������Դ';
COMMENT ON COLUMN "public"."gateway_component_log"."debug" IS '�Ƿ����ģʽ��־';
COMMENT ON COLUMN "public"."gateway_component_log"."creator" IS '������';
COMMENT ON COLUMN "public"."gateway_component_log"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."gateway_component_log"."updater" IS '������';
COMMENT ON COLUMN "public"."gateway_component_log"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."gateway_component_log" IS '����������ݽ�����־';

-- ----------------------------
-- Records of gateway_component_log
-- ----------------------------

-- ----------------------------
-- Table structure for gateway_device_control
-- ----------------------------
DROP TABLE IF EXISTS "public"."gateway_device_control";
CREATE TABLE "public"."gateway_device_control" (
  "id" int8 NOT NULL,
  "name" varchar(255) COLLATE "pg_catalog"."default",
  "thing_name" varchar(50) COLLATE "pg_catalog"."default",
  "thing_code" varchar(50) COLLATE "pg_catalog"."default",
  "attr_name" varchar(50) COLLATE "pg_catalog"."default",
  "attr_code" varchar(50) COLLATE "pg_catalog"."default",
  "cmpt_type" varchar(50) COLLATE "pg_catalog"."default",
  "cmpt_cfg_id" int8,
  "cmpt_cfg_detail_id" int8,
  "query_msg" varchar(5000) COLLATE "pg_catalog"."default",
  "ctl_body" varchar COLLATE "pg_catalog"."default",
  "ctl_type" varchar(5) COLLATE "pg_catalog"."default",
  "ctl_json" varchar(10240) COLLATE "pg_catalog"."default",
  "user_list" varchar(2550) COLLATE "pg_catalog"."default",
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."gateway_device_control"."id" IS '����';
COMMENT ON COLUMN "public"."gateway_device_control"."name" IS '��������';
COMMENT ON COLUMN "public"."gateway_device_control"."thing_name" IS '������';
COMMENT ON COLUMN "public"."gateway_device_control"."thing_code" IS '�����';
COMMENT ON COLUMN "public"."gateway_device_control"."attr_name" IS '��������';
COMMENT ON COLUMN "public"."gateway_device_control"."attr_code" IS '���Ա���';
COMMENT ON COLUMN "public"."gateway_device_control"."cmpt_cfg_id" IS '�������id';
COMMENT ON COLUMN "public"."gateway_device_control"."cmpt_cfg_detail_id" IS '�����������id';
COMMENT ON COLUMN "public"."gateway_device_control"."query_msg" IS '��ѯ����';
COMMENT ON COLUMN "public"."gateway_device_control"."ctl_body" IS '�����߼�';
COMMENT ON COLUMN "public"."gateway_device_control"."ctl_type" IS '�������ͣ�1ͼ��2�л���3��ֵ';
COMMENT ON COLUMN "public"."gateway_device_control"."ctl_json" IS ' ������ʽjson';
COMMENT ON COLUMN "public"."gateway_device_control"."user_list" IS '�û��б�����û���Ӣ�Ķ��ŷָ�';
COMMENT ON COLUMN "public"."gateway_device_control"."tenant_code" IS '������ҵ(�⻧code)';
COMMENT ON COLUMN "public"."gateway_device_control"."company_id" IS '��ҵ����id';
COMMENT ON COLUMN "public"."gateway_device_control"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."gateway_device_control"."creator" IS '������';
COMMENT ON COLUMN "public"."gateway_device_control"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."gateway_device_control"."updater" IS '������';
COMMENT ON COLUMN "public"."gateway_device_control"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."gateway_device_control" IS '�豸����';

-- ----------------------------
-- Records of gateway_device_control
-- ----------------------------

-- ----------------------------
-- Table structure for gen_base_class
-- ----------------------------
DROP TABLE IF EXISTS "public"."gen_base_class";
CREATE TABLE "public"."gen_base_class" (
  "id" int8 NOT NULL,
  "package_name" varchar(200) COLLATE "pg_catalog"."default",
  "code" varchar(200) COLLATE "pg_catalog"."default",
  "fields" varchar(200) COLLATE "pg_catalog"."default",
  "remark" varchar(200) COLLATE "pg_catalog"."default",
  "create_date" int8
)
;
COMMENT ON COLUMN "public"."gen_base_class"."id" IS 'id';
COMMENT ON COLUMN "public"."gen_base_class"."package_name" IS '�������';
COMMENT ON COLUMN "public"."gen_base_class"."code" IS '�������';
COMMENT ON COLUMN "public"."gen_base_class"."fields" IS '�����ֶΣ������Ӣ�Ķ��ŷָ�';
COMMENT ON COLUMN "public"."gen_base_class"."remark" IS '��ע';
COMMENT ON COLUMN "public"."gen_base_class"."create_date" IS '����ʱ��';
COMMENT ON TABLE "public"."gen_base_class" IS '�������';

-- ----------------------------
-- Records of gen_base_class
-- ----------------------------

-- ----------------------------
-- Table structure for gen_datasource
-- ----------------------------
DROP TABLE IF EXISTS "public"."gen_datasource";
CREATE TABLE "public"."gen_datasource" (
  "id" int8 NOT NULL,
  "db_type" varchar(200) COLLATE "pg_catalog"."default",
  "conn_name" varchar(200) COLLATE "pg_catalog"."default",
  "conn_url" varchar(500) COLLATE "pg_catalog"."default",
  "username" varchar(200) COLLATE "pg_catalog"."default",
  "password" varchar(200) COLLATE "pg_catalog"."default",
  "status" int4,
  "create_date" int8
)
;
COMMENT ON COLUMN "public"."gen_datasource"."id" IS 'id';
COMMENT ON COLUMN "public"."gen_datasource"."db_type" IS '���ݿ����� MySQL��Oracle��SQLServer��PostgreSQL';
COMMENT ON COLUMN "public"."gen_datasource"."conn_name" IS '������';
COMMENT ON COLUMN "public"."gen_datasource"."conn_url" IS 'URL';
COMMENT ON COLUMN "public"."gen_datasource"."username" IS '�û���';
COMMENT ON COLUMN "public"."gen_datasource"."password" IS '����';
COMMENT ON COLUMN "public"."gen_datasource"."status" IS '״̬  0������   1������';
COMMENT ON COLUMN "public"."gen_datasource"."create_date" IS '����ʱ��';
COMMENT ON TABLE "public"."gen_datasource" IS '����Դ����';

-- ----------------------------
-- Records of gen_datasource
-- ----------------------------

-- ----------------------------
-- Table structure for gen_field_type
-- ----------------------------
DROP TABLE IF EXISTS "public"."gen_field_type";
CREATE TABLE "public"."gen_field_type" (
  "id" int8 NOT NULL,
  "column_type" varchar(200) COLLATE "pg_catalog"."default",
  "attr_type" varchar(200) COLLATE "pg_catalog"."default",
  "package_name" varchar(200) COLLATE "pg_catalog"."default",
  "create_date" int8
)
;
COMMENT ON COLUMN "public"."gen_field_type"."id" IS 'id';
COMMENT ON COLUMN "public"."gen_field_type"."column_type" IS '�ֶ�����';
COMMENT ON COLUMN "public"."gen_field_type"."attr_type" IS '��������';
COMMENT ON COLUMN "public"."gen_field_type"."package_name" IS '���԰���';
COMMENT ON COLUMN "public"."gen_field_type"."create_date" IS '����ʱ��';
COMMENT ON TABLE "public"."gen_field_type" IS '�ֶ����͹���';

-- ----------------------------
-- Records of gen_field_type
-- ----------------------------

-- ----------------------------
-- Table structure for gen_table_field
-- ----------------------------
DROP TABLE IF EXISTS "public"."gen_table_field";
CREATE TABLE "public"."gen_table_field" (
  "id" int8 NOT NULL,
  "table_id" int8,
  "table_name" varchar(200) COLLATE "pg_catalog"."default",
  "column_name" varchar(200) COLLATE "pg_catalog"."default",
  "column_type" varchar(200) COLLATE "pg_catalog"."default",
  "column_comment" varchar(200) COLLATE "pg_catalog"."default",
  "attr_name" varchar(200) COLLATE "pg_catalog"."default",
  "attr_type" varchar(200) COLLATE "pg_catalog"."default",
  "package_name" varchar(200) COLLATE "pg_catalog"."default",
  "is_pk" bool,
  "is_required" bool,
  "is_form" bool,
  "is_list" bool,
  "is_query" bool,
  "query_type" varchar(200) COLLATE "pg_catalog"."default",
  "form_type" varchar(200) COLLATE "pg_catalog"."default",
  "dict_name" varchar(200) COLLATE "pg_catalog"."default",
  "validator_type" varchar(200) COLLATE "pg_catalog"."default",
  "sort" int4
)
;
COMMENT ON COLUMN "public"."gen_table_field"."id" IS 'id';
COMMENT ON COLUMN "public"."gen_table_field"."table_id" IS '��ID';
COMMENT ON COLUMN "public"."gen_table_field"."table_name" IS '����';
COMMENT ON COLUMN "public"."gen_table_field"."column_name" IS '����';
COMMENT ON COLUMN "public"."gen_table_field"."column_type" IS '����';
COMMENT ON COLUMN "public"."gen_table_field"."column_comment" IS '��˵��';
COMMENT ON COLUMN "public"."gen_table_field"."attr_name" IS '������';
COMMENT ON COLUMN "public"."gen_table_field"."attr_type" IS '��������';
COMMENT ON COLUMN "public"."gen_table_field"."package_name" IS '���԰���';
COMMENT ON COLUMN "public"."gen_table_field"."is_pk" IS '�Ƿ����� 0����  1����';
COMMENT ON COLUMN "public"."gen_table_field"."is_required" IS '�Ƿ���� 0����  1����';
COMMENT ON COLUMN "public"."gen_table_field"."is_form" IS '�Ƿ���ֶ� 0����  1����';
COMMENT ON COLUMN "public"."gen_table_field"."is_list" IS '�Ƿ��б��ֶ� 0����  1����';
COMMENT ON COLUMN "public"."gen_table_field"."is_query" IS '�Ƿ��ѯ�ֶ� 0����  1����';
COMMENT ON COLUMN "public"."gen_table_field"."query_type" IS '��ѯ��ʽ';
COMMENT ON COLUMN "public"."gen_table_field"."form_type" IS '������';
COMMENT ON COLUMN "public"."gen_table_field"."dict_name" IS '�ֵ�����';
COMMENT ON COLUMN "public"."gen_table_field"."validator_type" IS 'Ч�鷽ʽ';
COMMENT ON COLUMN "public"."gen_table_field"."sort" IS '����';
COMMENT ON TABLE "public"."gen_table_field" IS '�������ɱ���';

-- ----------------------------
-- Records of gen_table_field
-- ----------------------------

-- ----------------------------
-- Table structure for gen_table_info
-- ----------------------------
DROP TABLE IF EXISTS "public"."gen_table_info";
CREATE TABLE "public"."gen_table_info" (
  "id" int8 NOT NULL,
  "table_name" varchar(200) COLLATE "pg_catalog"."default",
  "class_name" varchar(200) COLLATE "pg_catalog"."default",
  "table_comment" varchar(200) COLLATE "pg_catalog"."default",
  "author" varchar(200) COLLATE "pg_catalog"."default",
  "email" varchar(200) COLLATE "pg_catalog"."default",
  "package_name" varchar(200) COLLATE "pg_catalog"."default",
  "version" varchar(200) COLLATE "pg_catalog"."default",
  "backend_path" varchar(500) COLLATE "pg_catalog"."default",
  "frontend_path" varchar(500) COLLATE "pg_catalog"."default",
  "module_name" varchar(200) COLLATE "pg_catalog"."default",
  "sub_module_name" varchar(200) COLLATE "pg_catalog"."default",
  "datasource_id" int8,
  "baseclass_id" int8,
  "create_date" int8
)
;
COMMENT ON COLUMN "public"."gen_table_info"."id" IS 'id';
COMMENT ON COLUMN "public"."gen_table_info"."table_name" IS '����';
COMMENT ON COLUMN "public"."gen_table_info"."class_name" IS '����';
COMMENT ON COLUMN "public"."gen_table_info"."table_comment" IS '������';
COMMENT ON COLUMN "public"."gen_table_info"."author" IS '����';
COMMENT ON COLUMN "public"."gen_table_info"."email" IS '����';
COMMENT ON COLUMN "public"."gen_table_info"."package_name" IS '��Ŀ����';
COMMENT ON COLUMN "public"."gen_table_info"."version" IS '��Ŀ�汾��';
COMMENT ON COLUMN "public"."gen_table_info"."backend_path" IS '�������·��';
COMMENT ON COLUMN "public"."gen_table_info"."frontend_path" IS 'ǰ������·��';
COMMENT ON COLUMN "public"."gen_table_info"."module_name" IS 'ģ����';
COMMENT ON COLUMN "public"."gen_table_info"."sub_module_name" IS '��ģ����';
COMMENT ON COLUMN "public"."gen_table_info"."datasource_id" IS '����ԴID';
COMMENT ON COLUMN "public"."gen_table_info"."baseclass_id" IS '����ID';
COMMENT ON COLUMN "public"."gen_table_info"."create_date" IS '����ʱ��';
COMMENT ON TABLE "public"."gen_table_info" IS '�������ɱ�';

-- ----------------------------
-- Records of gen_table_info
-- ----------------------------

-- ----------------------------
-- Table structure for gen_template
-- ----------------------------
DROP TABLE IF EXISTS "public"."gen_template";
CREATE TABLE "public"."gen_template" (
  "id" int8 NOT NULL,
  "name" varchar(200) COLLATE "pg_catalog"."default",
  "file_name" varchar(200) COLLATE "pg_catalog"."default",
  "content" text COLLATE "pg_catalog"."default",
  "path" varchar(500) COLLATE "pg_catalog"."default",
  "status" int4,
  "create_date" int8
)
;
COMMENT ON COLUMN "public"."gen_template"."id" IS 'id';
COMMENT ON COLUMN "public"."gen_template"."name" IS '����';
COMMENT ON COLUMN "public"."gen_template"."file_name" IS '�ļ���';
COMMENT ON COLUMN "public"."gen_template"."content" IS '����';
COMMENT ON COLUMN "public"."gen_template"."path" IS '����·��';
COMMENT ON COLUMN "public"."gen_template"."status" IS '״̬  0������   1������';
COMMENT ON COLUMN "public"."gen_template"."create_date" IS '����ʱ��';
COMMENT ON TABLE "public"."gen_template" IS 'ģ�����';

-- ----------------------------
-- Records of gen_template
-- ----------------------------

-- ----------------------------
-- Table structure for iot_board_manage
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_board_manage";
CREATE TABLE "public"."iot_board_manage" (
  "id" int8 NOT NULL,
  "name" varchar(255) COLLATE "pg_catalog"."default",
  "type" varchar(255) COLLATE "pg_catalog"."default",
  "thumbnail_url" text COLLATE "pg_catalog"."default",
  "is_template" bool,
  "remarks" varchar(10240) COLLATE "pg_catalog"."default",
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "background_image" text COLLATE "pg_catalog"."default",
  "preview_url" varchar(2550) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."iot_board_manage"."id" IS '����id����';
COMMENT ON COLUMN "public"."iot_board_manage"."name" IS '��������';
COMMENT ON COLUMN "public"."iot_board_manage"."type" IS '��������';
COMMENT ON COLUMN "public"."iot_board_manage"."thumbnail_url" IS '����ͼurl';
COMMENT ON COLUMN "public"."iot_board_manage"."is_template" IS '�Ƿ�Ϊģ��';
COMMENT ON COLUMN "public"."iot_board_manage"."remarks" IS '��ע';
COMMENT ON COLUMN "public"."iot_board_manage"."tenant_code" IS '������ҵ(�⻧code)';
COMMENT ON COLUMN "public"."iot_board_manage"."company_id" IS '��ҵ����id';
COMMENT ON COLUMN "public"."iot_board_manage"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."iot_board_manage"."creator" IS '������';
COMMENT ON COLUMN "public"."iot_board_manage"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_board_manage"."updater" IS '������';
COMMENT ON COLUMN "public"."iot_board_manage"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_board_manage"."background_image" IS '��������ı���ͼƬ';
COMMENT ON COLUMN "public"."iot_board_manage"."preview_url" IS 'Ԥ��url';
COMMENT ON TABLE "public"."iot_board_manage" IS '��̬�������';

-- ----------------------------
-- Records of iot_board_manage
-- ----------------------------

-- ----------------------------
-- Table structure for iot_configuration_design
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_configuration_design";
CREATE TABLE "public"."iot_configuration_design" (
  "id" int8 NOT NULL,
  "board_manage_id" int8,
  "width" int4,
  "height" int4,
  "background_image" text COLLATE "pg_catalog"."default",
  "background_color" varchar(64) COLLATE "pg_catalog"."default",
  "background_repeat" text COLLATE "pg_catalog"."default",
  "page_name" varchar(255) COLLATE "pg_catalog"."default",
  "device_ratio" varchar(255) COLLATE "pg_catalog"."default",
  "background_size" varchar(32) COLLATE "pg_catalog"."default",
  "picture_data" text COLLATE "pg_catalog"."default",
  "api_set_ids" varchar(255) COLLATE "pg_catalog"."default",
  "is_default_back_img" bool,
  "board_type" varchar COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."iot_configuration_design"."id" IS '����id';
COMMENT ON COLUMN "public"."iot_configuration_design"."board_manage_id" IS '��̬����id';
COMMENT ON COLUMN "public"."iot_configuration_design"."width" IS '������';
COMMENT ON COLUMN "public"."iot_configuration_design"."height" IS '����߶�';
COMMENT ON COLUMN "public"."iot_configuration_design"."background_image" IS '����ͼƬ';
COMMENT ON COLUMN "public"."iot_configuration_design"."background_color" IS '������ɫ';
COMMENT ON COLUMN "public"."iot_configuration_design"."background_repeat" IS 'backgroundRepeat';
COMMENT ON COLUMN "public"."iot_configuration_design"."page_name" IS 'ҳ������';
COMMENT ON COLUMN "public"."iot_configuration_design"."device_ratio" IS 'device_ratio';
COMMENT ON COLUMN "public"."iot_configuration_design"."background_size" IS 'background_size';
COMMENT ON COLUMN "public"."iot_configuration_design"."picture_data" IS 'ͼ����';
COMMENT ON COLUMN "public"."iot_configuration_design"."api_set_ids" IS '����apiid�����id��Ӣ�Ķ���,�ָ�';
COMMENT ON COLUMN "public"."iot_configuration_design"."is_default_back_img" IS '��̬����url';
COMMENT ON COLUMN "public"."iot_configuration_design"."board_type" IS 'board_type';
COMMENT ON TABLE "public"."iot_configuration_design" IS '��̬��ƹ���';

-- ----------------------------
-- Records of iot_configuration_design
-- ----------------------------

-- ----------------------------
-- Table structure for iot_dashboard
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_dashboard";
CREATE TABLE "public"."iot_dashboard" (
  "id" int8 NOT NULL,
  "dashboard_group_id" int8,
  "svg_url" varchar(500) COLLATE "pg_catalog"."default",
  "img_url" varchar(500) COLLATE "pg_catalog"."default",
  "title" varchar(64) COLLATE "pg_catalog"."default",
  "height" varchar(32) COLLATE "pg_catalog"."default",
  "width" varchar(32) COLLATE "pg_catalog"."default",
  "background_color" varchar(64) COLLATE "pg_catalog"."default",
  "background_picture" varchar COLLATE "pg_catalog"."default",
  "remark" varchar(255) COLLATE "pg_catalog"."default",
  "sort" int4,
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "type" varchar(5) COLLATE "pg_catalog"."default",
  "scada_url" varchar(25500) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."iot_dashboard"."id" IS 'id';
COMMENT ON COLUMN "public"."iot_dashboard"."dashboard_group_id" IS '�������id';
COMMENT ON COLUMN "public"."iot_dashboard"."svg_url" IS 'svgͼƬ��ַ';
COMMENT ON COLUMN "public"."iot_dashboard"."img_url" IS 'ͼƬ��ַ';
COMMENT ON COLUMN "public"."iot_dashboard"."title" IS '����';
COMMENT ON COLUMN "public"."iot_dashboard"."height" IS '�߶�';
COMMENT ON COLUMN "public"."iot_dashboard"."width" IS '���';
COMMENT ON COLUMN "public"."iot_dashboard"."background_color" IS '������ɫ';
COMMENT ON COLUMN "public"."iot_dashboard"."background_picture" IS '����ͼƬ';
COMMENT ON COLUMN "public"."iot_dashboard"."remark" IS '����';
COMMENT ON COLUMN "public"."iot_dashboard"."sort" IS '���';
COMMENT ON COLUMN "public"."iot_dashboard"."tenant_code" IS '������ҵ(�⻧code)';
COMMENT ON COLUMN "public"."iot_dashboard"."company_id" IS '��ҵ����id';
COMMENT ON COLUMN "public"."iot_dashboard"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."iot_dashboard"."creator" IS '������';
COMMENT ON COLUMN "public"."iot_dashboard"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_dashboard"."updater" IS '������';
COMMENT ON COLUMN "public"."iot_dashboard"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_dashboard"."type" IS '��������';
COMMENT ON COLUMN "public"."iot_dashboard"."scada_url" IS '��̬����url';
COMMENT ON TABLE "public"."iot_dashboard" IS '�����';

-- ----------------------------
-- Records of iot_dashboard
-- ----------------------------

-- ----------------------------
-- Table structure for iot_dashboard_element
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_dashboard_element";
CREATE TABLE "public"."iot_dashboard_element" (
  "id" int8 NOT NULL,
  "dashboard_id" int8,
  "element_id" varchar(255) COLLATE "pg_catalog"."default",
  "element_name" varchar(255) COLLATE "pg_catalog"."default",
  "thing_code" varchar(64) COLLATE "pg_catalog"."default",
  "attr_code" varchar(64) COLLATE "pg_catalog"."default",
  "configuration_data" varchar COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "unit" varchar(10) COLLATE "pg_catalog"."default",
  "calculate_body" varchar COLLATE "pg_catalog"."default",
  "control_config" varchar(10) COLLATE "pg_catalog"."default",
  "control_style" varchar(255) COLLATE "pg_catalog"."default",
  "control_device" varchar(255) COLLATE "pg_catalog"."default",
  "control_device_attr" varchar(50) COLLATE "pg_catalog"."default",
  "control_cmd_id" int8,
  "control_permissions" varchar(5000) COLLATE "pg_catalog"."default",
  "control_relation" varchar(500) COLLATE "pg_catalog"."default",
  "thing_id" int8
)
;
COMMENT ON COLUMN "public"."iot_dashboard_element"."id" IS 'id';
COMMENT ON COLUMN "public"."iot_dashboard_element"."dashboard_id" IS '����id';
COMMENT ON COLUMN "public"."iot_dashboard_element"."element_id" IS 'Ԫ��id';
COMMENT ON COLUMN "public"."iot_dashboard_element"."element_name" IS 'Ԫ������';
COMMENT ON COLUMN "public"."iot_dashboard_element"."thing_code" IS 'ӳ����';
COMMENT ON COLUMN "public"."iot_dashboard_element"."attr_code" IS 'ӳ������';
COMMENT ON COLUMN "public"."iot_dashboard_element"."configuration_data" IS '����';
COMMENT ON COLUMN "public"."iot_dashboard_element"."creator" IS '������';
COMMENT ON COLUMN "public"."iot_dashboard_element"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_dashboard_element"."updater" IS '������';
COMMENT ON COLUMN "public"."iot_dashboard_element"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_dashboard_element"."unit" IS '��λ';
COMMENT ON COLUMN "public"."iot_dashboard_element"."calculate_body" IS '������';
COMMENT ON COLUMN "public"."iot_dashboard_element"."control_config" IS '�������ã�0-������1-�ر�';
COMMENT ON COLUMN "public"."iot_dashboard_element"."control_style" IS '������ʽ';
COMMENT ON COLUMN "public"."iot_dashboard_element"."control_device" IS '�����豸';
COMMENT ON COLUMN "public"."iot_dashboard_element"."control_device_attr" IS '�����豸����';
COMMENT ON COLUMN "public"."iot_dashboard_element"."control_cmd_id" IS '����ָ��';
COMMENT ON COLUMN "public"."iot_dashboard_element"."control_permissions" IS '����Ȩ��';
COMMENT ON COLUMN "public"."iot_dashboard_element"."control_relation" IS '��Ӧ��ϵ';
COMMENT ON COLUMN "public"."iot_dashboard_element"."thing_id" IS '��ʵ��id';
COMMENT ON TABLE "public"."iot_dashboard_element" IS '����Ԫ�ر�';

-- ----------------------------
-- Records of iot_dashboard_element
-- ----------------------------

-- ----------------------------
-- Table structure for iot_dashboard_group
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_dashboard_group";
CREATE TABLE "public"."iot_dashboard_group" (
  "id" int8 NOT NULL,
  "name" varchar(64) COLLATE "pg_catalog"."default",
  "preview_picture" varchar COLLATE "pg_catalog"."default",
  "exist_menu" varchar(10) COLLATE "pg_catalog"."default",
  "exist_url" varchar(10) COLLATE "pg_catalog"."default",
  "multiple" varchar(10) COLLATE "pg_catalog"."default",
  "slideshow" varchar(10) COLLATE "pg_catalog"."default",
  "slideshow_interval" varchar(10) COLLATE "pg_catalog"."default",
  "remark" varchar(255) COLLATE "pg_catalog"."default",
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."iot_dashboard_group"."id" IS 'id';
COMMENT ON COLUMN "public"."iot_dashboard_group"."name" IS '����';
COMMENT ON COLUMN "public"."iot_dashboard_group"."preview_picture" IS 'Ԥ��ͼ';
COMMENT ON COLUMN "public"."iot_dashboard_group"."exist_menu" IS '�Ƿ����ò˵�(0-��,1-��)';
COMMENT ON COLUMN "public"."iot_dashboard_group"."exist_url" IS '�Ƿ����ɷ����ַ(0-��,1-��';
COMMENT ON COLUMN "public"."iot_dashboard_group"."multiple" IS '�Ƿ��Ƕ������(0-��,1-��)';
COMMENT ON COLUMN "public"."iot_dashboard_group"."slideshow" IS '�Ƿ����ֲ�(0-��,1-��)';
COMMENT ON COLUMN "public"."iot_dashboard_group"."slideshow_interval" IS '�ֲ����';
COMMENT ON COLUMN "public"."iot_dashboard_group"."remark" IS '����';
COMMENT ON COLUMN "public"."iot_dashboard_group"."tenant_code" IS '������ҵ(�⻧code)';
COMMENT ON COLUMN "public"."iot_dashboard_group"."company_id" IS '��ҵ����id';
COMMENT ON COLUMN "public"."iot_dashboard_group"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."iot_dashboard_group"."creator" IS '������';
COMMENT ON COLUMN "public"."iot_dashboard_group"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_dashboard_group"."updater" IS '������';
COMMENT ON COLUMN "public"."iot_dashboard_group"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."iot_dashboard_group" IS '��������';

-- ----------------------------
-- Records of iot_dashboard_group
-- ----------------------------

-- ----------------------------
-- Table structure for iot_dashboard_svg
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_dashboard_svg";
CREATE TABLE "public"."iot_dashboard_svg" (
  "id" int8 NOT NULL,
  "dashboard_id" int8,
  "svg_xml" xml,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."iot_dashboard_svg"."id" IS '����';
COMMENT ON COLUMN "public"."iot_dashboard_svg"."dashboard_id" IS '��������';
COMMENT ON COLUMN "public"."iot_dashboard_svg"."svg_xml" IS 'svg';
COMMENT ON COLUMN "public"."iot_dashboard_svg"."creator" IS '������';
COMMENT ON COLUMN "public"."iot_dashboard_svg"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_dashboard_svg"."updater" IS '������';
COMMENT ON COLUMN "public"."iot_dashboard_svg"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."iot_dashboard_svg" IS '����svg';

-- ----------------------------
-- Records of iot_dashboard_svg
-- ----------------------------

-- ----------------------------
-- Table structure for iot_data_entry
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_data_entry";
CREATE TABLE "public"."iot_data_entry" (
  "id" int8 NOT NULL,
  "thing_code" varchar(255) COLLATE "pg_catalog"."default",
  "thing_name" varchar(255) COLLATE "pg_catalog"."default",
  "attr_code" varchar(255) COLLATE "pg_catalog"."default",
  "attr_name" varchar(255) COLLATE "pg_catalog"."default",
  "attr_value" varchar COLLATE "pg_catalog"."default",
  "ts" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8
)
;
COMMENT ON COLUMN "public"."iot_data_entry"."id" IS 'id';
COMMENT ON COLUMN "public"."iot_data_entry"."thing_code" IS '�豸���';
COMMENT ON COLUMN "public"."iot_data_entry"."thing_name" IS '�豸����';
COMMENT ON COLUMN "public"."iot_data_entry"."attr_code" IS '���Ա��';
COMMENT ON COLUMN "public"."iot_data_entry"."attr_name" IS '��������';
COMMENT ON COLUMN "public"."iot_data_entry"."attr_value" IS '����ֵ';
COMMENT ON COLUMN "public"."iot_data_entry"."ts" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_data_entry"."creator" IS '������';
COMMENT ON COLUMN "public"."iot_data_entry"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_data_entry"."updater" IS '������';
COMMENT ON COLUMN "public"."iot_data_entry"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_data_entry"."tenant_code" IS '�⻧����';
COMMENT ON COLUMN "public"."iot_data_entry"."company_id" IS '��ҵ����id';
COMMENT ON COLUMN "public"."iot_data_entry"."dept_id" IS '����id';
COMMENT ON TABLE "public"."iot_data_entry" IS '���ݱ���';

-- ----------------------------
-- Records of iot_data_entry
-- ----------------------------

-- ----------------------------
-- Table structure for iot_device_auto_control_config
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_device_auto_control_config";
CREATE TABLE "public"."iot_device_auto_control_config" (
  "id" int8 NOT NULL,
  "filter_rule_id" int8,
  "control_id" int8,
  "remark" varchar(255) COLLATE "pg_catalog"."default",
  "msg_push_id" int8,
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."iot_device_auto_control_config"."id" IS '����';
COMMENT ON COLUMN "public"."iot_device_auto_control_config"."filter_rule_id" IS '���˹���id';
COMMENT ON COLUMN "public"."iot_device_auto_control_config"."control_id" IS '����ָ��id��gateway_device_control������';
COMMENT ON COLUMN "public"."iot_device_auto_control_config"."remark" IS '��ע';
COMMENT ON COLUMN "public"."iot_device_auto_control_config"."msg_push_id" IS '��Ϣ������������';
COMMENT ON COLUMN "public"."iot_device_auto_control_config"."creator" IS '������';
COMMENT ON COLUMN "public"."iot_device_auto_control_config"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_device_auto_control_config"."updater" IS '������';
COMMENT ON COLUMN "public"."iot_device_auto_control_config"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."iot_device_auto_control_config" IS '�豸�Զ���������';

-- ----------------------------
-- Records of iot_device_auto_control_config
-- ----------------------------

-- ----------------------------
-- Table structure for iot_device_control
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_device_control";
CREATE TABLE "public"."iot_device_control" (
  "id" int8 NOT NULL,
  "name" varchar(255) COLLATE "pg_catalog"."default",
  "thing_id" int8,
  "attr_code" varchar(255) COLLATE "pg_catalog"."default",
  "extend_id" int8,
  "relation_id" int8,
  "sup_msg" varchar(5000) COLLATE "pg_catalog"."default",
  "query_msg" varchar(5000) COLLATE "pg_catalog"."default",
  "ctl_body" varchar COLLATE "pg_catalog"."default",
  "remark" varchar(255) COLLATE "pg_catalog"."default",
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "attr_id" int8,
  "ctl_type" varchar(5) COLLATE "pg_catalog"."default",
  "ctl_json" varchar(10240) COLLATE "pg_catalog"."default",
  "user_list" varchar(2550) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."iot_device_control"."id" IS '����';
COMMENT ON COLUMN "public"."iot_device_control"."name" IS '��������';
COMMENT ON COLUMN "public"."iot_device_control"."thing_id" IS '�豸����';
COMMENT ON COLUMN "public"."iot_device_control"."attr_code" IS '���Ա���';
COMMENT ON COLUMN "public"."iot_device_control"."extend_id" IS 'ͨѶ����';
COMMENT ON COLUMN "public"."iot_device_control"."relation_id" IS 'ͨѶ��ϵ����';
COMMENT ON COLUMN "public"."iot_device_control"."sup_msg" IS '��������';
COMMENT ON COLUMN "public"."iot_device_control"."query_msg" IS '��ѯ����';
COMMENT ON COLUMN "public"."iot_device_control"."ctl_body" IS '�����߼�';
COMMENT ON COLUMN "public"."iot_device_control"."remark" IS '��ע';
COMMENT ON COLUMN "public"."iot_device_control"."tenant_code" IS '������ҵ(�⻧code)';
COMMENT ON COLUMN "public"."iot_device_control"."company_id" IS '��ҵ����id';
COMMENT ON COLUMN "public"."iot_device_control"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."iot_device_control"."creator" IS '������';
COMMENT ON COLUMN "public"."iot_device_control"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_device_control"."updater" IS '������';
COMMENT ON COLUMN "public"."iot_device_control"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_device_control"."attr_id" IS '����id';
COMMENT ON COLUMN "public"."iot_device_control"."ctl_type" IS '�������ͣ�1ͼ��2�л���3��ֵ';
COMMENT ON COLUMN "public"."iot_device_control"."ctl_json" IS ' ������ʽjson ����json  [
	 *     {
	 *     "no":"123",
	 *     "code":"a001",
	 *     "name":"�յ���",
	 *     "url":"/dddd/eee.png"
	 *     },{
	 *     "no":"124",
	 *     "code":"a002",
	 *     "name":"�յ���",
	 *     "url":"/dddd/ccc.png"
	 *     }
	 * ]';
COMMENT ON COLUMN "public"."iot_device_control"."user_list" IS '�û��б�����û���Ӣ�Ķ��ŷָ�';
COMMENT ON TABLE "public"."iot_device_control" IS '�豸����';

-- ----------------------------
-- Records of iot_device_control
-- ----------------------------

-- ----------------------------
-- Table structure for iot_device_control_log
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_device_control_log";
CREATE TABLE "public"."iot_device_control_log" (
  "id" int8 NOT NULL,
  "control_id" int8,
  "in_msg" varchar COLLATE "pg_catalog"."default",
  "out_msg" varchar COLLATE "pg_catalog"."default",
  "error_msg" varchar COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."iot_device_control_log"."id" IS '����';
COMMENT ON COLUMN "public"."iot_device_control_log"."control_id" IS '��������';
COMMENT ON COLUMN "public"."iot_device_control_log"."in_msg" IS '�������';
COMMENT ON COLUMN "public"."iot_device_control_log"."out_msg" IS '������';
COMMENT ON COLUMN "public"."iot_device_control_log"."error_msg" IS '�쳣��Ϣ';
COMMENT ON COLUMN "public"."iot_device_control_log"."creator" IS '������';
COMMENT ON COLUMN "public"."iot_device_control_log"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_device_control_log"."updater" IS '������';
COMMENT ON COLUMN "public"."iot_device_control_log"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."iot_device_control_log" IS '�豸������־';

-- ----------------------------
-- Records of iot_device_control_log
-- ----------------------------

-- ----------------------------
-- Table structure for iot_device_management
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_device_management";
CREATE TABLE "public"."iot_device_management" (
  "id" int8 NOT NULL,
  "thing_relation_id" int8,
  "thing_id" int8,
  "thing_code" varchar(255) COLLATE "pg_catalog"."default",
  "thing_name" varchar(255) COLLATE "pg_catalog"."default",
  "thing_attr_code" varchar(255) COLLATE "pg_catalog"."default",
  "thing_attr_name" varchar(255) COLLATE "pg_catalog"."default",
  "thing_attr_unit" varchar(255) COLLATE "pg_catalog"."default",
  "sort" varchar(255) COLLATE "pg_catalog"."default",
  "ctl_id" int8,
  "title" varchar(255) COLLATE "pg_catalog"."default",
  "img" varchar(255) COLLATE "pg_catalog"."default",
  "view_type" varchar(255) COLLATE "pg_catalog"."default",
  "config_type" varchar(255) COLLATE "pg_catalog"."default",
  "thing_attr_boundary" varchar(255) COLLATE "pg_catalog"."default",
  "time_info" varchar(255) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."iot_device_management"."id" IS 'id';
COMMENT ON COLUMN "public"."iot_device_management"."thing_relation_id" IS '���ϵid';
COMMENT ON COLUMN "public"."iot_device_management"."thing_id" IS '��ʵ��id';
COMMENT ON COLUMN "public"."iot_device_management"."thing_code" IS '�����';
COMMENT ON COLUMN "public"."iot_device_management"."thing_name" IS '������';
COMMENT ON COLUMN "public"."iot_device_management"."thing_attr_code" IS '�����Ա���';
COMMENT ON COLUMN "public"."iot_device_management"."thing_attr_name" IS '����������';
COMMENT ON COLUMN "public"."iot_device_management"."thing_attr_unit" IS '�����Ե�λ';
COMMENT ON COLUMN "public"."iot_device_management"."sort" IS '���';
COMMENT ON COLUMN "public"."iot_device_management"."ctl_id" IS '��������id';
COMMENT ON COLUMN "public"."iot_device_management"."title" IS '���Ա���/�����������';
COMMENT ON COLUMN "public"."iot_device_management"."img" IS 'ͼ��ͼƬ';
COMMENT ON COLUMN "public"."iot_device_management"."view_type" IS 'ͼ������/�Զ��巽������';
COMMENT ON COLUMN "public"."iot_device_management"."config_type" IS '�������� 1��ʷ����ͼ����2����ֵͼ�꣬3����';
COMMENT ON COLUMN "public"."iot_device_management"."thing_attr_boundary" IS '������JSON{"up":"","down":""}';
COMMENT ON COLUMN "public"."iot_device_management"."time_info" IS 'Ӣ�Ķ��ŷָ��2,3,4 ��ʾ2��3Сʱ4����';
COMMENT ON TABLE "public"."iot_device_management" IS '�豸�����������';

-- ----------------------------
-- Records of iot_device_management
-- ----------------------------

-- ----------------------------
-- Table structure for iot_enterprise_dashboard
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_enterprise_dashboard";
CREATE TABLE "public"."iot_enterprise_dashboard" (
  "id" int8 NOT NULL,
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "large_screen_name" varchar(255) COLLATE "pg_catalog"."default",
  "large_screen_url" varchar(255) COLLATE "pg_catalog"."default",
  "large_screen_type" varchar(255) COLLATE "pg_catalog"."default",
  "detail_json" varchar(1024) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."iot_enterprise_dashboard"."id" IS 'id';
COMMENT ON COLUMN "public"."iot_enterprise_dashboard"."tenant_code" IS '������ҵ(�⻧code)';
COMMENT ON COLUMN "public"."iot_enterprise_dashboard"."company_id" IS '��ҵ����id';
COMMENT ON COLUMN "public"."iot_enterprise_dashboard"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."iot_enterprise_dashboard"."creator" IS '������';
COMMENT ON COLUMN "public"."iot_enterprise_dashboard"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_enterprise_dashboard"."updater" IS '������';
COMMENT ON COLUMN "public"."iot_enterprise_dashboard"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_enterprise_dashboard"."large_screen_name" IS '��������';
COMMENT ON COLUMN "public"."iot_enterprise_dashboard"."large_screen_url" IS '����ͼƬ��ַ';
COMMENT ON COLUMN "public"."iot_enterprise_dashboard"."large_screen_type" IS '�������ͣ�
1.ֻ�����ͼ
2.���ͼ-�����ſ���
3.���ͼ-�ҡ����ſ���
4.���ͼ��6������';
COMMENT ON COLUMN "public"."iot_enterprise_dashboard"."detail_json" IS '����json';
COMMENT ON TABLE "public"."iot_enterprise_dashboard" IS '��ҵ��ҳ���ù���';

-- ----------------------------
-- Records of iot_enterprise_dashboard
-- ----------------------------

-- ----------------------------
-- Table structure for iot_group_info
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_group_info";
CREATE TABLE "public"."iot_group_info" (
  "id" int8 NOT NULL,
  "name" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "type" varchar(64) COLLATE "pg_catalog"."default" NOT NULL,
  "code" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "business_type" varchar(255) COLLATE "pg_catalog"."default",
  "is_default" int2 NOT NULL DEFAULT 0,
  "thumbnail_url" text COLLATE "pg_catalog"."default",
  "remark" varchar(500) COLLATE "pg_catalog"."default",
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "sort" int8 DEFAULT 0
)
;
COMMENT ON COLUMN "public"."iot_group_info"."id" IS 'id';
COMMENT ON COLUMN "public"."iot_group_info"."name" IS '������';
COMMENT ON COLUMN "public"."iot_group_info"."type" IS '�����ͣ� thing/attr/tag/relation';
COMMENT ON COLUMN "public"."iot_group_info"."code" IS '�����';
COMMENT ON COLUMN "public"."iot_group_info"."business_type" IS '��ҵ������';
COMMENT ON COLUMN "public"."iot_group_info"."is_default" IS '0 Ĭ�� 1.�Զ���';
COMMENT ON COLUMN "public"."iot_group_info"."thumbnail_url" IS '����ͼurl';
COMMENT ON COLUMN "public"."iot_group_info"."remark" IS '��ע˵��';
COMMENT ON COLUMN "public"."iot_group_info"."tenant_code" IS '������ҵ(�⻧code)';
COMMENT ON COLUMN "public"."iot_group_info"."company_id" IS '��ҵ����id';
COMMENT ON COLUMN "public"."iot_group_info"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."iot_group_info"."creator" IS '������';
COMMENT ON COLUMN "public"."iot_group_info"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_group_info"."updater" IS '������';
COMMENT ON COLUMN "public"."iot_group_info"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_group_info"."sort" IS '����';
COMMENT ON TABLE "public"."iot_group_info" IS '�������Ϣ��';

-- ----------------------------
-- Table structure for iot_group_relation
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_group_relation";
CREATE TABLE "public"."iot_group_relation" (
  "id" int8 NOT NULL,
  "group_id" int8 NOT NULL,
  "entity_id" int8 NOT NULL,
  "entity_type" varchar(64) COLLATE "pg_catalog"."default" NOT NULL
)
;
COMMENT ON COLUMN "public"."iot_group_relation"."id" IS 'id';
COMMENT ON COLUMN "public"."iot_group_relation"."group_id" IS '��id';
COMMENT ON COLUMN "public"."iot_group_relation"."entity_id" IS 'ʵ��id ����thing_entity_id';
COMMENT ON COLUMN "public"."iot_group_relation"."entity_type" IS 'ʵ�����ͣ���ʵ��- thing';
COMMENT ON TABLE "public"."iot_group_relation" IS 'ʵ��&�� �Ĺ�ϵ��';

-- ----------------------------
-- Records of iot_group_relation
-- ----------------------------

-- ----------------------------
-- Table structure for iot_section_detail
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_section_detail";
CREATE TABLE "public"."iot_section_detail" (
  "id" int8 NOT NULL,
  "name" varchar(255) COLLATE "pg_catalog"."default",
  "alias_name" varchar(255) COLLATE "pg_catalog"."default",
  "group_id" int8,
  "image" text COLLATE "pg_catalog"."default",
  "image_type" varchar(255) COLLATE "pg_catalog"."default",
  "config" text COLLATE "pg_catalog"."default",
  "js_plugin" text COLLATE "pg_catalog"."default",
  "json" text COLLATE "pg_catalog"."default",
  "css" text COLLATE "pg_catalog"."default",
  "javascript" text COLLATE "pg_catalog"."default",
  "remarks" varchar(1024) COLLATE "pg_catalog"."default",
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "is_default" bool,
  "section_type" varchar(255) COLLATE "pg_catalog"."default",
  "is_local" bool,
  "is_remote" bool,
  "fake_data" text COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."iot_section_detail"."id" IS '����id';
COMMENT ON COLUMN "public"."iot_section_detail"."name" IS '��������';
COMMENT ON COLUMN "public"."iot_section_detail"."alias_name" IS '��������';
COMMENT ON COLUMN "public"."iot_section_detail"."group_id" IS '������id';
COMMENT ON COLUMN "public"."iot_section_detail"."image" IS '�ļ�url';
COMMENT ON COLUMN "public"."iot_section_detail"."image_type" IS '�ļ�����';
COMMENT ON COLUMN "public"."iot_section_detail"."config" IS '����������Ϣ';
COMMENT ON COLUMN "public"."iot_section_detail"."js_plugin" IS '�������:����ṹ';
COMMENT ON COLUMN "public"."iot_section_detail"."json" IS 'json';
COMMENT ON COLUMN "public"."iot_section_detail"."css" IS 'css';
COMMENT ON COLUMN "public"."iot_section_detail"."javascript" IS 'javascript';
COMMENT ON COLUMN "public"."iot_section_detail"."remarks" IS '��ע˵��';
COMMENT ON COLUMN "public"."iot_section_detail"."tenant_code" IS '������ҵ(�⻧code)';
COMMENT ON COLUMN "public"."iot_section_detail"."company_id" IS '��ҵ����id';
COMMENT ON COLUMN "public"."iot_section_detail"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."iot_section_detail"."creator" IS '������';
COMMENT ON COLUMN "public"."iot_section_detail"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_section_detail"."updater" IS '������';
COMMENT ON COLUMN "public"."iot_section_detail"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_section_detail"."is_default" IS '�Ƿ�Ĭ��';
COMMENT ON COLUMN "public"."iot_section_detail"."section_type" IS '��������';
COMMENT ON COLUMN "public"."iot_section_detail"."is_local" IS '�Ƿ񱾵�';
COMMENT ON COLUMN "public"."iot_section_detail"."is_remote" IS '�Ƿ�Զ��';
COMMENT ON COLUMN "public"."iot_section_detail"."fake_data" IS '��̬����';
COMMENT ON TABLE "public"."iot_section_detail" IS '�������������Ϣ';
-- ----------------------------
-- Table structure for iot_source_material
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_source_material";
CREATE TABLE "public"."iot_source_material" (
  "id" int8 NOT NULL,
  "name" varchar(255) COLLATE "pg_catalog"."default",
  "type" varchar(255) COLLATE "pg_catalog"."default",
  "is_default" int4,
  "group_id" int8,
  "image" text COLLATE "pg_catalog"."default",
  "remark" varchar(1024) COLLATE "pg_catalog"."default",
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "material_file" text COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."iot_source_material"."id" IS '�ز�id';
COMMENT ON COLUMN "public"."iot_source_material"."name" IS '�ز�����';
COMMENT ON COLUMN "public"."iot_source_material"."type" IS '�ز��ļ�����';
COMMENT ON COLUMN "public"."iot_source_material"."is_default" IS '�Ƿ�Ĭ��0�ǣ�1��';
COMMENT ON COLUMN "public"."iot_source_material"."group_id" IS '�����ز���id';
COMMENT ON COLUMN "public"."iot_source_material"."image" IS '�ļ�url';
COMMENT ON COLUMN "public"."iot_source_material"."remark" IS '��ע˵��';
COMMENT ON COLUMN "public"."iot_source_material"."tenant_code" IS '������ҵ(�⻧code)';
COMMENT ON COLUMN "public"."iot_source_material"."company_id" IS '��ҵ����id';
COMMENT ON COLUMN "public"."iot_source_material"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."iot_source_material"."creator" IS '������';
COMMENT ON COLUMN "public"."iot_source_material"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_source_material"."updater" IS '������';
COMMENT ON COLUMN "public"."iot_source_material"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_source_material"."material_file" IS '�ز��ļ���svgxml/base64';
COMMENT ON TABLE "public"."iot_source_material" IS '�زĹ���';

-- ----------------------------
-- Table structure for iot_task
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_task";
CREATE TABLE "public"."iot_task" (
  "id" int8 NOT NULL,
  "name" varchar(100) COLLATE "pg_catalog"."default",
  "type" varchar(5) COLLATE "pg_catalog"."default",
  "time_type" varchar(10) COLLATE "pg_catalog"."default",
  "bean_id" varchar(50) COLLATE "pg_catalog"."default",
  "start_date" timestamp(6),
  "end_date" timestamp(6),
  "func" varchar(500) COLLATE "pg_catalog"."default",
  "extend_data" varchar(255) COLLATE "pg_catalog"."default",
  "cron" varchar(50) COLLATE "pg_catalog"."default",
  "remark" varchar(500) COLLATE "pg_catalog"."default",
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" timestamp(6),
  "updater" int8,
  "update_date" timestamp(6)
)
;
COMMENT ON COLUMN "public"."iot_task"."id" IS '����';
COMMENT ON COLUMN "public"."iot_task"."name" IS '��������';
COMMENT ON COLUMN "public"."iot_task"."type" IS '��������';
COMMENT ON COLUMN "public"."iot_task"."time_type" IS '��ʱ����';
COMMENT ON COLUMN "public"."iot_task"."bean_id" IS 'beanName���������';
COMMENT ON COLUMN "public"."iot_task"."start_date" IS '��ʼʱ��';
COMMENT ON COLUMN "public"."iot_task"."end_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_task"."func" IS '��������';
COMMENT ON COLUMN "public"."iot_task"."extend_data" IS '��չ�ֶ�,��ž��嶨ʱ����';
COMMENT ON COLUMN "public"."iot_task"."cron" IS 'cron���ʽ';
COMMENT ON COLUMN "public"."iot_task"."remark" IS '��ע';
COMMENT ON COLUMN "public"."iot_task"."tenant_code" IS '������ҵ(�⻧code)';
COMMENT ON COLUMN "public"."iot_task"."company_id" IS '��ҵ����id';
COMMENT ON COLUMN "public"."iot_task"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."iot_task"."creator" IS '������';
COMMENT ON COLUMN "public"."iot_task"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_task"."updater" IS '������';
COMMENT ON COLUMN "public"."iot_task"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."iot_task" IS '��ʱ����';

-- ----------------------------
-- Records of iot_task
-- ----------------------------

-- ----------------------------
-- Table structure for iot_thing_api
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_thing_api";
CREATE TABLE "public"."iot_thing_api" (
  "id" int8 NOT NULL,
  "name" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "thing_condition" text COLLATE "pg_catalog"."default",
  "attr_condition" text COLLATE "pg_catalog"."default",
  "time_condition" text COLLATE "pg_catalog"."default",
  "token" varchar(255) COLLATE "pg_catalog"."default",
  "expire" int8,
  "calls_num" int8 DEFAULT 0,
  "remark" varchar(255) COLLATE "pg_catalog"."default",
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "enable_status" varchar(2) COLLATE "pg_catalog"."default" NOT NULL DEFAULT 0,
  "route_url" varchar(500) COLLATE "pg_catalog"."default" NOT NULL,
  "route_id" int8 NOT NULL,
  "sort" varchar(50) COLLATE "pg_catalog"."default",
  "type" varchar(10) COLLATE "pg_catalog"."default" NOT NULL,
  "call_body" text COLLATE "pg_catalog"."default",
  "req_params" text COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."iot_thing_api"."id" IS '����';
COMMENT ON COLUMN "public"."iot_thing_api"."name" IS 'API����';
COMMENT ON COLUMN "public"."iot_thing_api"."thing_condition" IS '���������ѯ����';
COMMENT ON COLUMN "public"."iot_thing_api"."attr_condition" IS '������Բ�ѯ����';
COMMENT ON COLUMN "public"."iot_thing_api"."time_condition" IS '���ʱ���ѯ����';
COMMENT ON COLUMN "public"."iot_thing_api"."token" IS '��ѯtoken';
COMMENT ON COLUMN "public"."iot_thing_api"."expire" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_thing_api"."calls_num" IS '���ô���';
COMMENT ON COLUMN "public"."iot_thing_api"."remark" IS '��ע';
COMMENT ON COLUMN "public"."iot_thing_api"."tenant_code" IS '�⻧����';
COMMENT ON COLUMN "public"."iot_thing_api"."company_id" IS '��˾id';
COMMENT ON COLUMN "public"."iot_thing_api"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."iot_thing_api"."creator" IS '������';
COMMENT ON COLUMN "public"."iot_thing_api"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_thing_api"."updater" IS '�޸���';
COMMENT ON COLUMN "public"."iot_thing_api"."update_date" IS '�޸�ʱ��';
COMMENT ON COLUMN "public"."iot_thing_api"."enable_status" IS '���ã�0δ����1����';
COMMENT ON COLUMN "public"."iot_thing_api"."route_url" IS '����·�ɵ�ַ';
COMMENT ON COLUMN "public"."iot_thing_api"."route_id" IS '����·��id';
COMMENT ON COLUMN "public"."iot_thing_api"."sort" IS '����:desc asc';
COMMENT ON COLUMN "public"."iot_thing_api"."type" IS '0 ��̬��� 1����api';
COMMENT ON COLUMN "public"."iot_thing_api"."call_body" IS '������';
COMMENT ON COLUMN "public"."iot_thing_api"."req_params" IS '�������';

-- ----------------------------
-- Records of iot_thing_api
-- ----------------------------

-- ----------------------------
-- Table structure for iot_thing_api_log
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_thing_api_log";
CREATE TABLE "public"."iot_thing_api_log" (
  "id" int8 NOT NULL,
  "api_id" int8 NOT NULL,
  "call_entity" text COLLATE "pg_catalog"."default" NOT NULL,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "api_name" varchar(255) COLLATE "pg_catalog"."default",
  "caller" varchar(255) COLLATE "pg_catalog"."default",
  "ip" varchar(255) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."iot_thing_api_log"."id" IS '����';
COMMENT ON COLUMN "public"."iot_thing_api_log"."api_id" IS '����apiid';
COMMENT ON COLUMN "public"."iot_thing_api_log"."call_entity" IS '������';
COMMENT ON COLUMN "public"."iot_thing_api_log"."creator" IS '������';
COMMENT ON COLUMN "public"."iot_thing_api_log"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_thing_api_log"."updater" IS '������';
COMMENT ON COLUMN "public"."iot_thing_api_log"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_thing_api_log"."api_name" IS '��������';
COMMENT ON COLUMN "public"."iot_thing_api_log"."caller" IS '���÷�';
COMMENT ON COLUMN "public"."iot_thing_api_log"."ip" IS '����ip';

-- ----------------------------
-- Records of iot_thing_api_log
-- ----------------------------

-- ----------------------------
-- Table structure for iot_thing_base_info
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_thing_base_info";
CREATE TABLE "public"."iot_thing_base_info" (
  "id" int8 NOT NULL,
  "thing_id" int8,
  "standard" varchar(255) COLLATE "pg_catalog"."default",
  "image_url" varchar(255) COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" timestamp(6),
  "updater" int8,
  "update_date" timestamp(6),
  "director" varchar(255) COLLATE "pg_catalog"."default",
  "eq_position" varchar(255) COLLATE "pg_catalog"."default",
  "buy_date" timestamp(6),
  "eq_status" varchar(255) COLLATE "pg_catalog"."default",
  "manufacturer" varchar(255) COLLATE "pg_catalog"."default",
  "supplier" varchar(255) COLLATE "pg_catalog"."default",
  "price" varchar(16) COLLATE "pg_catalog"."default",
  "stock" varchar(16) COLLATE "pg_catalog"."default",
  "use_status" varchar(16) COLLATE "pg_catalog"."default",
  "use_dept_id" int8,
  "operator" varchar(255) COLLATE "pg_catalog"."default",
  "scrap" varchar(16) COLLATE "pg_catalog"."default",
  "scrap_disposal" varchar(16) COLLATE "pg_catalog"."default",
  "ex_factory_no" varchar(64) COLLATE "pg_catalog"."default",
  "ex_factory_date" timestamp(6),
  "params" varchar(255) COLLATE "pg_catalog"."default",
  "unit" varchar(16) COLLATE "pg_catalog"."default",
  "tip" varchar(255) COLLATE "pg_catalog"."default",
  "eq_code" varchar(255) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."iot_thing_base_info"."thing_id" IS 'ʵ��id';
COMMENT ON COLUMN "public"."iot_thing_base_info"."standard" IS '�豸���';
COMMENT ON COLUMN "public"."iot_thing_base_info"."image_url" IS '�豸ͼƬurl';
COMMENT ON COLUMN "public"."iot_thing_base_info"."creator" IS '������';
COMMENT ON COLUMN "public"."iot_thing_base_info"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_thing_base_info"."updater" IS '������';
COMMENT ON COLUMN "public"."iot_thing_base_info"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_thing_base_info"."director" IS '������id';
COMMENT ON COLUMN "public"."iot_thing_base_info"."eq_position" IS '�豸λ��';
COMMENT ON COLUMN "public"."iot_thing_base_info"."buy_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_thing_base_info"."eq_status" IS '�豸״̬';
COMMENT ON COLUMN "public"."iot_thing_base_info"."manufacturer" IS '��������';
COMMENT ON COLUMN "public"."iot_thing_base_info"."supplier" IS '��Ӧ��';
COMMENT ON COLUMN "public"."iot_thing_base_info"."price" IS '�ο���';
COMMENT ON COLUMN "public"."iot_thing_base_info"."stock" IS '���';
COMMENT ON COLUMN "public"."iot_thing_base_info"."use_status" IS 'ʹ��״̬';
COMMENT ON COLUMN "public"."iot_thing_base_info"."use_dept_id" IS 'ʹ�ò���id';
COMMENT ON COLUMN "public"."iot_thing_base_info"."operator" IS '������id';
COMMENT ON COLUMN "public"."iot_thing_base_info"."scrap" IS '�Ƿ񱨷� 0δ���� 1�ѱ���';
COMMENT ON COLUMN "public"."iot_thing_base_info"."scrap_disposal" IS '�����Ƿ��� 0δ���� 1�Ѵ���';
COMMENT ON COLUMN "public"."iot_thing_base_info"."ex_factory_no" IS '�������';
COMMENT ON COLUMN "public"."iot_thing_base_info"."ex_factory_date" IS '��������';
COMMENT ON COLUMN "public"."iot_thing_base_info"."params" IS '��ϸ����';
COMMENT ON COLUMN "public"."iot_thing_base_info"."unit" IS '������λ';
COMMENT ON COLUMN "public"."iot_thing_base_info"."tip" IS '��ע';
COMMENT ON COLUMN "public"."iot_thing_base_info"."eq_code" IS '�豸���';
COMMENT ON TABLE "public"."iot_thing_base_info" IS '�豸������Ϣ';

-- ----------------------------
-- Records of iot_thing_base_info
-- ----------------------------

-- ----------------------------
-- Table structure for iot_thing_biz_config
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_thing_biz_config";
CREATE TABLE "public"."iot_thing_biz_config" (
  "id" int8 NOT NULL,
  "thing_id" int8 NOT NULL,
  "thing_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "thing_name" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "type" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8
)
;
COMMENT ON COLUMN "public"."iot_thing_biz_config"."id" IS '��������id';
COMMENT ON COLUMN "public"."iot_thing_biz_config"."thing_id" IS '��ʵ��id';
COMMENT ON COLUMN "public"."iot_thing_biz_config"."thing_code" IS '��code';
COMMENT ON COLUMN "public"."iot_thing_biz_config"."thing_name" IS '������';
COMMENT ON COLUMN "public"."iot_thing_biz_config"."type" IS '�������ͣ� ��ʱֻ�б�ѹ��';
COMMENT ON COLUMN "public"."iot_thing_biz_config"."creator" IS '������id';
COMMENT ON COLUMN "public"."iot_thing_biz_config"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_thing_biz_config"."updater" IS '������id';
COMMENT ON COLUMN "public"."iot_thing_biz_config"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_thing_biz_config"."tenant_code" IS '�⻧����';
COMMENT ON COLUMN "public"."iot_thing_biz_config"."company_id" IS '��ҵid';
COMMENT ON COLUMN "public"."iot_thing_biz_config"."dept_id" IS '����id';
COMMENT ON TABLE "public"."iot_thing_biz_config" IS '�豸ҵ������';

-- ----------------------------
-- Records of iot_thing_biz_config
-- ----------------------------

-- ----------------------------
-- Table structure for iot_thing_biz_config_item
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_thing_biz_config_item";
CREATE TABLE "public"."iot_thing_biz_config_item" (
  "id" int8 NOT NULL,
  "config_id" int8 NOT NULL,
  "item_name" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "item_alias" varchar(100) COLLATE "pg_catalog"."default",
  "item_value" varchar(255) COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."iot_thing_biz_config_item"."id" IS '��������id';
COMMENT ON COLUMN "public"."iot_thing_biz_config_item"."config_id" IS '�豸ҵ������id';
COMMENT ON COLUMN "public"."iot_thing_biz_config_item"."item_name" IS '����������';
COMMENT ON COLUMN "public"."iot_thing_biz_config_item"."item_alias" IS '���������';
COMMENT ON COLUMN "public"."iot_thing_biz_config_item"."item_value" IS '������ֵ';
COMMENT ON COLUMN "public"."iot_thing_biz_config_item"."creator" IS '������id';
COMMENT ON COLUMN "public"."iot_thing_biz_config_item"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_thing_biz_config_item"."updater" IS '������id';
COMMENT ON COLUMN "public"."iot_thing_biz_config_item"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."iot_thing_biz_config_item" IS '�豸ҵ��������';

-- ----------------------------
-- Records of iot_thing_biz_config_item
-- ----------------------------

-- ----------------------------
-- Table structure for iot_thing_dict
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_thing_dict";
CREATE TABLE "public"."iot_thing_dict" (
  "id" int8 NOT NULL,
  "code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "name" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "unit" varchar(50) COLLATE "pg_catalog"."default",
  "rate" int4,
  "color" varchar(25) COLLATE "pg_catalog"."default",
  "data_type" varchar(64) COLLATE "pg_catalog"."default" NOT NULL,
  "url" varchar(255) COLLATE "pg_catalog"."default",
  "remark" varchar(500) COLLATE "pg_catalog"."default",
  "extend_data" varchar(500) COLLATE "pg_catalog"."default",
  "is_default" int2 NOT NULL DEFAULT 1,
  "sort" int8 NOT NULL,
  "business_type" varchar(255) COLLATE "pg_catalog"."default",
  "group_name" varchar(255) COLLATE "pg_catalog"."default",
  "max_num" numeric,
  "min_num" numeric,
  "ev_type" varchar(255) COLLATE "pg_catalog"."default",
  "dept_id" int8,
  "tenant_code" int8,
  "company_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."iot_thing_dict"."id" IS '����';
COMMENT ON COLUMN "public"."iot_thing_dict"."code" IS '�ֵ���';
COMMENT ON COLUMN "public"."iot_thing_dict"."name" IS '�ֵ�����';
COMMENT ON COLUMN "public"."iot_thing_dict"."unit" IS '�ֵ䵥λ';
COMMENT ON COLUMN "public"."iot_thing_dict"."rate" IS 'Ƶ��(s)';
COMMENT ON COLUMN "public"."iot_thing_dict"."color" IS '��ɫ';
COMMENT ON COLUMN "public"."iot_thing_dict"."data_type" IS '��������: instant - ˲ʱ
increase - ����
region - ����
control - ����
alarm - �澯';
COMMENT ON COLUMN "public"."iot_thing_dict"."url" IS 'ͼ��';
COMMENT ON COLUMN "public"."iot_thing_dict"."remark" IS '��ע';
COMMENT ON COLUMN "public"."iot_thing_dict"."extend_data" IS '��չ�ֶ�';
COMMENT ON COLUMN "public"."iot_thing_dict"."is_default" IS '�Ƿ�ϵͳ�ֵ䣺0-Ĭ��ϵͳ 1-�Զ���';
COMMENT ON COLUMN "public"."iot_thing_dict"."sort" IS '����';
COMMENT ON COLUMN "public"."iot_thing_dict"."business_type" IS '��ط���ҳ��Ĭ������json��';
COMMENT ON COLUMN "public"."iot_thing_dict"."group_name" IS '������';
COMMENT ON COLUMN "public"."iot_thing_dict"."max_num" IS '���ֵ';
COMMENT ON COLUMN "public"."iot_thing_dict"."min_num" IS '��Сֵ';
COMMENT ON COLUMN "public"."iot_thing_dict"."ev_type" IS '��ԴƷ������';
COMMENT ON COLUMN "public"."iot_thing_dict"."dept_id" IS '����ID';
COMMENT ON COLUMN "public"."iot_thing_dict"."creator" IS '������';
COMMENT ON COLUMN "public"."iot_thing_dict"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_thing_dict"."updater" IS '������';
COMMENT ON COLUMN "public"."iot_thing_dict"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."iot_thing_dict" IS '���ֵ���Ϣ��';
 ----------------------------
-- Table structure for iot_thing_dict_relation
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_thing_dict_relation";
CREATE TABLE "public"."iot_thing_dict_relation" (
  "id" int8 NOT NULL,
  "group_name" varchar(255) COLLATE "pg_catalog"."default",
  "code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "name" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "unit" varchar(50) COLLATE "pg_catalog"."default",
  "rate" int4,
  "color" varchar(25) COLLATE "pg_catalog"."default",
  "data_type" varchar(64) COLLATE "pg_catalog"."default" NOT NULL,
  "url" varchar(255) COLLATE "pg_catalog"."default",
  "remark" varchar(500) COLLATE "pg_catalog"."default",
  "extend_data" varchar(500) COLLATE "pg_catalog"."default",
  "sort" int8 NOT NULL,
  "business_type" varchar(255) COLLATE "pg_catalog"."default",
  "max_num" numeric,
  "min_num" numeric,
  "entity_id" int8 NOT NULL,
  "ev_type" varchar(255) COLLATE "pg_catalog"."default",
  "entity_code" varchar(500) COLLATE "pg_catalog"."default",
  "entity_name" varchar(500) COLLATE "pg_catalog"."default",
  "template_mark" varchar(2) COLLATE "pg_catalog"."default" NOT NULL DEFAULT 0,
  "data_treating_mark" varchar(2) COLLATE "pg_catalog"."default" DEFAULT 0,
  "child_config" varchar(2048) COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8
)
;
COMMENT ON COLUMN "public"."iot_thing_dict_relation"."id" IS '����';
COMMENT ON COLUMN "public"."iot_thing_dict_relation"."group_name" IS '������';
COMMENT ON COLUMN "public"."iot_thing_dict_relation"."code" IS '�ֵ���';
COMMENT ON COLUMN "public"."iot_thing_dict_relation"."name" IS '�ֵ�����';
COMMENT ON COLUMN "public"."iot_thing_dict_relation"."unit" IS '�ֵ䵥λ';
COMMENT ON COLUMN "public"."iot_thing_dict_relation"."rate" IS 'Ƶ��(s)';
COMMENT ON COLUMN "public"."iot_thing_dict_relation"."color" IS '��ɫ';
COMMENT ON COLUMN "public"."iot_thing_dict_relation"."data_type" IS '��������: instant - ˲ʱ
increase - ����
region - ����
control - ����
alarm - �澯';
COMMENT ON COLUMN "public"."iot_thing_dict_relation"."url" IS 'ͼ��';
COMMENT ON COLUMN "public"."iot_thing_dict_relation"."remark" IS '��ע';
COMMENT ON COLUMN "public"."iot_thing_dict_relation"."extend_data" IS '��չ�ֶ�';
COMMENT ON COLUMN "public"."iot_thing_dict_relation"."sort" IS '����';
COMMENT ON COLUMN "public"."iot_thing_dict_relation"."business_type" IS '��ط���ҳ��Ĭ������json��';
COMMENT ON COLUMN "public"."iot_thing_dict_relation"."max_num" IS '���ֵ';
COMMENT ON COLUMN "public"."iot_thing_dict_relation"."min_num" IS '��Сֵ';
COMMENT ON COLUMN "public"."iot_thing_dict_relation"."entity_id" IS '��ʵ��ID';
COMMENT ON COLUMN "public"."iot_thing_dict_relation"."ev_type" IS '��ԴƷ������';
COMMENT ON COLUMN "public"."iot_thing_dict_relation"."entity_code" IS '�����';
COMMENT ON COLUMN "public"."iot_thing_dict_relation"."entity_name" IS '������';
COMMENT ON COLUMN "public"."iot_thing_dict_relation"."template_mark" IS '�Ƿ���ģ�壬1ģ�壬0 ʵ��(Ĭ��)';
COMMENT ON COLUMN "public"."iot_thing_dict_relation"."data_treating_mark" IS '�Ƿ�Ϊ���ݴ���: 0 �� 1 ��';
COMMENT ON COLUMN "public"."iot_thing_dict_relation"."child_config" IS 'ӳ���Ӽ�(�������б�)';
COMMENT ON COLUMN "public"."iot_thing_dict_relation"."creator" IS '������';
COMMENT ON COLUMN "public"."iot_thing_dict_relation"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_thing_dict_relation"."updater" IS '������';
COMMENT ON COLUMN "public"."iot_thing_dict_relation"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_thing_dict_relation"."tenant_code" IS '�⻧����';
COMMENT ON COLUMN "public"."iot_thing_dict_relation"."company_id" IS '��˾id';
COMMENT ON COLUMN "public"."iot_thing_dict_relation"."dept_id" IS '����ID';
COMMENT ON TABLE "public"."iot_thing_dict_relation" IS '��ָ����Ϣ��';

-- ----------------------------
-- Records of iot_thing_dict_relation
-- ----------------------------

-- ----------------------------
-- Table structure for iot_thing_entity
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_thing_entity";
CREATE TABLE "public"."iot_thing_entity" (
  "id" int8 NOT NULL,
  "code" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "name" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "real_type" varchar(2) COLLATE "pg_catalog"."default" NOT NULL DEFAULT 1,
  "template_mark" varchar(2) COLLATE "pg_catalog"."default" NOT NULL DEFAULT 0,
  "type" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "enable_status" varchar(2) COLLATE "pg_catalog"."default" NOT NULL DEFAULT 1,
  "remark" varchar(255) COLLATE "pg_catalog"."default",
  "extend_data" text COLLATE "pg_catalog"."default",
  "img" varchar(500) COLLATE "pg_catalog"."default",
  "lon" varchar(255) COLLATE "pg_catalog"."default",
  "lat" varchar(255) COLLATE "pg_catalog"."default",
  "tenant_code" int8,
  "company_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "dept_ids" varchar(2000) COLLATE "pg_catalog"."default",
  "tags" varchar(2000) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."iot_thing_entity"."id" IS '����ID';
COMMENT ON COLUMN "public"."iot_thing_entity"."code" IS 'thing_code';
COMMENT ON COLUMN "public"."iot_thing_entity"."name" IS '�⻧�������ƣ��⻧�Զ���';
COMMENT ON COLUMN "public"."iot_thing_entity"."real_type" IS '�⻧����������ͣ�0���� 1��ʵ';
COMMENT ON COLUMN "public"."iot_thing_entity"."template_mark" IS '�Ƿ���ģ�壬1ģ�壬0 ʵ��(Ĭ��)';
COMMENT ON COLUMN "public"."iot_thing_entity"."type" IS '������';
COMMENT ON COLUMN "public"."iot_thing_entity"."enable_status" IS '����ͣ�ã�0ͣ�ã�1���ã�(ͣ�õ�������ٻ�ȡ�����Ҳ���չʾ��ҳ�棬���ܳ���)';
COMMENT ON COLUMN "public"."iot_thing_entity"."remark" IS '��ע˵��';
COMMENT ON COLUMN "public"."iot_thing_entity"."extend_data" IS '��չ�ֶ�';
COMMENT ON COLUMN "public"."iot_thing_entity"."img" IS 'ͼƬurl';
COMMENT ON COLUMN "public"."iot_thing_entity"."lon" IS '����';
COMMENT ON COLUMN "public"."iot_thing_entity"."lat" IS 'γ��';
COMMENT ON COLUMN "public"."iot_thing_entity"."tenant_code" IS '�⻧����';
COMMENT ON COLUMN "public"."iot_thing_entity"."company_id" IS '��ҵ����id';
COMMENT ON COLUMN "public"."iot_thing_entity"."creator" IS '������';
COMMENT ON COLUMN "public"."iot_thing_entity"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_thing_entity"."updater" IS '������';
COMMENT ON COLUMN "public"."iot_thing_entity"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_thing_entity"."dept_ids" IS 'Ȩ�޷��䣺����id';
COMMENT ON COLUMN "public"."iot_thing_entity"."tags" IS '��ǩ';
COMMENT ON TABLE "public"."iot_thing_entity" IS '��ʵ���';

-- ----------------------------
-- Records of iot_thing_entity
-- ----------------------------

-- ----------------------------
-- Table structure for iot_thing_menu_config
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_thing_menu_config";
CREATE TABLE "public"."iot_thing_menu_config" (
  "id" int8 NOT NULL,
  "menu_id" varchar(255) COLLATE "pg_catalog"."default",
  "menu_config" varchar COLLATE "pg_catalog"."default",
  "config_type" varchar(2) COLLATE "pg_catalog"."default",
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "view_config" text COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."iot_thing_menu_config"."id" IS '����ID';
COMMENT ON COLUMN "public"."iot_thing_menu_config"."menu_id" IS '�˵�ID';
COMMENT ON COLUMN "public"."iot_thing_menu_config"."menu_config" IS '�˵�������Ϣ{thingRelationConfig:[]}';
COMMENT ON COLUMN "public"."iot_thing_menu_config"."config_type" IS '�������� ����:��ط�������,������������';
COMMENT ON COLUMN "public"."iot_thing_menu_config"."tenant_code" IS '�⻧����';
COMMENT ON COLUMN "public"."iot_thing_menu_config"."company_id" IS '��ҵ����id';
COMMENT ON COLUMN "public"."iot_thing_menu_config"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."iot_thing_menu_config"."creator" IS '������';
COMMENT ON COLUMN "public"."iot_thing_menu_config"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_thing_menu_config"."updater" IS '������';
COMMENT ON COLUMN "public"."iot_thing_menu_config"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_thing_menu_config"."view_config" IS '��ط���ҳ��Ĭ������json��';
COMMENT ON TABLE "public"."iot_thing_menu_config" IS '���ϵ�˵����ñ�';

-- ----------------------------
-- Records of iot_thing_menu_config
-- ----------------------------

-- ----------------------------
-- Table structure for iot_thing_model
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_thing_model";
CREATE TABLE "public"."iot_thing_model" (
  "id" int8 NOT NULL,
  "code" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "token" varchar(128) COLLATE "pg_catalog"."default",
  "gateway" varchar(2) COLLATE "pg_catalog"."default" NOT NULL DEFAULT 0,
  "status" varchar(2) COLLATE "pg_catalog"."default" DEFAULT 3,
  "status_ts" int8,
  "auth_num" int8 DEFAULT 0,
  "origin" varchar(128) COLLATE "pg_catalog"."default",
  "remark" varchar(255) COLLATE "pg_catalog"."default",
  "extend_data" varchar(255) COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "real_type" varchar(2) COLLATE "pg_catalog"."default" NOT NULL DEFAULT 1
)
;
COMMENT ON COLUMN "public"."iot_thing_model"."id" IS 'id';
COMMENT ON COLUMN "public"."iot_thing_model"."code" IS '�����';
COMMENT ON COLUMN "public"."iot_thing_model"."token" IS 'TB: token';
COMMENT ON COLUMN "public"."iot_thing_model"."gateway" IS '�Ƿ�����: 0��1��';
COMMENT ON COLUMN "public"."iot_thing_model"."status" IS '��������״̬��0���� 1���� 2���� 3δ����';
COMMENT ON COLUMN "public"."iot_thing_model"."status_ts" IS '����״̬�ı�ʱ��';
COMMENT ON COLUMN "public"."iot_thing_model"."auth_num" IS '�����䵽�����⻧';
COMMENT ON COLUMN "public"."iot_thing_model"."origin" IS '������Դ';
COMMENT ON COLUMN "public"."iot_thing_model"."remark" IS '��ע˵��';
COMMENT ON COLUMN "public"."iot_thing_model"."extend_data" IS '��ע�ֶ�';
COMMENT ON COLUMN "public"."iot_thing_model"."creator" IS '������';
COMMENT ON COLUMN "public"."iot_thing_model"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_thing_model"."updater" IS '������';
COMMENT ON COLUMN "public"."iot_thing_model"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_thing_model"."real_type" IS '�⻧����������ͣ�0���� 1��ʵ';
COMMENT ON TABLE "public"."iot_thing_model" IS '��ģ�ͱ�';

-- ----------------------------
-- Records of iot_thing_model
-- ----------------------------

-- ----------------------------
-- Table structure for iot_thing_relation_detail
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_thing_relation_detail";
CREATE TABLE "public"."iot_thing_relation_detail" (
  "id" int8 NOT NULL,
  "from_id" int8 NOT NULL,
  "from_code" varchar(255) COLLATE "pg_catalog"."default",
  "from_name" varchar(255) COLLATE "pg_catalog"."default",
  "to_id" int8 NOT NULL,
  "to_code" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "to_name" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "root_id" int8 NOT NULL,
  "config" varchar(2048) COLLATE "pg_catalog"."default",
  "remark" varchar(500) COLLATE "pg_catalog"."default",
  "sort" int8,
  "root_thing_id" int8,
  "url" varchar(255) COLLATE "pg_catalog"."default",
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "tag" varchar(255) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."iot_thing_relation_detail"."id" IS '����';
COMMENT ON COLUMN "public"."iot_thing_relation_detail"."from_id" IS '�ϼ���ʵ��id';
COMMENT ON COLUMN "public"."iot_thing_relation_detail"."from_code" IS '�ϼ���ʵ��code';
COMMENT ON COLUMN "public"."iot_thing_relation_detail"."from_name" IS '�ϼ��ڵ�����';
COMMENT ON COLUMN "public"."iot_thing_relation_detail"."to_id" IS '�¼���ʵ��id';
COMMENT ON COLUMN "public"."iot_thing_relation_detail"."to_code" IS '�¼���ʵ��code';
COMMENT ON COLUMN "public"."iot_thing_relation_detail"."to_name" IS '�¼���ʵ������';
COMMENT ON COLUMN "public"."iot_thing_relation_detail"."root_id" IS '������';
COMMENT ON COLUMN "public"."iot_thing_relation_detail"."config" IS '������Ϣ(����x��y��width��height��shape��)';
COMMENT ON COLUMN "public"."iot_thing_relation_detail"."remark" IS '��ע';
COMMENT ON COLUMN "public"."iot_thing_relation_detail"."sort" IS '����';
COMMENT ON COLUMN "public"."iot_thing_relation_detail"."root_thing_id" IS '���豸id';
COMMENT ON COLUMN "public"."iot_thing_relation_detail"."url" IS 'ͼƬ��Ϣ';
COMMENT ON COLUMN "public"."iot_thing_relation_detail"."tenant_code" IS '������ҵ(�⻧)';
COMMENT ON COLUMN "public"."iot_thing_relation_detail"."company_id" IS '��ҵ����id';
COMMENT ON COLUMN "public"."iot_thing_relation_detail"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."iot_thing_relation_detail"."creator" IS '������';
COMMENT ON COLUMN "public"."iot_thing_relation_detail"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_thing_relation_detail"."updater" IS '������';
COMMENT ON COLUMN "public"."iot_thing_relation_detail"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_thing_relation_detail"."tag" IS '���ǩ';
COMMENT ON TABLE "public"."iot_thing_relation_detail" IS '���ϵ������Ϣ��';

-- ----------------------------
-- Records of iot_thing_relation_detail
-- ----------------------------

-- ----------------------------
-- Table structure for iot_thing_relation_root
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_thing_relation_root";
CREATE TABLE "public"."iot_thing_relation_root" (
  "id" int8 NOT NULL,
  "name" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "remark" varchar(2048) COLLATE "pg_catalog"."default",
  "url" varchar(2048) COLLATE "pg_catalog"."default",
  "config" text COLLATE "pg_catalog"."default",
  "sort" int8 NOT NULL,
  "relation_show" int2 NOT NULL DEFAULT 1,
  "relation_sort" int4,
  "group_name" varchar(255) COLLATE "pg_catalog"."default",
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."iot_thing_relation_root"."id" IS '����';
COMMENT ON COLUMN "public"."iot_thing_relation_root"."name" IS '��ϵ����';
COMMENT ON COLUMN "public"."iot_thing_relation_root"."remark" IS '����';
COMMENT ON COLUMN "public"."iot_thing_relation_root"."url" IS 'ͼƬ��ַ';
COMMENT ON COLUMN "public"."iot_thing_relation_root"."config" IS '��ϵ������';
COMMENT ON COLUMN "public"."iot_thing_relation_root"."sort" IS '����';
COMMENT ON COLUMN "public"."iot_thing_relation_root"."relation_show" IS '�Ƿ������ϵ��ʾ 0:��չʾ 1.չʾ';
COMMENT ON COLUMN "public"."iot_thing_relation_root"."relation_sort" IS '���ϵ��ʾ����';
COMMENT ON COLUMN "public"."iot_thing_relation_root"."group_name" IS '������';
COMMENT ON COLUMN "public"."iot_thing_relation_root"."tenant_code" IS '������ҵ(�⻧)';
COMMENT ON COLUMN "public"."iot_thing_relation_root"."company_id" IS '��ҵ����id';
COMMENT ON COLUMN "public"."iot_thing_relation_root"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."iot_thing_relation_root"."creator" IS '������';
COMMENT ON COLUMN "public"."iot_thing_relation_root"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_thing_relation_root"."updater" IS '������';
COMMENT ON COLUMN "public"."iot_thing_relation_root"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."iot_thing_relation_root" IS '���ϵ����';

-- ----------------------------
-- Table structure for iot_thing_source
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_thing_source";
CREATE TABLE "public"."iot_thing_source" (
  "id" int8 NOT NULL,
  "thing_id" int8 NOT NULL,
  "thing_name" varchar(255) COLLATE "pg_catalog"."default",
  "thing_code" varchar(255) COLLATE "pg_catalog"."default",
  "thing_attr_name" varchar(255) COLLATE "pg_catalog"."default",
  "thing_attr_code" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "thing_attr_code_type" varchar(8) COLLATE "pg_catalog"."default",
  "thing_attr_type" varchar(8) COLLATE "pg_catalog"."default",
  "thing_attr_unit" varchar(50) COLLATE "pg_catalog"."default",
  "thing_icon" varchar(255) COLLATE "pg_catalog"."default",
  "thing_serial" varchar(8) COLLATE "pg_catalog"."default",
  "thing_attr_icon" varchar COLLATE "pg_catalog"."default",
  "time_horizon_type" varchar(8) COLLATE "pg_catalog"."default",
  "thing_attr_boundary" varchar COLLATE "pg_catalog"."default",
  "gather_frequency" int8,
  "root_id" int8,
  "config_type" varchar(8) COLLATE "pg_catalog"."default" NOT NULL,
  "data_treating_mark" varchar(8) COLLATE "pg_catalog"."default",
  "data_deal_config" text COLLATE "pg_catalog"."default",
  "show_status" varchar(255) COLLATE "pg_catalog"."default",
  "sort" int8,
  "from_id" int8 NOT NULL,
  "from_code" varchar(255) COLLATE "pg_catalog"."default",
  "from_name" varchar(255) COLLATE "pg_catalog"."default",
  "remark" varchar(128) COLLATE "pg_catalog"."default",
  "extend_data" varchar(256) COLLATE "pg_catalog"."default",
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "thing_attr_group" varchar(255) COLLATE "pg_catalog"."default",
  "start_status" varchar(255) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."iot_thing_source"."id" IS '����ID';
COMMENT ON COLUMN "public"."iot_thing_source"."thing_id" IS '��id';
COMMENT ON COLUMN "public"."iot_thing_source"."thing_name" IS '������(����Դ����)';
COMMENT ON COLUMN "public"."iot_thing_source"."thing_code" IS '�����';
COMMENT ON COLUMN "public"."iot_thing_source"."thing_attr_name" IS '����������';
COMMENT ON COLUMN "public"."iot_thing_source"."thing_attr_code" IS '������code';
COMMENT ON COLUMN "public"."iot_thing_source"."thing_attr_code_type" IS '������code����(yy mm hh)';
COMMENT ON COLUMN "public"."iot_thing_source"."thing_attr_type" IS '��������������';
COMMENT ON COLUMN "public"."iot_thing_source"."thing_attr_unit" IS '�����Ե�λ';
COMMENT ON COLUMN "public"."iot_thing_source"."thing_icon" IS '��ɫ';
COMMENT ON COLUMN "public"."iot_thing_source"."thing_serial" IS '�����(������Դ���ݴ���)';
COMMENT ON COLUMN "public"."iot_thing_source"."thing_attr_icon" IS '������ͼ��';
COMMENT ON COLUMN "public"."iot_thing_source"."time_horizon_type" IS 'ʱ�䷶Χ����';
COMMENT ON COLUMN "public"."iot_thing_source"."thing_attr_boundary" IS '������ֵ��Χ(���ޡ����ޡ��ٽ��)';
COMMENT ON COLUMN "public"."iot_thing_source"."gather_frequency" IS '�ɼ�Ƶ��';
COMMENT ON COLUMN "public"."iot_thing_source"."root_id" IS '������';
COMMENT ON COLUMN "public"."iot_thing_source"."config_type" IS '�������� ����:
1- ��ط�������,
2- ������������
5- ����ͳ�Ʊ�������
6-̼��ͳ�Ʊ�������
11- ̼�ż������';
COMMENT ON COLUMN "public"."iot_thing_source"."data_treating_mark" IS '�Ƿ�Ϊ���ݴ���:0 ���ݴ��� 1��������';
COMMENT ON COLUMN "public"."iot_thing_source"."data_deal_config" IS '���ݴ���ǰ��ʹ�ã�';
COMMENT ON COLUMN "public"."iot_thing_source"."show_status" IS '�Ƿ�չʾ��ֵ��ֵ��0 չʾ 1 ��չʾ';
COMMENT ON COLUMN "public"."iot_thing_source"."sort" IS '���';
COMMENT ON COLUMN "public"."iot_thing_source"."from_id" IS 'Դ��id';
COMMENT ON COLUMN "public"."iot_thing_source"."from_code" IS 'Դ��code';
COMMENT ON COLUMN "public"."iot_thing_source"."remark" IS '��ע˵��';
COMMENT ON COLUMN "public"."iot_thing_source"."extend_data" IS '��չ�ֶ�';
COMMENT ON COLUMN "public"."iot_thing_source"."tenant_code" IS '�⻧����';
COMMENT ON COLUMN "public"."iot_thing_source"."company_id" IS '��ҵ����id';
COMMENT ON COLUMN "public"."iot_thing_source"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."iot_thing_source"."creator" IS '������';
COMMENT ON COLUMN "public"."iot_thing_source"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_thing_source"."updater" IS '������';
COMMENT ON COLUMN "public"."iot_thing_source"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_thing_source"."thing_attr_group" IS '��ǩ��';
COMMENT ON COLUMN "public"."iot_thing_source"."start_status" IS '��������״̬';
COMMENT ON TABLE "public"."iot_thing_source" IS '��ط����������������豸�������ñ�';

-- ----------------------------
-- Records of iot_thing_source
-- ----------------------------

-- ----------------------------
-- Table structure for iot_visual_component
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_visual_component";
CREATE TABLE "public"."iot_visual_component" (
  "id" int8,
  "name" varchar(255) COLLATE "pg_catalog"."default",
  "group_id" int8,
  "type" varchar(50) COLLATE "pg_catalog"."default",
  "desc" varchar(2550) COLLATE "pg_catalog"."default",
  "is_default" varchar(2) COLLATE "pg_catalog"."default",
  "thumbnail_url" varchar(255) COLLATE "pg_catalog"."default",
  "preview_options" text COLLATE "pg_catalog"."default",
  "hash" text COLLATE "pg_catalog"."default",
  "remarks" varchar(1024) COLLATE "pg_catalog"."default",
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "sort" int4,
  "config" text COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."iot_visual_component"."id" IS '����id';
COMMENT ON COLUMN "public"."iot_visual_component"."name" IS '��������';
COMMENT ON COLUMN "public"."iot_visual_component"."group_id" IS '������id';
COMMENT ON COLUMN "public"."iot_visual_component"."type" IS '��������';
COMMENT ON COLUMN "public"."iot_visual_component"."desc" IS '������ע����';
COMMENT ON COLUMN "public"."iot_visual_component"."is_default" IS '0 �� 1��';
COMMENT ON COLUMN "public"."iot_visual_component"."thumbnail_url" IS '��������ͼurl';
COMMENT ON COLUMN "public"."iot_visual_component"."preview_options" IS 'preview_options';
COMMENT ON COLUMN "public"."iot_visual_component"."hash" IS '����json';
COMMENT ON COLUMN "public"."iot_visual_component"."remarks" IS '��ע˵��';
COMMENT ON COLUMN "public"."iot_visual_component"."tenant_code" IS '������ҵ(�⻧code)';
COMMENT ON COLUMN "public"."iot_visual_component"."company_id" IS '��ҵ����id';
COMMENT ON COLUMN "public"."iot_visual_component"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."iot_visual_component"."creator" IS '������';
COMMENT ON COLUMN "public"."iot_visual_component"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_visual_component"."updater" IS '������';
COMMENT ON COLUMN "public"."iot_visual_component"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_visual_component"."sort" IS '�����������';
COMMENT ON COLUMN "public"."iot_visual_component"."config" IS '��������';

-- ----------------------------
-- Records of iot_visual_component
-- ----------------------------

-- ----------------------------
-- Table structure for iot_visual_design
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_visual_design";
CREATE TABLE "public"."iot_visual_design" (
  "id" int8 NOT NULL,
  "board_manage_id" int8,
  "page_name" varchar(255) COLLATE "pg_catalog"."default",
  "picture_data" text COLLATE "pg_catalog"."default",
  "api_set_ids" varchar(255) COLLATE "pg_catalog"."default",
  "board_type" varchar COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."iot_visual_design"."id" IS '����id';
COMMENT ON COLUMN "public"."iot_visual_design"."board_manage_id" IS '��̬����id';
COMMENT ON COLUMN "public"."iot_visual_design"."page_name" IS 'ҳ������';
COMMENT ON COLUMN "public"."iot_visual_design"."picture_data" IS 'ͼ����';
COMMENT ON COLUMN "public"."iot_visual_design"."api_set_ids" IS '����apiid�����id��Ӣ�Ķ���,�ָ�';
COMMENT ON COLUMN "public"."iot_visual_design"."board_type" IS '��������';
COMMENT ON TABLE "public"."iot_visual_design" IS '��̬��ƹ���';

-- ----------------------------
-- Records of iot_visual_design
-- ----------------------------

-- ----------------------------
-- Table structure for iot_visual_group
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_visual_group";
CREATE TABLE "public"."iot_visual_group" (
  "id" int8 NOT NULL,
  "name" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "business_name" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "type" varchar(4) COLLATE "pg_catalog"."default" NOT NULL,
  "is_default" varchar(2) COLLATE "pg_catalog"."default" NOT NULL,
  "thumbnail_url" text COLLATE "pg_catalog"."default",
  "sort" int8 NOT NULL DEFAULT 0,
  "bs_sort" int8 NOT NULL,
  "remark" varchar(500) COLLATE "pg_catalog"."default",
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."iot_visual_group"."id" IS '����id';
COMMENT ON COLUMN "public"."iot_visual_group"."name" IS '�ز�/����������';
COMMENT ON COLUMN "public"."iot_visual_group"."business_name" IS '�ز�/������ҵ���������';
COMMENT ON COLUMN "public"."iot_visual_group"."type" IS '1 �زģ�2����';
COMMENT ON COLUMN "public"."iot_visual_group"."is_default" IS '�Ƿ�Ĭ�ϣ�0Ĭ�ϣ�1�Զ���';
COMMENT ON COLUMN "public"."iot_visual_group"."thumbnail_url" IS '����ͼurl/�����text��Ҳ������svg��base64';
COMMENT ON COLUMN "public"."iot_visual_group"."sort" IS '������';
COMMENT ON COLUMN "public"."iot_visual_group"."bs_sort" IS '����ҵ������';
COMMENT ON COLUMN "public"."iot_visual_group"."remark" IS '��ע˵��';
COMMENT ON COLUMN "public"."iot_visual_group"."tenant_code" IS '������ҵ(�⻧code)';
COMMENT ON COLUMN "public"."iot_visual_group"."company_id" IS '��ҵ����id';
COMMENT ON COLUMN "public"."iot_visual_group"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."iot_visual_group"."creator" IS '������';
COMMENT ON COLUMN "public"."iot_visual_group"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_visual_group"."updater" IS '������';
COMMENT ON COLUMN "public"."iot_visual_group"."update_date" IS '����ʱ��';

-- ----------------------------
-- Table structure for iot_visual_manage
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_visual_manage";
CREATE TABLE "public"."iot_visual_manage" (
  "id" int8 NOT NULL,
  "name" varchar(255) COLLATE "pg_catalog"."default",
  "type" varchar(255) COLLATE "pg_catalog"."default",
  "thumbnail_url" text COLLATE "pg_catalog"."default",
  "is_template" bool,
  "remarks" varchar(10240) COLLATE "pg_catalog"."default",
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "background_image" text COLLATE "pg_catalog"."default",
  "preview_url" varchar(2550) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."iot_visual_manage"."id" IS '����id����';
COMMENT ON COLUMN "public"."iot_visual_manage"."name" IS '��������';
COMMENT ON COLUMN "public"."iot_visual_manage"."type" IS '��������';
COMMENT ON COLUMN "public"."iot_visual_manage"."thumbnail_url" IS '����ͼurl';
COMMENT ON COLUMN "public"."iot_visual_manage"."is_template" IS '�Ƿ�Ϊģ��';
COMMENT ON COLUMN "public"."iot_visual_manage"."remarks" IS '��ע';
COMMENT ON COLUMN "public"."iot_visual_manage"."tenant_code" IS '������ҵ(�⻧code)';
COMMENT ON COLUMN "public"."iot_visual_manage"."company_id" IS '��ҵ����id';
COMMENT ON COLUMN "public"."iot_visual_manage"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."iot_visual_manage"."creator" IS '������';
COMMENT ON COLUMN "public"."iot_visual_manage"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_visual_manage"."updater" IS '������';
COMMENT ON COLUMN "public"."iot_visual_manage"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_visual_manage"."background_image" IS '��������ı���ͼƬ';
COMMENT ON COLUMN "public"."iot_visual_manage"."preview_url" IS 'Ԥ��url';
COMMENT ON TABLE "public"."iot_visual_manage" IS '��̬�������';

-- ----------------------------
-- Records of iot_visual_manage
-- ----------------------------

-- ----------------------------
-- Table structure for iot_visual_material
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_visual_material";
CREATE TABLE "public"."iot_visual_material" (
  "id" int8 NOT NULL,
  "name" varchar(255) COLLATE "pg_catalog"."default",
  "type" varchar(255) COLLATE "pg_catalog"."default",
  "is_default" int4,
  "group_id" int8,
  "image" text COLLATE "pg_catalog"."default",
  "remark" varchar(1024) COLLATE "pg_catalog"."default",
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "material_file" text COLLATE "pg_catalog"."default",
  "sort" int4
)
;
COMMENT ON COLUMN "public"."iot_visual_material"."id" IS '�ز�id';
COMMENT ON COLUMN "public"."iot_visual_material"."name" IS '�ز�����';
COMMENT ON COLUMN "public"."iot_visual_material"."type" IS '�ز��ļ�����';
COMMENT ON COLUMN "public"."iot_visual_material"."is_default" IS '�Ƿ�Ĭ��0�ǣ�1��';
COMMENT ON COLUMN "public"."iot_visual_material"."group_id" IS '�����ز���id';
COMMENT ON COLUMN "public"."iot_visual_material"."image" IS '�ļ�url';
COMMENT ON COLUMN "public"."iot_visual_material"."remark" IS '��ע˵��';
COMMENT ON COLUMN "public"."iot_visual_material"."tenant_code" IS '������ҵ(�⻧code)';
COMMENT ON COLUMN "public"."iot_visual_material"."company_id" IS '��ҵ����id';
COMMENT ON COLUMN "public"."iot_visual_material"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."iot_visual_material"."creator" IS '������';
COMMENT ON COLUMN "public"."iot_visual_material"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_visual_material"."updater" IS '������';
COMMENT ON COLUMN "public"."iot_visual_material"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_visual_material"."material_file" IS '�ز��ļ���svgxml/base64';
COMMENT ON COLUMN "public"."iot_visual_material"."sort" IS '����';
COMMENT ON TABLE "public"."iot_visual_material" IS '�زĹ���';

-- ----------------------------
-- Table structure for mock_data_config
-- ----------------------------
DROP TABLE IF EXISTS "public"."mock_data_config";
CREATE TABLE "public"."mock_data_config" (
  "id" int8 NOT NULL,
  "thing_name" varchar(100) COLLATE "pg_catalog"."default",
  "thing_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "attr_name" varchar(100) COLLATE "pg_catalog"."default",
  "attr_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "formula" varchar(255) COLLATE "pg_catalog"."default",
  "frequency" int4,
  "time_unit" varchar(10) COLLATE "pg_catalog"."default",
  "on_time" bool,
  "enable" bool,
  "remark" varchar(255) COLLATE "pg_catalog"."default",
  "tenant_code" int8 NOT NULL,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."mock_data_config"."id" IS '����';
COMMENT ON COLUMN "public"."mock_data_config"."thing_name" IS 'Ŀ��������';
COMMENT ON COLUMN "public"."mock_data_config"."thing_code" IS 'Ŀ�������';
COMMENT ON COLUMN "public"."mock_data_config"."attr_name" IS 'Ŀ����������';
COMMENT ON COLUMN "public"."mock_data_config"."attr_code" IS 'Ŀ�����Ա���';
COMMENT ON COLUMN "public"."mock_data_config"."formula" IS '���㹫ʽ';
COMMENT ON COLUMN "public"."mock_data_config"."frequency" IS '����ģ��Ƶ��';
COMMENT ON COLUMN "public"."mock_data_config"."time_unit" IS 'Ƶ�ʵ�λ���롢�֡�ʱ';
COMMENT ON COLUMN "public"."mock_data_config"."on_time" IS '�Ƿ�����:�������=0����=0��5��15��30��45';
COMMENT ON COLUMN "public"."mock_data_config"."enable" IS '�Ƿ����ü���';
COMMENT ON COLUMN "public"."mock_data_config"."remark" IS '��ע';
COMMENT ON COLUMN "public"."mock_data_config"."tenant_code" IS '�⻧����';
COMMENT ON COLUMN "public"."mock_data_config"."company_id" IS '��ҵid';
COMMENT ON COLUMN "public"."mock_data_config"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."mock_data_config"."creator" IS '������';
COMMENT ON COLUMN "public"."mock_data_config"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."mock_data_config"."updater" IS '������';
COMMENT ON COLUMN "public"."mock_data_config"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."mock_data_config" IS '����ģ�����ñ�';

-- ----------------------------
-- Records of mock_data_config
-- ----------------------------

-- ----------------------------
-- Table structure for mock_data_log
-- ----------------------------
DROP TABLE IF EXISTS "public"."mock_data_log";
CREATE TABLE "public"."mock_data_log" (
  "id" int8 NOT NULL,
  "mock_config_id" int8 NOT NULL,
  "formula" varchar(255) COLLATE "pg_catalog"."default",
  "time" int8,
  "result" varchar(255) COLLATE "pg_catalog"."default",
  "tenant_code" int8 NOT NULL,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."mock_data_log"."id" IS '����';
COMMENT ON COLUMN "public"."mock_data_log"."mock_config_id" IS '����ģ�����ñ�id';
COMMENT ON COLUMN "public"."mock_data_log"."formula" IS '���㹫ʽ';
COMMENT ON COLUMN "public"."mock_data_log"."time" IS '����ʱ��';
COMMENT ON COLUMN "public"."mock_data_log"."result" IS '������';
COMMENT ON COLUMN "public"."mock_data_log"."tenant_code" IS '�⻧����';
COMMENT ON COLUMN "public"."mock_data_log"."company_id" IS '��ҵid';
COMMENT ON COLUMN "public"."mock_data_log"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."mock_data_log"."creator" IS '������';
COMMENT ON COLUMN "public"."mock_data_log"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."mock_data_log"."updater" IS '������';
COMMENT ON COLUMN "public"."mock_data_log"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."mock_data_log" IS '����ģ����־��';

-- ----------------------------
-- Records of mock_data_log
-- ----------------------------

-- ----------------------------
-- Table structure for mqtt_broker_connect
-- ----------------------------
DROP TABLE IF EXISTS "public"."mqtt_broker_connect";
CREATE TABLE "public"."mqtt_broker_connect" (
  "id" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "client_id" varchar(255) COLLATE "pg_catalog"."default",
  "user_name" varchar(255) COLLATE "pg_catalog"."default",
  "start_time" int8,
  "last_time" int8,
  "client_ip" varchar(255) COLLATE "pg_catalog"."default",
  "msg_num" int4,
  "creator" int8,
  "create_date" timestamp(6),
  "updater" int8,
  "update_date" timestamp(6)
)
;
COMMENT ON COLUMN "public"."mqtt_broker_connect"."id" IS '��������ǰ���ӵ�sessionId';
COMMENT ON COLUMN "public"."mqtt_broker_connect"."client_id" IS '�ͻ���ID';
COMMENT ON COLUMN "public"."mqtt_broker_connect"."user_name" IS '�û���(�豸token)';
COMMENT ON COLUMN "public"."mqtt_broker_connect"."start_time" IS '��ʼ����ʱ��';
COMMENT ON COLUMN "public"."mqtt_broker_connect"."last_time" IS '�������ʱ��';
COMMENT ON COLUMN "public"."mqtt_broker_connect"."client_ip" IS '�ͻ���IP';
COMMENT ON COLUMN "public"."mqtt_broker_connect"."msg_num" IS '������Ϣ����';
COMMENT ON COLUMN "public"."mqtt_broker_connect"."creator" IS '������';
COMMENT ON COLUMN "public"."mqtt_broker_connect"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."mqtt_broker_connect"."updater" IS '������';
COMMENT ON COLUMN "public"."mqtt_broker_connect"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."mqtt_broker_connect" IS 'mqttBroker������־';

-- ----------------------------
-- Records of mqtt_broker_connect
-- ----------------------------

-- ----------------------------
-- Table structure for mqtt_broker_msg
-- ----------------------------
DROP TABLE IF EXISTS "public"."mqtt_broker_msg";
CREATE TABLE "public"."mqtt_broker_msg" (
  "id" int8 NOT NULL,
  "client_id" varchar(255) COLLATE "pg_catalog"."default",
  "user_name" varchar(255) COLLATE "pg_catalog"."default",
  "msg" varchar COLLATE "pg_catalog"."default",
  "topic" varchar(255) COLLATE "pg_catalog"."default",
  "session_id" varchar(40) COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" timestamp(6),
  "updater" int8,
  "update_date" timestamp(6)
)
;
COMMENT ON COLUMN "public"."mqtt_broker_msg"."client_id" IS '�ͻ���ID';
COMMENT ON COLUMN "public"."mqtt_broker_msg"."user_name" IS '�û���(�豸token)';
COMMENT ON COLUMN "public"."mqtt_broker_msg"."msg" IS '��Ϣ';
COMMENT ON COLUMN "public"."mqtt_broker_msg"."topic" IS 'topic';
COMMENT ON COLUMN "public"."mqtt_broker_msg"."session_id" IS '������ϢsessionId';
COMMENT ON COLUMN "public"."mqtt_broker_msg"."creator" IS '������';
COMMENT ON COLUMN "public"."mqtt_broker_msg"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."mqtt_broker_msg"."updater" IS '������';
COMMENT ON COLUMN "public"."mqtt_broker_msg"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."mqtt_broker_msg" IS 'mqttBroker������־';

-- ----------------------------
-- Records of mqtt_broker_msg
-- ----------------------------

-- ----------------------------
-- Table structure for msg_cache
-- ----------------------------
DROP TABLE IF EXISTS "public"."msg_cache";
CREATE TABLE "public"."msg_cache" (
  "id" int8 NOT NULL,
  "cache_key" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "cache_key_type" varchar(255) COLLATE "pg_catalog"."default",
  "cache_value" varchar(255) COLLATE "pg_catalog"."default",
  "dept_id" int8,
  "tenant_code" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "company_id" int8
)
;
COMMENT ON COLUMN "public"."msg_cache"."cache_key" IS '�����';
COMMENT ON COLUMN "public"."msg_cache"."cache_key_type" IS '������ 0��token 1��ģ��';
COMMENT ON COLUMN "public"."msg_cache"."cache_value" IS '��������';
COMMENT ON COLUMN "public"."msg_cache"."dept_id" IS '����ID';
COMMENT ON COLUMN "public"."msg_cache"."tenant_code" IS '�⻧����';
COMMENT ON COLUMN "public"."msg_cache"."creator" IS '������';
COMMENT ON COLUMN "public"."msg_cache"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."msg_cache"."updater" IS '������';
COMMENT ON COLUMN "public"."msg_cache"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."msg_cache"."company_id" IS '��ҵid';
COMMENT ON TABLE "public"."msg_cache" IS '��Ϣ�����';

-- ----------------------------
-- Records of msg_cache
-- ----------------------------

-- ----------------------------
-- Table structure for msg_his
-- ----------------------------
DROP TABLE IF EXISTS "public"."msg_his";
CREATE TABLE "public"."msg_his" (
  "id" int8 NOT NULL,
  "publisher" varchar(100) COLLATE "pg_catalog"."default",
  "receiver" varchar(100) COLLATE "pg_catalog"."default",
  "his_msg" varchar(255) COLLATE "pg_catalog"."default",
  "push_config_id" varchar(100) COLLATE "pg_catalog"."default",
  "dept_id" int8,
  "tenant_code" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "publisher_code" varchar(100) COLLATE "pg_catalog"."default",
  "receiver_code" varchar(100) COLLATE "pg_catalog"."default",
  "company_id" int8,
  "status" varchar(5) COLLATE "pg_catalog"."default",
  "status_msg" varchar COLLATE "pg_catalog"."default",
  "push_setting_id" int8,
  "push_receive_status" varchar(5) COLLATE "pg_catalog"."default",
  "push_num" int8,
  "push_type" varchar(5) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."msg_his"."publisher" IS '���ͷ�';
COMMENT ON COLUMN "public"."msg_his"."receiver" IS '���շ�';
COMMENT ON COLUMN "public"."msg_his"."his_msg" IS '������ʷ��¼����';
COMMENT ON COLUMN "public"."msg_his"."push_config_id" IS '����������id';
COMMENT ON COLUMN "public"."msg_his"."dept_id" IS '����ID';
COMMENT ON COLUMN "public"."msg_his"."tenant_code" IS '�⻧����';
COMMENT ON COLUMN "public"."msg_his"."creator" IS '������';
COMMENT ON COLUMN "public"."msg_his"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."msg_his"."updater" IS '������';
COMMENT ON COLUMN "public"."msg_his"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."msg_his"."publisher_code" IS '���ͷ�����';
COMMENT ON COLUMN "public"."msg_his"."receiver_code" IS '���շ�����';
COMMENT ON COLUMN "public"."msg_his"."company_id" IS '��ҵid';
COMMENT ON COLUMN "public"."msg_his"."status" IS '����״̬(0-�ɹ���1-ʧ��)';
COMMENT ON COLUMN "public"."msg_his"."status_msg" IS '״̬��Ϣ';
COMMENT ON COLUMN "public"."msg_his"."push_setting_id" IS '��������id';
COMMENT ON COLUMN "public"."msg_his"."push_receive_status" IS '���ͽ���״̬0-�ѽ���1-δ����';
COMMENT ON COLUMN "public"."msg_his"."push_num" IS '���ʹ���';
COMMENT ON COLUMN "public"."msg_his"."push_type" IS '��������';
COMMENT ON TABLE "public"."msg_his" IS '��Ϣ��ʷ��';

-- ----------------------------
-- Records of msg_his
-- ----------------------------

-- ----------------------------
-- Table structure for msg_push
-- ----------------------------
DROP TABLE IF EXISTS "public"."msg_push";
CREATE TABLE "public"."msg_push" (
  "id" int8 NOT NULL,
  "config_name" varchar(50) COLLATE "pg_catalog"."default",
  "config_type" varchar(5) COLLATE "pg_catalog"."default",
  "template_msg" varchar(255) COLLATE "pg_catalog"."default",
  "template_id" int8,
  "config_params" text COLLATE "pg_catalog"."default",
  "dept_id" int8,
  "tenant_code" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "execute_by_job" varchar(5) COLLATE "pg_catalog"."default",
  "company_id" int8
)
;
COMMENT ON COLUMN "public"."msg_push"."id" IS '����';
COMMENT ON COLUMN "public"."msg_push"."config_name" IS '������';
COMMENT ON COLUMN "public"."msg_push"."config_type" IS '��������';
COMMENT ON COLUMN "public"."msg_push"."template_msg" IS '��Ϣ����';
COMMENT ON COLUMN "public"."msg_push"."template_id" IS 'ģ��id';
COMMENT ON COLUMN "public"."msg_push"."config_params" IS '���ò���';
COMMENT ON COLUMN "public"."msg_push"."dept_id" IS '����ID';
COMMENT ON COLUMN "public"."msg_push"."tenant_code" IS '�⻧����';
COMMENT ON COLUMN "public"."msg_push"."creator" IS '������';
COMMENT ON COLUMN "public"."msg_push"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."msg_push"."updater" IS '������';
COMMENT ON COLUMN "public"."msg_push"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."msg_push"."execute_by_job" IS '�Ƿ��ɶ�ʱ����ִ�� 0:�� 1:��';
COMMENT ON COLUMN "public"."msg_push"."company_id" IS '��ҵid';
COMMENT ON TABLE "public"."msg_push" IS '��Ϣ����';

-- ----------------------------
-- Records of msg_push
-- ----------------------------

-- ----------------------------
-- Table structure for msg_push_setting
-- ----------------------------
DROP TABLE IF EXISTS "public"."msg_push_setting";
CREATE TABLE "public"."msg_push_setting" (
  "id" int8 NOT NULL,
  "push_ids" varchar(255) COLLATE "pg_catalog"."default",
  "template_id" int8,
  "receivers" varchar(255) COLLATE "pg_catalog"."default",
  "repeat_push" varchar(255) COLLATE "pg_catalog"."default",
  "interval_push" varchar(255) COLLATE "pg_catalog"."default",
  "interval_frequency" varchar(10) COLLATE "pg_catalog"."default",
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" timestamp(6),
  "updater" int8,
  "update_date" timestamp(6),
  "name" varchar(255) COLLATE "pg_catalog"."default",
  "remark" varchar(255) COLLATE "pg_catalog"."default",
  "repeat_frequency" varchar(10) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."msg_push_setting"."id" IS '����';
COMMENT ON COLUMN "public"."msg_push_setting"."push_ids" IS '����ids';
COMMENT ON COLUMN "public"."msg_push_setting"."template_id" IS 'ģ��id';
COMMENT ON COLUMN "public"."msg_push_setting"."receivers" IS '�����˼���';
COMMENT ON COLUMN "public"."msg_push_setting"."repeat_push" IS '�ظ����ͣ�0-������1-�ر�';
COMMENT ON COLUMN "public"."msg_push_setting"."interval_push" IS '������ͣ�0-������1-�ر�';
COMMENT ON COLUMN "public"."msg_push_setting"."interval_frequency" IS '�������Ƶ��';
COMMENT ON COLUMN "public"."msg_push_setting"."tenant_code" IS '�⻧����';
COMMENT ON COLUMN "public"."msg_push_setting"."company_id" IS '��ҵ����id';
COMMENT ON COLUMN "public"."msg_push_setting"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."msg_push_setting"."creator" IS '������';
COMMENT ON COLUMN "public"."msg_push_setting"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."msg_push_setting"."updater" IS '������';
COMMENT ON COLUMN "public"."msg_push_setting"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."msg_push_setting"."name" IS '������������';
COMMENT ON COLUMN "public"."msg_push_setting"."remark" IS '��ע';
COMMENT ON COLUMN "public"."msg_push_setting"."repeat_frequency" IS '�ظ�����Ƶ��';
COMMENT ON TABLE "public"."msg_push_setting" IS '��Ϣ��������';

-- ----------------------------
-- Records of msg_push_setting
-- ----------------------------

-- ----------------------------
-- Table structure for msg_template
-- ----------------------------
DROP TABLE IF EXISTS "public"."msg_template";
CREATE TABLE "public"."msg_template" (
  "id" int8 NOT NULL,
  "name" varchar(100) COLLATE "pg_catalog"."default",
  "type" varchar(5) COLLATE "pg_catalog"."default",
  "subject" varchar(100) COLLATE "pg_catalog"."default",
  "content" text COLLATE "pg_catalog"."default",
  "dept_id" int8,
  "tenant_code" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "company_id" int8
)
;
COMMENT ON COLUMN "public"."msg_template"."name" IS 'ģ������';
COMMENT ON COLUMN "public"."msg_template"."type" IS 'ģ�����ͣ���ʱ��֧�����䣩 1������ģ��';
COMMENT ON COLUMN "public"."msg_template"."subject" IS 'ģ������';
COMMENT ON COLUMN "public"."msg_template"."content" IS '��Ϣ��������';
COMMENT ON COLUMN "public"."msg_template"."dept_id" IS '����ID';
COMMENT ON COLUMN "public"."msg_template"."tenant_code" IS '�⻧����';
COMMENT ON COLUMN "public"."msg_template"."creator" IS '������';
COMMENT ON COLUMN "public"."msg_template"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."msg_template"."updater" IS '������';
COMMENT ON COLUMN "public"."msg_template"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."msg_template"."company_id" IS '��ҵid';
COMMENT ON TABLE "public"."msg_template" IS '��Ϣģ��';

-- ----------------------------
-- Records of msg_template
-- ----------------------------

-- ----------------------------
-- Table structure for msg_user
-- ----------------------------
DROP TABLE IF EXISTS "public"."msg_user";
CREATE TABLE "public"."msg_user" (
  "id" int8 NOT NULL,
  "user_id" int8,
  "email_username" varchar(255) COLLATE "pg_catalog"."default",
  "wx_open_id" varchar(255) COLLATE "pg_catalog"."default",
  "dingding_phone" varchar(255) COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "wx_phone" varchar(255) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."msg_user"."id" IS 'id';
COMMENT ON COLUMN "public"."msg_user"."user_id" IS '�û�id';
COMMENT ON COLUMN "public"."msg_user"."email_username" IS '�����û���';
COMMENT ON COLUMN "public"."msg_user"."wx_open_id" IS '΢��openId';
COMMENT ON COLUMN "public"."msg_user"."dingding_phone" IS '�����绰';
COMMENT ON COLUMN "public"."msg_user"."creator" IS '������';
COMMENT ON COLUMN "public"."msg_user"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."msg_user"."updater" IS '������';
COMMENT ON COLUMN "public"."msg_user"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."msg_user"."wx_phone" IS '΢�ŵ绰';
COMMENT ON TABLE "public"."msg_user" IS '��Ϣ�û���Ϣ';

-- ----------------------------
-- Records of msg_user
-- ----------------------------

-- ----------------------------
-- Table structure for qrtz_blob_triggers
-- ----------------------------
DROP TABLE IF EXISTS "public"."qrtz_blob_triggers";
CREATE TABLE "public"."qrtz_blob_triggers" (
  "sched_name" varchar(120) COLLATE "pg_catalog"."default" NOT NULL,
  "trigger_name" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "trigger_group" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "blob_data" bytea
)
;

-- ----------------------------
-- Records of qrtz_blob_triggers
-- ----------------------------

-- ----------------------------
-- Table structure for qrtz_calendars
-- ----------------------------
DROP TABLE IF EXISTS "public"."qrtz_calendars";
CREATE TABLE "public"."qrtz_calendars" (
  "sched_name" varchar(120) COLLATE "pg_catalog"."default" NOT NULL,
  "calendar_name" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "calendar" bytea NOT NULL
)
;

-- ----------------------------
-- Records of qrtz_calendars
-- ----------------------------

-- ----------------------------
-- Table structure for qrtz_cron_triggers
-- ----------------------------
DROP TABLE IF EXISTS "public"."qrtz_cron_triggers";
CREATE TABLE "public"."qrtz_cron_triggers" (
  "sched_name" varchar(120) COLLATE "pg_catalog"."default" NOT NULL,
  "trigger_name" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "trigger_group" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "cron_expression" varchar(120) COLLATE "pg_catalog"."default" NOT NULL,
  "time_zone_id" varchar(80) COLLATE "pg_catalog"."default"
)
;-- ----------------------------
-- Table structure for qrtz_fired_triggers
-- ----------------------------
DROP TABLE IF EXISTS "public"."qrtz_fired_triggers";
CREATE TABLE "public"."qrtz_fired_triggers" (
  "sched_name" varchar(120) COLLATE "pg_catalog"."default" NOT NULL,
  "entry_id" varchar(95) COLLATE "pg_catalog"."default" NOT NULL,
  "trigger_name" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "trigger_group" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "instance_name" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "fired_time" int8 NOT NULL,
  "sched_time" int8 NOT NULL,
  "priority" int4 NOT NULL,
  "state" varchar(16) COLLATE "pg_catalog"."default" NOT NULL,
  "job_name" varchar(200) COLLATE "pg_catalog"."default",
  "job_group" varchar(200) COLLATE "pg_catalog"."default",
  "is_nonconcurrent" bool,
  "requests_recovery" bool
)
;

-- ----------------------------
-- Records of qrtz_fired_triggers
-- ----------------------------

-- ----------------------------
-- Table structure for qrtz_job_details
-- ----------------------------
DROP TABLE IF EXISTS "public"."qrtz_job_details";
CREATE TABLE "public"."qrtz_job_details" (
  "sched_name" varchar(120) COLLATE "pg_catalog"."default" NOT NULL,
  "job_name" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "job_group" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "description" varchar(250) COLLATE "pg_catalog"."default",
  "job_class_name" varchar(250) COLLATE "pg_catalog"."default" NOT NULL,
  "is_durable" bool NOT NULL,
  "is_nonconcurrent" bool NOT NULL,
  "is_update_data" bool NOT NULL,
  "requests_recovery" bool NOT NULL,
  "job_data" bytea
)
;
-- ----------------------------
-- Table structure for qrtz_locks
-- ----------------------------
DROP TABLE IF EXISTS "public"."qrtz_locks";
CREATE TABLE "public"."qrtz_locks" (
  "sched_name" varchar(120) COLLATE "pg_catalog"."default" NOT NULL,
  "lock_name" varchar(40) COLLATE "pg_catalog"."default" NOT NULL
)
;
-- ----------------------------
-- Table structure for qrtz_paused_trigger_grps
-- ----------------------------
DROP TABLE IF EXISTS "public"."qrtz_paused_trigger_grps";
CREATE TABLE "public"."qrtz_paused_trigger_grps" (
  "sched_name" varchar(120) COLLATE "pg_catalog"."default" NOT NULL,
  "trigger_group" varchar(200) COLLATE "pg_catalog"."default" NOT NULL
)
;

-- ----------------------------
-- Records of qrtz_paused_trigger_grps
-- ----------------------------

-- ----------------------------
-- Table structure for qrtz_scheduler_state
-- ----------------------------
DROP TABLE IF EXISTS "public"."qrtz_scheduler_state";
CREATE TABLE "public"."qrtz_scheduler_state" (
  "sched_name" varchar(120) COLLATE "pg_catalog"."default" NOT NULL,
  "instance_name" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "last_checkin_time" int8 NOT NULL,
  "checkin_interval" int8 NOT NULL
)
;

-- ----------------------------
-- Table structure for qrtz_simple_triggers
-- ----------------------------
DROP TABLE IF EXISTS "public"."qrtz_simple_triggers";
CREATE TABLE "public"."qrtz_simple_triggers" (
  "sched_name" varchar(120) COLLATE "pg_catalog"."default" NOT NULL,
  "trigger_name" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "trigger_group" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "repeat_count" int8 NOT NULL,
  "repeat_interval" int8 NOT NULL,
  "times_triggered" int8 NOT NULL
)
;

-- ----------------------------
-- Records of qrtz_simple_triggers
-- ----------------------------

-- ----------------------------
-- Table structure for qrtz_simprop_triggers
-- ----------------------------
DROP TABLE IF EXISTS "public"."qrtz_simprop_triggers";
CREATE TABLE "public"."qrtz_simprop_triggers" (
  "sched_name" varchar(120) COLLATE "pg_catalog"."default" NOT NULL,
  "trigger_name" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "trigger_group" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "str_prop_1" varchar(512) COLLATE "pg_catalog"."default",
  "str_prop_2" varchar(512) COLLATE "pg_catalog"."default",
  "str_prop_3" varchar(512) COLLATE "pg_catalog"."default",
  "int_prop_1" int4,
  "int_prop_2" int4,
  "long_prop_1" int8,
  "long_prop_2" int8,
  "dec_prop_1" numeric(13,4),
  "dec_prop_2" numeric(13,4),
  "bool_prop_1" bool,
  "bool_prop_2" bool
)
;

-- ----------------------------
-- Records of qrtz_simprop_triggers
-- ----------------------------

-- ----------------------------
-- Table structure for qrtz_triggers
-- ----------------------------
DROP TABLE IF EXISTS "public"."qrtz_triggers";
CREATE TABLE "public"."qrtz_triggers" (
  "sched_name" varchar(120) COLLATE "pg_catalog"."default" NOT NULL,
  "trigger_name" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "trigger_group" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "job_name" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "job_group" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "description" varchar(250) COLLATE "pg_catalog"."default",
  "next_fire_time" int8,
  "prev_fire_time" int8,
  "priority" int4,
  "trigger_state" varchar(16) COLLATE "pg_catalog"."default" NOT NULL,
  "trigger_type" varchar(8) COLLATE "pg_catalog"."default" NOT NULL,
  "start_time" int8 NOT NULL,
  "end_time" int8,
  "calendar_name" varchar(200) COLLATE "pg_catalog"."default",
  "misfire_instr" int2,
  "job_data" bytea
)
;

-- ----------------------------
-- Table structure for queue_log
-- ----------------------------
DROP TABLE IF EXISTS "public"."queue_log";
CREATE TABLE "public"."queue_log" (
  "id" int8 NOT NULL,
  "time" timestamp(6),
  "queue_num" varchar(25) COLLATE "pg_catalog"."default",
  "enter_num" varchar(25) COLLATE "pg_catalog"."default",
  "poll_num" varchar(25) COLLATE "pg_catalog"."default",
  "channel_num" varchar(25) COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" timestamp(6),
  "updater" int8,
  "update_date" timestamp(6)
)
;
COMMENT ON COLUMN "public"."queue_log"."id" IS '����';
COMMENT ON COLUMN "public"."queue_log"."time" IS 'ʱ��';
COMMENT ON COLUMN "public"."queue_log"."queue_num" IS '������Ϣ��';
COMMENT ON COLUMN "public"."queue_log"."enter_num" IS '������Ϣ��';
COMMENT ON COLUMN "public"."queue_log"."poll_num" IS '������Ϣ��';
COMMENT ON COLUMN "public"."queue_log"."channel_num" IS 'ͨ����';
COMMENT ON COLUMN "public"."queue_log"."creator" IS '������';
COMMENT ON COLUMN "public"."queue_log"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."queue_log"."updater" IS '������';
COMMENT ON COLUMN "public"."queue_log"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."queue_log" IS '������Ϣ������־';

-- ----------------------------
-- Records of queue_log
-- ----------------------------

-- ----------------------------
-- Table structure for queue_msg_log
-- ----------------------------
DROP TABLE IF EXISTS "public"."queue_msg_log";
CREATE TABLE "public"."queue_msg_log" (
  "id" int8 NOT NULL,
  "channel_name" varchar(30) COLLATE "pg_catalog"."default",
  "msg" varchar COLLATE "pg_catalog"."default",
  "time" int8,
  "creator" int8,
  "create_date" timestamp(6),
  "updater" int8,
  "update_date" timestamp(6)
)
;
COMMENT ON COLUMN "public"."queue_msg_log"."channel_name" IS '����ͨ��';
COMMENT ON COLUMN "public"."queue_msg_log"."msg" IS '��Ϣ��';
COMMENT ON COLUMN "public"."queue_msg_log"."time" IS 'ʱ��';
COMMENT ON COLUMN "public"."queue_msg_log"."creator" IS '������';
COMMENT ON COLUMN "public"."queue_msg_log"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."queue_msg_log"."updater" IS '������';
COMMENT ON COLUMN "public"."queue_msg_log"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."queue_msg_log" IS '������Ϣ��־';

-- ----------------------------
-- Records of queue_msg_log
-- ----------------------------

-- ----------------------------
-- Table structure for schedule_job
-- ----------------------------
DROP TABLE IF EXISTS "public"."schedule_job";
CREATE TABLE "public"."schedule_job" (
  "id" int8 NOT NULL,
  "bean_name" varchar(200) COLLATE "pg_catalog"."default",
  "params" varchar(2000) COLLATE "pg_catalog"."default",
  "cron_expression" varchar(100) COLLATE "pg_catalog"."default",
  "status" int4,
  "remark" varchar(255) COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."schedule_job"."id" IS 'id';
COMMENT ON COLUMN "public"."schedule_job"."bean_name" IS 'spring bean����';
COMMENT ON COLUMN "public"."schedule_job"."params" IS '����';
COMMENT ON COLUMN "public"."schedule_job"."cron_expression" IS 'cron���ʽ';
COMMENT ON COLUMN "public"."schedule_job"."status" IS '����״̬  0����ͣ  1������';
COMMENT ON COLUMN "public"."schedule_job"."remark" IS '��ע';
COMMENT ON COLUMN "public"."schedule_job"."creator" IS '������';
COMMENT ON COLUMN "public"."schedule_job"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."schedule_job"."updater" IS '������';
COMMENT ON COLUMN "public"."schedule_job"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."schedule_job" IS '��ʱ����';

-- ----------------------------
-- Records of schedule_job
-- ----------------------------

-- ----------------------------
-- Table structure for schedule_job_log
-- ----------------------------
DROP TABLE IF EXISTS "public"."schedule_job_log";
CREATE TABLE "public"."schedule_job_log" (
  "id" int8 NOT NULL,
  "job_id" int8 NOT NULL,
  "bean_name" varchar(200) COLLATE "pg_catalog"."default",
  "params" varchar(2000) COLLATE "pg_catalog"."default",
  "status" int4,
  "error" varchar(10000) COLLATE "pg_catalog"."default",
  "times" int4,
  "create_date" timestamp(6),
  "ip" varchar(50) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."schedule_job_log"."id" IS 'id';
COMMENT ON COLUMN "public"."schedule_job_log"."bean_name" IS 'spring bean����';
COMMENT ON COLUMN "public"."schedule_job_log"."params" IS '����';
COMMENT ON COLUMN "public"."schedule_job_log"."status" IS '����״̬  0��ʧ��    1���ɹ�';
COMMENT ON COLUMN "public"."schedule_job_log"."error" IS 'ʧ����Ϣ';
COMMENT ON COLUMN "public"."schedule_job_log"."times" IS '��ʱ(��λ������)';
COMMENT ON COLUMN "public"."schedule_job_log"."ip" IS 'ip��ַ';
COMMENT ON TABLE "public"."schedule_job_log" IS '��ʱ������־';

-- ----------------------------
-- Table structure for script_info
-- ----------------------------
DROP TABLE IF EXISTS "public"."script_info";
CREATE TABLE "public"."script_info" (
  "id" int8 NOT NULL,
  "name" varchar(255) COLLATE "pg_catalog"."default",
  "script_type" varchar(25) COLLATE "pg_catalog"."default",
  "script_body" varchar COLLATE "pg_catalog"."default",
  "sup_msg" varchar(5000) COLLATE "pg_catalog"."default",
  "query_msg" varchar(5000) COLLATE "pg_catalog"."default",
  "debug" bool,
  "remark" varchar(500) COLLATE "pg_catalog"."default",
  "extend_data" varchar(5000) COLLATE "pg_catalog"."default",
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."script_info"."name" IS '����';
COMMENT ON COLUMN "public"."script_info"."script_type" IS '�﷨����';
COMMENT ON COLUMN "public"."script_info"."script_body" IS '������';
COMMENT ON COLUMN "public"."script_info"."sup_msg" IS '��������';
COMMENT ON COLUMN "public"."script_info"."query_msg" IS '��ѯ����';
COMMENT ON COLUMN "public"."script_info"."debug" IS '����';
COMMENT ON COLUMN "public"."script_info"."remark" IS '����';
COMMENT ON COLUMN "public"."script_info"."extend_data" IS '��չ�ֶ�';
COMMENT ON COLUMN "public"."script_info"."tenant_code" IS '������ҵ(�⻧code)';
COMMENT ON COLUMN "public"."script_info"."company_id" IS '��ҵ����id';
COMMENT ON COLUMN "public"."script_info"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."script_info"."creator" IS '������';
COMMENT ON COLUMN "public"."script_info"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."script_info"."updater" IS '������';
COMMENT ON COLUMN "public"."script_info"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."script_info" IS '���ݽ���';

-- ----------------------------
-- Records of script_info
-- ----------------------------

-- ----------------------------
-- Table structure for script_log
-- ----------------------------
DROP TABLE IF EXISTS "public"."script_log";
CREATE TABLE "public"."script_log" (
  "id" int8 NOT NULL,
  "script_id" int8,
  "msg" varchar COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."script_log"."script_id" IS '���ݽ�������';
COMMENT ON COLUMN "public"."script_log"."msg" IS '��Ϣ';
COMMENT ON COLUMN "public"."script_log"."creator" IS '������';
COMMENT ON COLUMN "public"."script_log"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."script_log"."updater" IS '������';
COMMENT ON COLUMN "public"."script_log"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."script_log" IS '���ݽ�����־';

-- ----------------------------
-- Records of script_log
-- ----------------------------

-- ----------------------------
-- Table structure for sys_dept
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_dept";
CREATE TABLE "public"."sys_dept" (
  "id" int8 NOT NULL,
  "pid" int8,
  "pids" varchar(500) COLLATE "pg_catalog"."default",
  "name" varchar(50) COLLATE "pg_catalog"."default",
  "sort" int4,
  "tenant_code" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."sys_dept"."id" IS 'id';
COMMENT ON COLUMN "public"."sys_dept"."pid" IS '�ϼ�ID';
COMMENT ON COLUMN "public"."sys_dept"."pids" IS '�����ϼ�ID���ö��ŷֿ�';
COMMENT ON COLUMN "public"."sys_dept"."name" IS '��������';
COMMENT ON COLUMN "public"."sys_dept"."sort" IS '����';
COMMENT ON COLUMN "public"."sys_dept"."tenant_code" IS '�⻧����';
COMMENT ON COLUMN "public"."sys_dept"."creator" IS '������';
COMMENT ON COLUMN "public"."sys_dept"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."sys_dept"."updater" IS '������';
COMMENT ON COLUMN "public"."sys_dept"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."sys_dept" IS '���Ź���';

-- ----------------------------
-- Table structure for sys_dict_data
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_dict_data";
CREATE TABLE "public"."sys_dict_data" (
  "id" int8 NOT NULL,
  "dict_type_id" int8 NOT NULL,
  "dict_label" varchar(255) COLLATE "pg_catalog"."default",
  "dict_value" varchar(255) COLLATE "pg_catalog"."default",
  "remark" varchar(255) COLLATE "pg_catalog"."default",
  "sort" int4,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."sys_dict_data"."id" IS 'id';
COMMENT ON COLUMN "public"."sys_dict_data"."dict_type_id" IS '�ֵ�����ID';
COMMENT ON COLUMN "public"."sys_dict_data"."dict_label" IS '�ֵ��ǩ';
COMMENT ON COLUMN "public"."sys_dict_data"."dict_value" IS '�ֵ�ֵ';
COMMENT ON COLUMN "public"."sys_dict_data"."remark" IS '��ע';
COMMENT ON COLUMN "public"."sys_dict_data"."sort" IS '����';
COMMENT ON COLUMN "public"."sys_dict_data"."creator" IS '������';
COMMENT ON COLUMN "public"."sys_dict_data"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."sys_dict_data"."updater" IS '������';
COMMENT ON COLUMN "public"."sys_dict_data"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."sys_dict_data" IS '�ֵ�����';

-- ----------------------------
-- Table structure for sys_dict_type
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_dict_type";
CREATE TABLE "public"."sys_dict_type" (
  "id" int8 NOT NULL,
  "dict_type" varchar(100) COLLATE "pg_catalog"."default",
  "dict_name" varchar(255) COLLATE "pg_catalog"."default",
  "remark" varchar(255) COLLATE "pg_catalog"."default",
  "sort" int4,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."sys_dict_type"."id" IS 'id';
COMMENT ON COLUMN "public"."sys_dict_type"."dict_type" IS '�ֵ�����';
COMMENT ON COLUMN "public"."sys_dict_type"."dict_name" IS '�ֵ�����';
COMMENT ON COLUMN "public"."sys_dict_type"."remark" IS '��ע';
COMMENT ON COLUMN "public"."sys_dict_type"."sort" IS '����';
COMMENT ON COLUMN "public"."sys_dict_type"."creator" IS '������';
COMMENT ON COLUMN "public"."sys_dict_type"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."sys_dict_type"."updater" IS '������';
COMMENT ON COLUMN "public"."sys_dict_type"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."sys_dict_type" IS '�ֵ�����';

-- ----------------------------
-- Table structure for sys_energy_check
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_energy_check";
CREATE TABLE "public"."sys_energy_check" (
  "id" int8 NOT NULL,
  "location" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "dept_name" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "check_time" date NOT NULL,
  "check_people" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "problem" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "requirement" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "image_url" varchar(255) COLLATE "pg_catalog"."default",
  "status" varchar(255) COLLATE "pg_catalog"."default" NOT NULL DEFAULT 0,
  "change_time" date,
  "creator" int8,
  "create_date" timestamp(6),
  "tenant_code" int8,
  "device_name" varchar(255) COLLATE "pg_catalog"."default",
  "remarks" varchar(255) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."sys_energy_check"."id" IS 'id';
COMMENT ON COLUMN "public"."sys_energy_check"."location" IS '�豸λ��';
COMMENT ON COLUMN "public"."sys_energy_check"."dept_name" IS '���β���';
COMMENT ON COLUMN "public"."sys_energy_check"."check_time" IS '���ʱ��';
COMMENT ON COLUMN "public"."sys_energy_check"."check_people" IS '�����Ա';
COMMENT ON COLUMN "public"."sys_energy_check"."problem" IS '��������';
COMMENT ON COLUMN "public"."sys_energy_check"."requirement" IS '����Ҫ��';
COMMENT ON COLUMN "public"."sys_energy_check"."image_url" IS 'ͼƬ��ַ';
COMMENT ON COLUMN "public"."sys_energy_check"."status" IS '����״̬ 0�������� 1��������';
COMMENT ON COLUMN "public"."sys_energy_check"."change_time" IS '����ʱ��';
COMMENT ON COLUMN "public"."sys_energy_check"."creator" IS '������';
COMMENT ON COLUMN "public"."sys_energy_check"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."sys_energy_check"."tenant_code" IS '�⻧����';
COMMENT ON COLUMN "public"."sys_energy_check"."device_name" IS '�豸����';
COMMENT ON COLUMN "public"."sys_energy_check"."remarks" IS '��ע';
COMMENT ON TABLE "public"."sys_energy_check" IS '��Դ���';

-- ----------------------------
-- Records of sys_energy_check
-- ----------------------------

-- ----------------------------
-- Table structure for sys_energy_people
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_energy_people";
CREATE TABLE "public"."sys_energy_people" (
  "id" int8 NOT NULL,
  "username" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "realname" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "dept_name" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "user_id" int8 NOT NULL,
  "email" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "tenant_code" int8,
  "creator" int8,
  "create_date" timestamp(6)
)
;
COMMENT ON COLUMN "public"."sys_energy_people"."id" IS '��Ŀid';
COMMENT ON COLUMN "public"."sys_energy_people"."username" IS '�û���';
COMMENT ON COLUMN "public"."sys_energy_people"."realname" IS '����';
COMMENT ON COLUMN "public"."sys_energy_people"."dept_name" IS '��������';
COMMENT ON COLUMN "public"."sys_energy_people"."user_id" IS '�û�id';
COMMENT ON COLUMN "public"."sys_energy_people"."email" IS '����';
COMMENT ON COLUMN "public"."sys_energy_people"."tenant_code" IS '�⻧����';
COMMENT ON COLUMN "public"."sys_energy_people"."creator" IS '������';
COMMENT ON COLUMN "public"."sys_energy_people"."create_date" IS '����ʱ��';
COMMENT ON TABLE "public"."sys_energy_people" IS '������Ŀ-�û�����';

-- ----------------------------
-- Records of sys_energy_people
-- ----------------------------

-- ----------------------------
-- Table structure for sys_energy_project
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_energy_project";
CREATE TABLE "public"."sys_energy_project" (
  "id" int8 NOT NULL,
  "project_name" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "department" varchar(125) COLLATE "pg_catalog"."default" NOT NULL,
  "people" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "save_energy" numeric(15,2) NOT NULL,
  "save_cost" numeric(15,2) NOT NULL,
  "implement_time" date NOT NULL,
  "detail" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "status" varchar(32) COLLATE "pg_catalog"."default" DEFAULT 0,
  "remark" varchar(32) COLLATE "pg_catalog"."default",
  "tenant_code" int8,
  "creator" int8,
  "create_date" timestamp(6)
)
;
COMMENT ON COLUMN "public"."sys_energy_project"."id" IS 'id';
COMMENT ON COLUMN "public"."sys_energy_project"."project_name" IS '��Ŀ����';
COMMENT ON COLUMN "public"."sys_energy_project"."department" IS '����';
COMMENT ON COLUMN "public"."sys_energy_project"."people" IS 'ʵʩ��';
COMMENT ON COLUMN "public"."sys_energy_project"."save_energy" IS '������';
COMMENT ON COLUMN "public"."sys_energy_project"."save_cost" IS '��Լ����';
COMMENT ON COLUMN "public"."sys_energy_project"."implement_time" IS 'ʵʩʱ��';
COMMENT ON COLUMN "public"."sys_energy_project"."detail" IS '����';
COMMENT ON COLUMN "public"."sys_energy_project"."status" IS '���״̬ 0:����� 1������� 2:δͨ��';
COMMENT ON COLUMN "public"."sys_energy_project"."remark" IS '���δͨ����ע';
COMMENT ON COLUMN "public"."sys_energy_project"."tenant_code" IS '�⻧����';
COMMENT ON COLUMN "public"."sys_energy_project"."creator" IS '������';
COMMENT ON COLUMN "public"."sys_energy_project"."create_date" IS '����ʱ��';
COMMENT ON TABLE "public"."sys_energy_project" IS '������Ŀ';

-- ----------------------------
-- Records of sys_energy_project
-- ----------------------------

-- ----------------------------
-- Table structure for sys_industry_type
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_industry_type";
CREATE TABLE "public"."sys_industry_type" (
  "id" int8 NOT NULL,
  "code" varchar(20) COLLATE "pg_catalog"."default",
  "parent_code" varchar(20) COLLATE "pg_catalog"."default",
  "name" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "full_name" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "jgzh" bool,
  "tenant_code" int8 NOT NULL,
  "dept_id" int8 NOT NULL,
  "delete_status" int2 NOT NULL DEFAULT 0
)
;
COMMENT ON COLUMN "public"."sys_industry_type"."id" IS 'id';
COMMENT ON COLUMN "public"."sys_industry_type"."code" IS '����';
COMMENT ON COLUMN "public"."sys_industry_type"."parent_code" IS '���ڱ���';
COMMENT ON COLUMN "public"."sys_industry_type"."name" IS '��ҵ����';
COMMENT ON COLUMN "public"."sys_industry_type"."full_name" IS '��ҵȫ��';
COMMENT ON COLUMN "public"."sys_industry_type"."jgzh" IS '�Ƿ���Դ�ӹ�ת������ҵ';
COMMENT ON COLUMN "public"."sys_industry_type"."tenant_code" IS '�⻧����';
COMMENT ON COLUMN "public"."sys_industry_type"."dept_id" IS '��ҵID';
COMMENT ON COLUMN "public"."sys_industry_type"."delete_status" IS 'ɾ��״̬ 0δɾ�� 1ɾ��';
COMMENT ON TABLE "public"."sys_industry_type" IS '��ҵ����';

-- ----------------------------
-- Table structure for sys_language
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_language";
CREATE TABLE "public"."sys_language" (
  "table_name" varchar(32) COLLATE "pg_catalog"."default" NOT NULL,
  "table_id" int8 NOT NULL,
  "field_name" varchar(32) COLLATE "pg_catalog"."default" NOT NULL,
  "field_value" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "language" varchar(10) COLLATE "pg_catalog"."default" NOT NULL
)
;
COMMENT ON COLUMN "public"."sys_language"."table_name" IS '����';
COMMENT ON COLUMN "public"."sys_language"."table_id" IS '������';
COMMENT ON COLUMN "public"."sys_language"."field_name" IS '�ֶ���';
COMMENT ON COLUMN "public"."sys_language"."field_value" IS '�ֶ�ֵ';
COMMENT ON COLUMN "public"."sys_language"."language" IS '����';
COMMENT ON TABLE "public"."sys_language" IS '���ʻ�';

-- ----------------------------
-- Table structure for sys_log_error
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_log_error";
CREATE TABLE "public"."sys_log_error" (
  "id" int8 NOT NULL,
  "request_uri" varchar(200) COLLATE "pg_catalog"."default",
  "request_method" varchar(20) COLLATE "pg_catalog"."default",
  "request_params" text COLLATE "pg_catalog"."default",
  "user_agent" varchar(500) COLLATE "pg_catalog"."default",
  "ip" varchar(32) COLLATE "pg_catalog"."default",
  "error_info" text COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" int8
)
;
COMMENT ON COLUMN "public"."sys_log_error"."id" IS 'id';
COMMENT ON COLUMN "public"."sys_log_error"."request_uri" IS '����URI';
COMMENT ON COLUMN "public"."sys_log_error"."request_method" IS '����ʽ';
COMMENT ON COLUMN "public"."sys_log_error"."request_params" IS '�������';
COMMENT ON COLUMN "public"."sys_log_error"."user_agent" IS '�û�����';
COMMENT ON COLUMN "public"."sys_log_error"."ip" IS '����IP';
COMMENT ON COLUMN "public"."sys_log_error"."error_info" IS '�쳣��Ϣ';
COMMENT ON COLUMN "public"."sys_log_error"."creator" IS '������';
COMMENT ON COLUMN "public"."sys_log_error"."create_date" IS '����ʱ��';
COMMENT ON TABLE "public"."sys_log_error" IS '�쳣��־';


-- ----------------------------
-- Table structure for sys_log_login
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_log_login";
CREATE TABLE "public"."sys_log_login" (
  "id" int8 NOT NULL,
  "operation" int4,
  "status" int4,
  "user_agent" varchar(500) COLLATE "pg_catalog"."default",
  "ip" varchar(32) COLLATE "pg_catalog"."default",
  "creator_name" varchar(50) COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" int8,
  "internal_ip" varchar(255) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."sys_log_login"."id" IS 'id';
COMMENT ON COLUMN "public"."sys_log_login"."operation" IS '�û�����   0���û���¼   1���û��˳�';
COMMENT ON COLUMN "public"."sys_log_login"."status" IS '״̬  0��ʧ��    1���ɹ�    2���˺�������';
COMMENT ON COLUMN "public"."sys_log_login"."user_agent" IS '�û�����';
COMMENT ON COLUMN "public"."sys_log_login"."ip" IS '����IP';
COMMENT ON COLUMN "public"."sys_log_login"."creator_name" IS '�û���';
COMMENT ON COLUMN "public"."sys_log_login"."creator" IS '������';
COMMENT ON COLUMN "public"."sys_log_login"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."sys_log_login"."internal_ip" IS '����ip';
COMMENT ON TABLE "public"."sys_log_login" IS '��¼��־';


-- ----------------------------
-- Table structure for sys_log_operation
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_log_operation";
CREATE TABLE "public"."sys_log_operation" (
  "id" int8 NOT NULL,
  "operation" varchar(50) COLLATE "pg_catalog"."default",
  "request_uri" varchar(200) COLLATE "pg_catalog"."default",
  "request_method" varchar(20) COLLATE "pg_catalog"."default",
  "request_params" text COLLATE "pg_catalog"."default",
  "request_time" int4,
  "user_agent" varchar(500) COLLATE "pg_catalog"."default",
  "ip" varchar(32) COLLATE "pg_catalog"."default",
  "status" int4,
  "creator_name" varchar(50) COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" int8,
  "internal_ip" varchar(255) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."sys_log_operation"."id" IS 'id';
COMMENT ON COLUMN "public"."sys_log_operation"."operation" IS '�û�����';
COMMENT ON COLUMN "public"."sys_log_operation"."request_uri" IS '����URI';
COMMENT ON COLUMN "public"."sys_log_operation"."request_method" IS '����ʽ';
COMMENT ON COLUMN "public"."sys_log_operation"."request_params" IS '�������';
COMMENT ON COLUMN "public"."sys_log_operation"."request_time" IS '����ʱ��(����)';
COMMENT ON COLUMN "public"."sys_log_operation"."user_agent" IS '�û�����';
COMMENT ON COLUMN "public"."sys_log_operation"."ip" IS '����IP';
COMMENT ON COLUMN "public"."sys_log_operation"."status" IS '״̬  0��ʧ��   1���ɹ�';
COMMENT ON COLUMN "public"."sys_log_operation"."creator_name" IS '�û���';
COMMENT ON COLUMN "public"."sys_log_operation"."creator" IS '������';
COMMENT ON COLUMN "public"."sys_log_operation"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."sys_log_operation"."internal_ip" IS '����ip';
COMMENT ON TABLE "public"."sys_log_operation" IS '������־';

-- ----------------------------
-- Table structure for sys_mail_log
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_mail_log";
CREATE TABLE "public"."sys_mail_log" (
  "id" int8 NOT NULL,
  "template_id" int8 NOT NULL,
  "mail_from" varchar(200) COLLATE "pg_catalog"."default",
  "mail_to" varchar(400) COLLATE "pg_catalog"."default",
  "mail_cc" varchar(400) COLLATE "pg_catalog"."default",
  "subject" varchar(200) COLLATE "pg_catalog"."default",
  "content" text COLLATE "pg_catalog"."default",
  "status" int4,
  "creator" int8,
  "create_date" int8
)
;
COMMENT ON COLUMN "public"."sys_mail_log"."id" IS 'id';
COMMENT ON COLUMN "public"."sys_mail_log"."template_id" IS '�ʼ�ģ��ID';
COMMENT ON COLUMN "public"."sys_mail_log"."mail_from" IS '������';
COMMENT ON COLUMN "public"."sys_mail_log"."mail_to" IS '�ռ���';
COMMENT ON COLUMN "public"."sys_mail_log"."mail_cc" IS '������';
COMMENT ON COLUMN "public"."sys_mail_log"."subject" IS '�ʼ�����';
COMMENT ON COLUMN "public"."sys_mail_log"."content" IS '�ʼ�����';
COMMENT ON COLUMN "public"."sys_mail_log"."status" IS '����״̬  0��ʧ��  1���ɹ�';
COMMENT ON COLUMN "public"."sys_mail_log"."creator" IS '������';
COMMENT ON COLUMN "public"."sys_mail_log"."create_date" IS '����ʱ��';
COMMENT ON TABLE "public"."sys_mail_log" IS '�ʼ����ͼ�¼';

-- ----------------------------
-- Records of sys_mail_log
-- ----------------------------

-- ----------------------------
-- Table structure for sys_mail_template
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_mail_template";
CREATE TABLE "public"."sys_mail_template" (
  "id" int8 NOT NULL,
  "name" varchar(100) COLLATE "pg_catalog"."default",
  "subject" varchar(200) COLLATE "pg_catalog"."default",
  "content" text COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."sys_mail_template"."id" IS 'id';
COMMENT ON COLUMN "public"."sys_mail_template"."name" IS 'ģ������';
COMMENT ON COLUMN "public"."sys_mail_template"."subject" IS '�ʼ�����';
COMMENT ON COLUMN "public"."sys_mail_template"."content" IS '�ʼ�����';
COMMENT ON COLUMN "public"."sys_mail_template"."creator" IS '������';
COMMENT ON COLUMN "public"."sys_mail_template"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."sys_mail_template"."updater" IS '������';
COMMENT ON COLUMN "public"."sys_mail_template"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."sys_mail_template" IS '�ʼ�ģ��';

-- ----------------------------
-- Records of sys_mail_template
-- ----------------------------

-- ----------------------------
-- Table structure for sys_menu
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_menu";
CREATE TABLE "public"."sys_menu" (
  "id" int8 NOT NULL,
  "pid" int8,
  "url" varchar(200) COLLATE "pg_catalog"."default",
  "permissions" varchar(500) COLLATE "pg_catalog"."default",
  "type" int4,
  "open_style" int4,
  "icon" varchar(50) COLLATE "pg_catalog"."default",
  "sort" int4,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "sa_view" int4,
  "description" varchar COLLATE "pg_catalog"."default",
  "model" varchar(4) COLLATE "pg_catalog"."default",
  "model_url" varchar(1024) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."sys_menu"."id" IS 'id';
COMMENT ON COLUMN "public"."sys_menu"."pid" IS '�ϼ�ID��һ���˵�Ϊ0';
COMMENT ON COLUMN "public"."sys_menu"."url" IS '�˵�URL';
COMMENT ON COLUMN "public"."sys_menu"."permissions" IS '��Ȩ(����ö��ŷָ����磺sys:user:list,sys:user:save)';
COMMENT ON COLUMN "public"."sys_menu"."type" IS '����   0���˵�   1����ť';
COMMENT ON COLUMN "public"."sys_menu"."open_style" IS '�򿪷�ʽ   0���ڲ�   1���ⲿ';
COMMENT ON COLUMN "public"."sys_menu"."icon" IS '�˵�ͼ��';
COMMENT ON COLUMN "public"."sys_menu"."sort" IS '����';
COMMENT ON COLUMN "public"."sys_menu"."creator" IS '������';
COMMENT ON COLUMN "public"."sys_menu"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."sys_menu"."updater" IS '������';
COMMENT ON COLUMN "public"."sys_menu"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."sys_menu"."sa_view" IS '�����Ƿ�ɼ�   0����   1����';
COMMENT ON COLUMN "public"."sys_menu"."description" IS '˵��';
COMMENT ON COLUMN "public"."sys_menu"."model" IS '����';
COMMENT ON COLUMN "public"."sys_menu"."model_url" IS '����ͼ��';
COMMENT ON TABLE "public"."sys_menu" IS '�˵�����';

-- ----------------------------
-- Table structure for sys_notice
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_notice";
CREATE TABLE "public"."sys_notice" (
  "id" int8 NOT NULL,
  "type" int4 NOT NULL,
  "title" varchar(200) COLLATE "pg_catalog"."default",
  "content" text COLLATE "pg_catalog"."default",
  "receiver_type" int4,
  "receiver_type_ids" varchar(500) COLLATE "pg_catalog"."default",
  "status" int4,
  "sender_name" varchar(50) COLLATE "pg_catalog"."default",
  "sender_date" timestamp(6),
  "creator" int8,
  "create_date" timestamp(6)
)
;
COMMENT ON COLUMN "public"."sys_notice"."id" IS 'id';
COMMENT ON COLUMN "public"."sys_notice"."type" IS '֪ͨ����';
COMMENT ON COLUMN "public"."sys_notice"."title" IS '����';
COMMENT ON COLUMN "public"."sys_notice"."content" IS '����';
COMMENT ON COLUMN "public"."sys_notice"."receiver_type" IS '������  0��ȫ��  1������';
COMMENT ON COLUMN "public"."sys_notice"."receiver_type_ids" IS '������ID���ö��ŷֿ�';
COMMENT ON COLUMN "public"."sys_notice"."status" IS '����״̬  0���ݸ�  1���ѷ���';
COMMENT ON COLUMN "public"."sys_notice"."sender_name" IS '������';
COMMENT ON COLUMN "public"."sys_notice"."sender_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."sys_notice"."creator" IS '������';
COMMENT ON COLUMN "public"."sys_notice"."create_date" IS '����ʱ��';
COMMENT ON TABLE "public"."sys_notice" IS '֪ͨ����';

-- ----------------------------
-- Records of sys_notice
-- ----------------------------

-- ----------------------------
-- Table structure for sys_notice_user
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_notice_user";
CREATE TABLE "public"."sys_notice_user" (
  "receiver_id" int8 NOT NULL,
  "notice_id" int8 NOT NULL,
  "read_status" int4 NOT NULL,
  "read_date" timestamp(6)
)
;
COMMENT ON COLUMN "public"."sys_notice_user"."receiver_id" IS '������ID';
COMMENT ON COLUMN "public"."sys_notice_user"."notice_id" IS '֪ͨID';
COMMENT ON COLUMN "public"."sys_notice_user"."read_status" IS '�Ķ�״̬  0��δ��  1���Ѷ�';
COMMENT ON COLUMN "public"."sys_notice_user"."read_date" IS '�Ķ�ʱ��';
COMMENT ON TABLE "public"."sys_notice_user" IS '�ҵ�֪ͨ';

-- ----------------------------
-- Records of sys_notice_user
-- ----------------------------

-- ----------------------------
-- Table structure for sys_oss
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_oss";
CREATE TABLE "public"."sys_oss" (
  "id" int8 NOT NULL,
  "url" varchar(200) COLLATE "pg_catalog"."default",
  "type" varchar(5) COLLATE "pg_catalog"."default",
  "single" bool,
  "creator" int8,
  "create_date" int8
)
;
COMMENT ON COLUMN "public"."sys_oss"."id" IS 'id';
COMMENT ON COLUMN "public"."sys_oss"."url" IS 'URL��ַ';
COMMENT ON COLUMN "public"."sys_oss"."type" IS '�ļ�����';
COMMENT ON COLUMN "public"."sys_oss"."single" IS '�Ƿ�Ψһ';
COMMENT ON TABLE "public"."sys_oss" IS '�ļ��ϴ�';

-- ----------------------------
-- Records of sys_oss
-- ----------------------------

-- ----------------------------
-- Table structure for sys_params
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_params";
CREATE TABLE "public"."sys_params" (
  "id" int8 NOT NULL,
  "param_code" varchar(32) COLLATE "pg_catalog"."default",
  "param_value" varchar(2000) COLLATE "pg_catalog"."default",
  "param_type" int4 NOT NULL DEFAULT 1,
  "remark" varchar(200) COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."sys_params"."param_code" IS '��������';
COMMENT ON COLUMN "public"."sys_params"."param_value" IS '����ֵ';
COMMENT ON COLUMN "public"."sys_params"."param_type" IS '����   0��ϵͳ����   1����ϵͳ����';
COMMENT ON COLUMN "public"."sys_params"."remark" IS '��ע';
COMMENT ON COLUMN "public"."sys_params"."creator" IS '������';
COMMENT ON COLUMN "public"."sys_params"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."sys_params"."updater" IS '������';
COMMENT ON COLUMN "public"."sys_params"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."sys_params" IS '��������';

-- ----------------------------
-- Table structure for sys_post
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_post";
CREATE TABLE "public"."sys_post" (
  "id" int8 NOT NULL,
  "post_code" varchar(100) COLLATE "pg_catalog"."default",
  "post_name" varchar(100) COLLATE "pg_catalog"."default",
  "sort" int4,
  "status" int4,
  "tenant_code" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."sys_post"."id" IS 'id';
COMMENT ON COLUMN "public"."sys_post"."post_code" IS '��λ����';
COMMENT ON COLUMN "public"."sys_post"."post_name" IS '��λ����';
COMMENT ON COLUMN "public"."sys_post"."sort" IS '����';
COMMENT ON COLUMN "public"."sys_post"."status" IS '״̬  0��ͣ��   1������';
COMMENT ON COLUMN "public"."sys_post"."tenant_code" IS '�⻧����';
COMMENT ON COLUMN "public"."sys_post"."creator" IS '������';
COMMENT ON COLUMN "public"."sys_post"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."sys_post"."updater" IS '������';
COMMENT ON COLUMN "public"."sys_post"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."sys_post" IS '��λ����';

-- ----------------------------
-- Records of sys_post
-- ----------------------------

-- ----------------------------
-- Table structure for sys_region
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_region";
CREATE TABLE "public"."sys_region" (
  "id" int8 NOT NULL,
  "pid" int8,
  "name" varchar(100) COLLATE "pg_catalog"."default",
  "tree_level" int4,
  "leaf" int4,
  "sort" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."sys_region"."pid" IS '�ϼ�ID';
COMMENT ON COLUMN "public"."sys_region"."name" IS '����';
COMMENT ON COLUMN "public"."sys_region"."tree_level" IS '�㼶';
COMMENT ON COLUMN "public"."sys_region"."leaf" IS '�Ƿ�Ҷ�ӽڵ�  0����   1����';
COMMENT ON COLUMN "public"."sys_region"."sort" IS '����';
COMMENT ON COLUMN "public"."sys_region"."creator" IS '������';
COMMENT ON COLUMN "public"."sys_region"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."sys_region"."updater" IS '������';
COMMENT ON COLUMN "public"."sys_region"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."sys_region" IS '��������';
-- ----------------------------
-- Table structure for sys_region_weather
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_region_weather";
CREATE TABLE "public"."sys_region_weather" (
  "region_id" int8,
  "weather_code" int8,
  "weather_name" varchar(255) COLLATE "pg_catalog"."default",
  "id" int8 NOT NULL
)
;
COMMENT ON COLUMN "public"."sys_region_weather"."region_id" IS '�������';
COMMENT ON COLUMN "public"."sys_region_weather"."weather_code" IS '�������б���';
COMMENT ON TABLE "public"."sys_region_weather" IS '�����Ӧ��������';

-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_role";
CREATE TABLE "public"."sys_role" (
  "id" int8 NOT NULL,
  "name" varchar(50) COLLATE "pg_catalog"."default",
  "remark" varchar(100) COLLATE "pg_catalog"."default",
  "dept_id" int8,
  "tenant_code" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "default_role" bool,
  "company_id" int8,
  "type" varchar(5) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."sys_role"."id" IS 'id';
COMMENT ON COLUMN "public"."sys_role"."name" IS '��ɫ����';
COMMENT ON COLUMN "public"."sys_role"."remark" IS '��ע';
COMMENT ON COLUMN "public"."sys_role"."dept_id" IS '����ID';
COMMENT ON COLUMN "public"."sys_role"."tenant_code" IS '�⻧����';
COMMENT ON COLUMN "public"."sys_role"."creator" IS '������';
COMMENT ON COLUMN "public"."sys_role"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."sys_role"."updater" IS '������';
COMMENT ON COLUMN "public"."sys_role"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."sys_role"."default_role" IS '�Ƿ�Ĭ�Ͻ�ɫ';
COMMENT ON COLUMN "public"."sys_role"."company_id" IS '��ҵ����id';
COMMENT ON COLUMN "public"."sys_role"."type" IS '��ɫ����,0-��ҵ��ɫ,1-�û���ɫ';
COMMENT ON TABLE "public"."sys_role" IS '��ɫ����';

-- ----------------------------
-- Table structure for sys_role_data_scope
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_role_data_scope";
CREATE TABLE "public"."sys_role_data_scope" (
  "id" int8 NOT NULL,
  "role_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8
)
;
COMMENT ON COLUMN "public"."sys_role_data_scope"."role_id" IS '��ɫID';
COMMENT ON COLUMN "public"."sys_role_data_scope"."dept_id" IS '����ID';
COMMENT ON COLUMN "public"."sys_role_data_scope"."creator" IS '������';
COMMENT ON COLUMN "public"."sys_role_data_scope"."create_date" IS '����ʱ��';
COMMENT ON TABLE "public"."sys_role_data_scope" IS '��ɫ����Ȩ��';

-- ----------------------------
-- Records of sys_role_data_scope
-- ----------------------------

-- ----------------------------
-- Table structure for sys_role_menu
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_role_menu";
CREATE TABLE "public"."sys_role_menu" (
  "id" int8 NOT NULL,
  "role_id" int8,
  "menu_id" int8,
  "creator" int8,
  "create_date" int8
)
;
COMMENT ON COLUMN "public"."sys_role_menu"."role_id" IS '��ɫID';
COMMENT ON COLUMN "public"."sys_role_menu"."menu_id" IS '�˵�ID';
COMMENT ON COLUMN "public"."sys_role_menu"."creator" IS '������';
COMMENT ON COLUMN "public"."sys_role_menu"."create_date" IS '����ʱ��';
COMMENT ON TABLE "public"."sys_role_menu" IS '��ɫ�˵���ϵ';

-- ----------------------------
-- Table structure for sys_role_user
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_role_user";
CREATE TABLE "public"."sys_role_user" (
  "id" int8 NOT NULL,
  "role_id" int8,
  "user_id" int8,
  "creator" int8,
  "create_date" int8
)
;
COMMENT ON COLUMN "public"."sys_role_user"."role_id" IS '��ɫID';
COMMENT ON COLUMN "public"."sys_role_user"."user_id" IS '�û�ID';
COMMENT ON COLUMN "public"."sys_role_user"."creator" IS '������';
COMMENT ON COLUMN "public"."sys_role_user"."create_date" IS '����ʱ��';
COMMENT ON TABLE "public"."sys_role_user" IS '��ɫ�û���ϵ';

-- ----------------------------
-- Table structure for sys_sms
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_sms";
CREATE TABLE "public"."sys_sms" (
  "id" int8 NOT NULL,
  "sms_code" varchar(32) COLLATE "pg_catalog"."default",
  "platform" int4,
  "sms_config" varchar(2000) COLLATE "pg_catalog"."default",
  "remark" varchar(200) COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."sys_sms"."id" IS 'id';
COMMENT ON COLUMN "public"."sys_sms"."sms_code" IS '���ű���';
COMMENT ON COLUMN "public"."sys_sms"."platform" IS 'ƽ̨����';
COMMENT ON COLUMN "public"."sys_sms"."sms_config" IS '��������';
COMMENT ON COLUMN "public"."sys_sms"."remark" IS '��ע';
COMMENT ON COLUMN "public"."sys_sms"."creator" IS '������';
COMMENT ON COLUMN "public"."sys_sms"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."sys_sms"."updater" IS '������';
COMMENT ON COLUMN "public"."sys_sms"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."sys_sms" IS '����';

-- ----------------------------
-- Records of sys_sms
-- ----------------------------

-- ----------------------------
-- Table structure for sys_sms_log
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_sms_log";
CREATE TABLE "public"."sys_sms_log" (
  "id" int8 NOT NULL,
  "sms_code" varchar(32) COLLATE "pg_catalog"."default",
  "platform" int4,
  "mobile" varchar(20) COLLATE "pg_catalog"."default",
  "params_1" varchar(50) COLLATE "pg_catalog"."default",
  "params_2" varchar(50) COLLATE "pg_catalog"."default",
  "params_3" varchar(50) COLLATE "pg_catalog"."default",
  "params_4" varchar(50) COLLATE "pg_catalog"."default",
  "status" int4,
  "creator" int8,
  "create_date" int8
)
;
COMMENT ON COLUMN "public"."sys_sms_log"."id" IS 'id';
COMMENT ON COLUMN "public"."sys_sms_log"."sms_code" IS '���ű���';
COMMENT ON COLUMN "public"."sys_sms_log"."platform" IS 'ƽ̨����';
COMMENT ON COLUMN "public"."sys_sms_log"."mobile" IS '�ֻ���';
COMMENT ON COLUMN "public"."sys_sms_log"."params_1" IS '����1';
COMMENT ON COLUMN "public"."sys_sms_log"."params_2" IS '����2';
COMMENT ON COLUMN "public"."sys_sms_log"."params_3" IS '����3';
COMMENT ON COLUMN "public"."sys_sms_log"."params_4" IS '����4';
COMMENT ON COLUMN "public"."sys_sms_log"."status" IS '����״̬  0��ʧ��  1���ɹ�';
COMMENT ON COLUMN "public"."sys_sms_log"."creator" IS '������';
COMMENT ON COLUMN "public"."sys_sms_log"."create_date" IS '����ʱ��';
COMMENT ON TABLE "public"."sys_sms_log" IS '���ŷ��ͼ�¼';

-- ----------------------------
-- Records of sys_sms_log
-- ----------------------------

-- ----------------------------
-- Table structure for sys_tenant
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_tenant";
CREATE TABLE "public"."sys_tenant" (
  "id" int8 NOT NULL,
  "tenant_code" int8,
  "tenant_name" varchar(50) COLLATE "pg_catalog"."default",
  "status" int4,
  "remark" varchar(200) COLLATE "pg_catalog"."default",
  "user_id" int8,
  "username" varchar(50) COLLATE "pg_catalog"."default",
  "del_flag" int4,
  "sys_tenant" int4,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "tenant_type" int4,
  "thing_code" varchar(50) COLLATE "pg_catalog"."default",
  "enterprise_quantity" int4,
  "enterprise_users" int4,
  "enterprise_things" int4
)
;
COMMENT ON COLUMN "public"."sys_tenant"."id" IS 'id';
COMMENT ON COLUMN "public"."sys_tenant"."tenant_code" IS '�⻧����';
COMMENT ON COLUMN "public"."sys_tenant"."tenant_name" IS '�⻧����';
COMMENT ON COLUMN "public"."sys_tenant"."status" IS '״̬  0��ͣ��    1������';
COMMENT ON COLUMN "public"."sys_tenant"."remark" IS '��ע';
COMMENT ON COLUMN "public"."sys_tenant"."user_id" IS '��¼�˺�ID';
COMMENT ON COLUMN "public"."sys_tenant"."username" IS '��¼�˺�';
COMMENT ON COLUMN "public"."sys_tenant"."del_flag" IS 'ɾ����ʶ 0��δɾ��    1��ɾ��';
COMMENT ON COLUMN "public"."sys_tenant"."sys_tenant" IS 'ϵͳ�⻧   0����   1����';
COMMENT ON COLUMN "public"."sys_tenant"."creator" IS '������';
COMMENT ON COLUMN "public"."sys_tenant"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."sys_tenant"."updater" IS '������';
COMMENT ON COLUMN "public"."sys_tenant"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."sys_tenant"."tenant_type" IS '��ҵ����(0����ҵ��1���⻧)';
COMMENT ON COLUMN "public"."sys_tenant"."thing_code" IS '��ҵ�����';
COMMENT ON COLUMN "public"."sys_tenant"."enterprise_quantity" IS '��ҵ����';
COMMENT ON COLUMN "public"."sys_tenant"."enterprise_users" IS '��ҵ�û�����';
COMMENT ON COLUMN "public"."sys_tenant"."enterprise_things" IS '��ҵ������';
COMMENT ON TABLE "public"."sys_tenant" IS '�⻧����';

-- ----------------------------
-- Table structure for sys_tenant_detail
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_tenant_detail";
CREATE TABLE "public"."sys_tenant_detail" (
  "id" int8 NOT NULL,
  "name" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "corporation_code" varchar(32) COLLATE "pg_catalog"."default",
  "industry_category" varchar(64) COLLATE "pg_catalog"."default",
  "industry_type" varchar(64) COLLATE "pg_catalog"."default",
  "region_code" varchar(32) COLLATE "pg_catalog"."default",
  "address" varchar(255) COLLATE "pg_catalog"."default",
  "contact" varchar(20) COLLATE "pg_catalog"."default",
  "contact_number" varchar(20) COLLATE "pg_catalog"."default",
  "email" varchar(320) COLLATE "pg_catalog"."default",
  "url" varchar(255) COLLATE "pg_catalog"."default",
  "lng_lat" varchar(255) COLLATE "pg_catalog"."default",
  "logo_url" varchar(255) COLLATE "pg_catalog"."default",
  "image_url" varchar(255) COLLATE "pg_catalog"."default",
  "remark" varchar COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "english_name" varchar(255) COLLATE "pg_catalog"."default",
  "title" varchar(255) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."sys_tenant_detail"."id" IS '����';
COMMENT ON COLUMN "public"."sys_tenant_detail"."name" IS '����';
COMMENT ON COLUMN "public"."sys_tenant_detail"."corporation_code" IS 'ͳһ�������ʶ����';
COMMENT ON COLUMN "public"."sys_tenant_detail"."industry_category" IS '��ҵ���࣬ industry_type�еĶ�������';
COMMENT ON COLUMN "public"."sys_tenant_detail"."industry_type" IS '��ҵ���࣬industry_type�еĶ�������';
COMMENT ON COLUMN "public"."sys_tenant_detail"."region_code" IS '����';
COMMENT ON COLUMN "public"."sys_tenant_detail"."address" IS '��ַ';
COMMENT ON COLUMN "public"."sys_tenant_detail"."contact" IS '��ϵ��';
COMMENT ON COLUMN "public"."sys_tenant_detail"."contact_number" IS '��ϵ�绰';
COMMENT ON COLUMN "public"."sys_tenant_detail"."email" IS '����';
COMMENT ON COLUMN "public"."sys_tenant_detail"."url" IS '��ҵ����';
COMMENT ON COLUMN "public"."sys_tenant_detail"."lng_lat" IS '��γ��';
COMMENT ON COLUMN "public"."sys_tenant_detail"."logo_url" IS 'logo';
COMMENT ON COLUMN "public"."sys_tenant_detail"."image_url" IS '��ҵͼƬ';
COMMENT ON COLUMN "public"."sys_tenant_detail"."remark" IS '��ҵ����';
COMMENT ON COLUMN "public"."sys_tenant_detail"."creator" IS '������';
COMMENT ON COLUMN "public"."sys_tenant_detail"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."sys_tenant_detail"."updater" IS '������';
COMMENT ON COLUMN "public"."sys_tenant_detail"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."sys_tenant_detail"."english_name" IS '��ҵӢ����';
COMMENT ON COLUMN "public"."sys_tenant_detail"."title" IS '��ҵ����';
COMMENT ON TABLE "public"."sys_tenant_detail" IS '��ҵ����';

-- ----------------------------
-- Table structure for sys_tenant_group
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_tenant_group";
CREATE TABLE "public"."sys_tenant_group" (
  "id" int8 NOT NULL,
  "parent_code" int8,
  "code" int8,
  "creator" int8,
  "create_date" int8,
  "parent_modify_code" int8
)
;
COMMENT ON COLUMN "public"."sys_tenant_group"."parent_code" IS '���⻧code';
COMMENT ON COLUMN "public"."sys_tenant_group"."code" IS '���⻧code';
COMMENT ON COLUMN "public"."sys_tenant_group"."parent_modify_code" IS '�������޸Ľڵ�code';
COMMENT ON TABLE "public"."sys_tenant_group" IS '�⻧���ϵ��';

-- ----------------------------
-- Records of sys_tenant_group
-- ----------------------------

-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_user";
CREATE TABLE "public"."sys_user" (
  "id" int8 NOT NULL,
  "username" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "password" varchar(100) COLLATE "pg_catalog"."default",
  "real_name" varchar(50) COLLATE "pg_catalog"."default",
  "head_url" varchar(200) COLLATE "pg_catalog"."default",
  "gender" int4,
  "email" varchar(100) COLLATE "pg_catalog"."default",
  "mobile" varchar(100) COLLATE "pg_catalog"."default",
  "dept_id" int8,
  "super_admin" int4,
  "super_tenant" int4,
  "status" int4,
  "tenant_code" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "open_id" varchar(100) COLLATE "pg_catalog"."default",
  "tenant_group" int4,
  "url" varchar(255) COLLATE "pg_catalog"."default",
  "tenant_list" varchar(2550) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."sys_user"."id" IS 'id';
COMMENT ON COLUMN "public"."sys_user"."username" IS '�û���';
COMMENT ON COLUMN "public"."sys_user"."password" IS '����';
COMMENT ON COLUMN "public"."sys_user"."real_name" IS '����';
COMMENT ON COLUMN "public"."sys_user"."head_url" IS 'ͷ��';
COMMENT ON COLUMN "public"."sys_user"."gender" IS '�Ա�   0����   1��Ů    2������';
COMMENT ON COLUMN "public"."sys_user"."email" IS '����';
COMMENT ON COLUMN "public"."sys_user"."mobile" IS '�ֻ���';
COMMENT ON COLUMN "public"."sys_user"."dept_id" IS '����ID';
COMMENT ON COLUMN "public"."sys_user"."super_admin" IS '��������Ա   0����   1����';
COMMENT ON COLUMN "public"."sys_user"."super_tenant" IS '�⻧����Ա   0����   1����';
COMMENT ON COLUMN "public"."sys_user"."status" IS '״̬  0��ͣ��    1������';
COMMENT ON COLUMN "public"."sys_user"."tenant_code" IS '�⻧����';
COMMENT ON COLUMN "public"."sys_user"."creator" IS '������';
COMMENT ON COLUMN "public"."sys_user"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."sys_user"."updater" IS '������';
COMMENT ON COLUMN "public"."sys_user"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."sys_user"."open_id" IS '΢����ȨopenId';
COMMENT ON COLUMN "public"."sys_user"."tenant_group" IS '�⻧�����Ա   0����   1����';
COMMENT ON COLUMN "public"."sys_user"."url" IS '·�ɵ�ַ';
COMMENT ON COLUMN "public"."sys_user"."tenant_list" IS '�û��ɲ�����ҵtenant_code�б�';
COMMENT ON TABLE "public"."sys_user" IS '�û�����';
-- ----------------------------
-- Table structure for sys_user_menu
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_user_menu";
CREATE TABLE "public"."sys_user_menu" (
  "id" int8 NOT NULL,
  "user_id" int8,
  "menu_id" int8,
  "url" varchar(255) COLLATE "pg_catalog"."default",
  "show_logo" bool,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "logo" varchar(255) COLLATE "pg_catalog"."default",
  "name" varchar(255) COLLATE "pg_catalog"."default",
  "tenant_code" int8
)
;
COMMENT ON COLUMN "public"."sys_user_menu"."id" IS 'id';
COMMENT ON COLUMN "public"."sys_user_menu"."user_id" IS '��¼�û�';
COMMENT ON COLUMN "public"."sys_user_menu"."menu_id" IS '�˵�id';
COMMENT ON COLUMN "public"."sys_user_menu"."url" IS '�˵�URL';
COMMENT ON COLUMN "public"."sys_user_menu"."show_logo" IS '�Ƿ�����չʾlogo';
COMMENT ON COLUMN "public"."sys_user_menu"."creator" IS '������';
COMMENT ON COLUMN "public"."sys_user_menu"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."sys_user_menu"."updater" IS '������';
COMMENT ON COLUMN "public"."sys_user_menu"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."sys_user_menu"."logo" IS 'logo';
COMMENT ON COLUMN "public"."sys_user_menu"."name" IS 'ƽ̨����';
COMMENT ON TABLE "public"."sys_user_menu" IS '�û��˵���ϵ��';

-- ----------------------------
-- Records of sys_user_menu
-- ----------------------------

-- ----------------------------
-- Table structure for sys_user_post
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_user_post";
CREATE TABLE "public"."sys_user_post" (
  "id" int8 NOT NULL,
  "post_id" int8,
  "user_id" int8,
  "creator" int8,
  "create_date" int8
)
;
COMMENT ON COLUMN "public"."sys_user_post"."id" IS 'id';
COMMENT ON COLUMN "public"."sys_user_post"."post_id" IS '��λID';
COMMENT ON COLUMN "public"."sys_user_post"."user_id" IS '�û�ID';
COMMENT ON TABLE "public"."sys_user_post" IS '�û���λ��ϵ';

-- ----------------------------
-- Records of sys_user_post
-- ----------------------------

-- ----------------------------
-- Table structure for sys_user_token
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_user_token";
CREATE TABLE "public"."sys_user_token" (
  "id" int8 NOT NULL,
  "user_id" int8,
  "token" varchar(100) COLLATE "pg_catalog"."default",
  "expire_date" timestamp(6),
  "update_date" timestamp(6),
  "create_date" timestamp(6)
)
;
COMMENT ON COLUMN "public"."sys_user_token"."id" IS 'id';
COMMENT ON COLUMN "public"."sys_user_token"."user_id" IS '�û�id';
COMMENT ON COLUMN "public"."sys_user_token"."token" IS '�û�token';
COMMENT ON COLUMN "public"."sys_user_token"."expire_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."sys_user_token"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."sys_user_token"."create_date" IS '����ʱ��';
COMMENT ON TABLE "public"."sys_user_token" IS 'ϵͳ�û�Token';

-- ----------------------------
-- Table structure for tenant_common_config
-- ----------------------------
DROP TABLE IF EXISTS "public"."tenant_common_config";
CREATE TABLE "public"."tenant_common_config" (
  "id" int8 NOT NULL,
  "config_key" varchar(64) COLLATE "pg_catalog"."default",
  "config_name" varchar(64) COLLATE "pg_catalog"."default",
  "config_value" varchar COLLATE "pg_catalog"."default",
  "config_type" int4,
  "remark" varchar(256) COLLATE "pg_catalog"."default",
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."tenant_common_config"."id" IS '����id';
COMMENT ON COLUMN "public"."tenant_common_config"."config_key" IS '��������';
COMMENT ON COLUMN "public"."tenant_common_config"."config_name" IS '��������';
COMMENT ON COLUMN "public"."tenant_common_config"."config_value" IS '����ֵ';
COMMENT ON COLUMN "public"."tenant_common_config"."config_type" IS '��������';
COMMENT ON COLUMN "public"."tenant_common_config"."remark" IS '����';
COMMENT ON COLUMN "public"."tenant_common_config"."tenant_code" IS '�⻧code';
COMMENT ON COLUMN "public"."tenant_common_config"."company_id" IS '��˾id';
COMMENT ON COLUMN "public"."tenant_common_config"."dept_id" IS '��������id';
COMMENT ON COLUMN "public"."tenant_common_config"."creator" IS '������';
COMMENT ON COLUMN "public"."tenant_common_config"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."tenant_common_config"."updater" IS '������';
COMMENT ON COLUMN "public"."tenant_common_config"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."tenant_common_config" IS '�⻧������Ϣ��';

-- ----------------------------
-- Records of tenant_common_config
-- ----------------------------

-- ----------------------------
-- Table structure for thing_ts_kv
-- ----------------------------
DROP TABLE IF EXISTS "public"."thing_ts_kv";
CREATE TABLE "public"."thing_ts_kv" (
  "thing_code" varchar(255) COLLATE "pg_catalog"."default",
  "attr_key" varchar(255) COLLATE "pg_catalog"."default",
  "ts" numeric,
  "val" text COLLATE "pg_catalog"."default",
  "year" int4,
  "month" int4,
  "day" int4,
  "hour" int4,
  "minute" int4
)
;

-- ----------------------------
-- Records of thing_ts_kv
-- ----------------------------

-- ----------------------------
-- Table structure for thing_ts_kv_external
-- ----------------------------
DROP TABLE IF EXISTS "public"."thing_ts_kv_external";
CREATE TABLE "public"."thing_ts_kv_external" (
  "thing_code" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "attr_key" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "ts" int8 NOT NULL,
  "val" text COLLATE "pg_catalog"."default" NOT NULL,
  "year" int4,
  "month" int4,
  "day" int4,
  "hour" int4,
  "minute" int4
)
;
COMMENT ON COLUMN "public"."thing_ts_kv_external"."thing_code" IS '�����';
COMMENT ON COLUMN "public"."thing_ts_kv_external"."attr_key" IS '���Ա���';
COMMENT ON COLUMN "public"."thing_ts_kv_external"."ts" IS 'ʱ��';
COMMENT ON COLUMN "public"."thing_ts_kv_external"."val" IS '����ֵ';
COMMENT ON TABLE "public"."thing_ts_kv_external" IS 'tsvk �ⲿ���ݣ����������ɵģ��ֶ�ά���ģ�����ĵ�����������������';

-- ----------------------------
-- Records of thing_ts_kv_external
-- ----------------------------

-- ----------------------------
-- Table structure for transport_extend
-- ----------------------------
DROP TABLE IF EXISTS "public"."transport_extend";
CREATE TABLE "public"."transport_extend" (
  "id" int8 NOT NULL,
  "type" varchar(25) COLLATE "pg_catalog"."default",
  "name" varchar(255) COLLATE "pg_catalog"."default",
  "configuration" varchar COLLATE "pg_catalog"."default",
  "remark" varchar(500) COLLATE "pg_catalog"."default",
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."transport_extend"."id" IS '����';
COMMENT ON COLUMN "public"."transport_extend"."type" IS '����';
COMMENT ON COLUMN "public"."transport_extend"."name" IS '����';
COMMENT ON COLUMN "public"."transport_extend"."configuration" IS '����';
COMMENT ON COLUMN "public"."transport_extend"."remark" IS '��ע';
COMMENT ON COLUMN "public"."transport_extend"."tenant_code" IS '������ҵ(�⻧code)';
COMMENT ON COLUMN "public"."transport_extend"."company_id" IS '��ҵ����id';
COMMENT ON COLUMN "public"."transport_extend"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."transport_extend"."creator" IS '������';
COMMENT ON COLUMN "public"."transport_extend"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."transport_extend"."updater" IS '������';
COMMENT ON COLUMN "public"."transport_extend"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."transport_extend" IS 'ͨѶ����';

-- ----------------------------
-- Records of transport_extend
-- ----------------------------

-- ----------------------------
-- Table structure for transport_extend_calculation
-- ----------------------------
DROP TABLE IF EXISTS "public"."transport_extend_calculation";
CREATE TABLE "public"."transport_extend_calculation" (
  "id" int8 NOT NULL,
  "config_id" int8,
  "configuration" varchar COLLATE "pg_catalog"."default",
  "remark" varchar(500) COLLATE "pg_catalog"."default",
  "calculation_id" int8,
  "debug" bool,
  "type" varchar(5) COLLATE "pg_catalog"."default",
  "addr" varchar(255) COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."transport_extend_calculation"."id" IS '����';
COMMENT ON COLUMN "public"."transport_extend_calculation"."config_id" IS 'ͨѶ��������';
COMMENT ON COLUMN "public"."transport_extend_calculation"."configuration" IS '����';
COMMENT ON COLUMN "public"."transport_extend_calculation"."remark" IS '��ע';
COMMENT ON COLUMN "public"."transport_extend_calculation"."calculation_id" IS '��������';
COMMENT ON COLUMN "public"."transport_extend_calculation"."debug" IS '�Ƿ����';
COMMENT ON COLUMN "public"."transport_extend_calculation"."type" IS '����(��/д/��д)';
COMMENT ON COLUMN "public"."transport_extend_calculation"."addr" IS '����json�ĵ�ַ(չʾ��)';
COMMENT ON COLUMN "public"."transport_extend_calculation"."creator" IS '������';
COMMENT ON COLUMN "public"."transport_extend_calculation"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."transport_extend_calculation"."updater" IS '������';
COMMENT ON COLUMN "public"."transport_extend_calculation"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."transport_extend_calculation" IS 'ͨѶ���ù�������';

-- ----------------------------
-- Records of transport_extend_calculation
-- ----------------------------

-- ----------------------------
-- Table structure for transport_extend_msg
-- ----------------------------
DROP TABLE IF EXISTS "public"."transport_extend_msg";
CREATE TABLE "public"."transport_extend_msg" (
  "id" int8 NOT NULL,
  "config_id" int8,
  "input_msg" varchar COLLATE "pg_catalog"."default",
  "output_msg" varchar COLLATE "pg_catalog"."default",
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "error_msg" varchar COLLATE "pg_catalog"."default",
  "extend_calculation_id" int8,
  "company_d" int8,
  "debug" bool,
  "dept_id" int8,
  "origin" varchar(255) COLLATE "pg_catalog"."default",
  "tenant_code" int8,
  "ts" int8
)
;
COMMENT ON COLUMN "public"."transport_extend_msg"."id" IS '����';
COMMENT ON COLUMN "public"."transport_extend_msg"."config_id" IS 'ͨѶ��������';
COMMENT ON COLUMN "public"."transport_extend_msg"."input_msg" IS 'ԭʼ����';
COMMENT ON COLUMN "public"."transport_extend_msg"."output_msg" IS 'ת��������';
COMMENT ON COLUMN "public"."transport_extend_msg"."creator" IS '������';
COMMENT ON COLUMN "public"."transport_extend_msg"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."transport_extend_msg"."updater" IS '������';
COMMENT ON COLUMN "public"."transport_extend_msg"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."transport_extend_msg"."error_msg" IS '������Ϣ';
COMMENT ON COLUMN "public"."transport_extend_msg"."extend_calculation_id" IS 'ͨѶ���ü����ϵ����';
COMMENT ON TABLE "public"."transport_extend_msg" IS 'ͨѶ������־';

-- ----------------------------
-- Records of transport_extend_msg
-- ----------------------------

-- ----------------------------
-- Table structure for ts_kv_latest
-- ----------------------------
DROP TABLE IF EXISTS "public"."ts_kv_latest";
CREATE TABLE "public"."ts_kv_latest" (
  "thing_code" varchar(255) COLLATE "pg_catalog"."default",
  "attr_key" varchar(255) COLLATE "pg_catalog"."default",
  "ts" numeric,
  "val" text COLLATE "pg_catalog"."default",
  "year" int4,
  "month" int4,
  "day" int4,
  "hour" int4,
  "minute" int4
)
;
DROP TABLE IF EXISTS "public"."carbon_energy_dict_relation";
CREATE TABLE "public"."carbon_energy_dict_relation" (
  "id" int8 NOT NULL,
  "energy_variety_id" int8 NOT NULL,
  "attr_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "attr_name" varchar(255) COLLATE "pg_catalog"."default",
  "attr_type" varchar(10) COLLATE "pg_catalog"."default",
  "group_id" int8,
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "group_name" varchar(255) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."carbon_energy_dict_relation"."id" IS '��������id';
COMMENT ON COLUMN "public"."carbon_energy_dict_relation"."energy_variety_id" IS '��ԴƷ��id';
COMMENT ON COLUMN "public"."carbon_energy_dict_relation"."attr_code" IS '����code';
COMMENT ON COLUMN "public"."carbon_energy_dict_relation"."attr_name" IS '��������';
COMMENT ON COLUMN "public"."carbon_energy_dict_relation"."attr_type" IS '��������';
COMMENT ON COLUMN "public"."carbon_energy_dict_relation"."group_id" IS '������id';
COMMENT ON COLUMN "public"."carbon_energy_dict_relation"."tenant_code" IS '������ҵ/�⻧code';
COMMENT ON COLUMN "public"."carbon_energy_dict_relation"."company_id" IS '��ҵ����id';
COMMENT ON COLUMN "public"."carbon_energy_dict_relation"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."carbon_energy_dict_relation"."creator" IS '������id';
COMMENT ON COLUMN "public"."carbon_energy_dict_relation"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."carbon_energy_dict_relation"."updater" IS '������id';
COMMENT ON COLUMN "public"."carbon_energy_dict_relation"."update_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."carbon_energy_dict_relation"."group_name" IS '������';
COMMENT ON TABLE "public"."carbon_energy_dict_relation" IS '��Դ���Թ�ϵ';

-- ----------------------------
-- Table structure for carbon_energy_price
-- ----------------------------
DROP TABLE IF EXISTS "public"."carbon_energy_price";
CREATE TABLE "public"."carbon_energy_price" (
  "id" int8 NOT NULL,
  "attr_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "attr_name" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "energy_variety_id" int8,
  "tag" varchar(128) COLLATE "pg_catalog"."default",
  "price" numeric(10,2),
  "serial_number" int4,
  "begin_time" date,
  "end_time" date,
  "unit" varchar(255) COLLATE "pg_catalog"."default",
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."carbon_energy_price"."id" IS '��������id';
COMMENT ON COLUMN "public"."carbon_energy_price"."attr_code" IS '����code';
COMMENT ON COLUMN "public"."carbon_energy_price"."attr_name" IS '��������';
COMMENT ON COLUMN "public"."carbon_energy_price"."energy_variety_id" IS '��ԴƷ��id';
COMMENT ON COLUMN "public"."carbon_energy_price"."tag" IS '��Դ��ǩ';
COMMENT ON COLUMN "public"."carbon_energy_price"."price" IS '��Դ�۸�Ԫ��';
COMMENT ON COLUMN "public"."carbon_energy_price"."serial_number" IS '���';
COMMENT ON COLUMN "public"."carbon_energy_price"."begin_time" IS '����ʱ�䷶Χ��ʼ����';
COMMENT ON COLUMN "public"."carbon_energy_price"."end_time" IS '����ʱ�䷶Χ��ֹ����';
COMMENT ON COLUMN "public"."carbon_energy_price"."unit" IS '������λ';
COMMENT ON COLUMN "public"."carbon_energy_price"."tenant_code" IS '������ҵ/�⻧code';
COMMENT ON COLUMN "public"."carbon_energy_price"."company_id" IS '��ҵ����id';
COMMENT ON COLUMN "public"."carbon_energy_price"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."carbon_energy_price"."creator" IS '������id';
COMMENT ON COLUMN "public"."carbon_energy_price"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."carbon_energy_price"."updater" IS '������id';
COMMENT ON COLUMN "public"."carbon_energy_price"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."carbon_energy_price" IS '��Դ�۸�';
-- ----------------------------
-- Table structure for carbon_peak_config
-- ----------------------------
DROP TABLE IF EXISTS "public"."carbon_peak_config";
CREATE TABLE "public"."carbon_peak_config" (
  "id" int8 NOT NULL,
  "year" varchar(255) COLLATE "pg_catalog"."default",
  "months" varchar(255) COLLATE "pg_catalog"."default",
  "start_time" int8,
  "end_time" int8,
  "base_attr_code" varchar(255) COLLATE "pg_catalog"."default",
  "build_attr_code" varchar(255) COLLATE "pg_catalog"."default",
  "remarks" varchar(2550) COLLATE "pg_catalog"."default",
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8,
  "start_time_f" varchar(64) COLLATE "pg_catalog"."default",
  "end_time_f" varchar(64) COLLATE "pg_catalog"."default",
  "ev_id" int8
)
;
COMMENT ON COLUMN "public"."carbon_peak_config"."id" IS 'id';
COMMENT ON COLUMN "public"."carbon_peak_config"."year" IS '��ݣ���ѡ��';
COMMENT ON COLUMN "public"."carbon_peak_config"."months" IS '�·ݣ��ɶ�ѡ��';
COMMENT ON COLUMN "public"."carbon_peak_config"."start_time" IS '��ʼʱ�䣨0��������ʱ�����ֵ������01:00 = 60';
COMMENT ON COLUMN "public"."carbon_peak_config"."end_time" IS '����ʱ�䣨0��������ʱ�����ֵ������02:00 = 120';
COMMENT ON COLUMN "public"."carbon_peak_config"."base_attr_code" IS '���������Ա���';
COMMENT ON COLUMN "public"."carbon_peak_config"."build_attr_code" IS 'ӳ�������Ա���';
COMMENT ON COLUMN "public"."carbon_peak_config"."remarks" IS '��ע';
COMMENT ON COLUMN "public"."carbon_peak_config"."tenant_code" IS '������ҵ/�⻧code';
COMMENT ON COLUMN "public"."carbon_peak_config"."company_id" IS '��ҵ����id';
COMMENT ON COLUMN "public"."carbon_peak_config"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."carbon_peak_config"."creator" IS '������id';
COMMENT ON COLUMN "public"."carbon_peak_config"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."carbon_peak_config"."updater" IS '������id';
COMMENT ON COLUMN "public"."carbon_peak_config"."update_date" IS '
����ʱ��';
COMMENT ON COLUMN "public"."carbon_peak_config"."start_time_f" IS '��ʼʱ�䣨0��������ʱ�����ֵ������01:00 ';
COMMENT ON COLUMN "public"."carbon_peak_config"."end_time_f" IS '����ʱ�䣨0��������ʱ�����ֵ������02:00 ';
COMMENT ON COLUMN "public"."carbon_peak_config"."ev_id" IS '��ԴƷ��id';
COMMENT ON TABLE "public"."carbon_peak_config" IS '����ƽ����';
-- ----------------------------
-- Table structure for carbon_ts_kv
-- ----------------------------
DROP TABLE IF EXISTS "public"."carbon_ts_kv";
CREATE TABLE "public"."carbon_ts_kv" (
  "thing_id" int8 NOT NULL,
  "thing_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "attr_key" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "ts" int8 NOT NULL,
  "val" varchar COLLATE "pg_catalog"."default",
  "day_time" date,
  "create_time" int8,
  "update_time" int8,
  "attribute_type" varchar(10) COLLATE "pg_catalog"."default" NOT NULL
)
;
COMMENT ON COLUMN "public"."carbon_ts_kv"."thing_id" IS '��ҵ�豸id';
COMMENT ON COLUMN "public"."carbon_ts_kv"."thing_code" IS '�豸����';
COMMENT ON COLUMN "public"."carbon_ts_kv"."attr_key" IS '���Ա���';
COMMENT ON COLUMN "public"."carbon_ts_kv"."ts" IS 'ʱ���';
COMMENT ON COLUMN "public"."carbon_ts_kv"."val" IS 'ң��ֵ';
COMMENT ON COLUMN "public"."carbon_ts_kv"."day_time" IS 'ʱ��';
COMMENT ON COLUMN "public"."carbon_ts_kv"."create_time" IS '����ʱ��';
COMMENT ON COLUMN "public"."carbon_ts_kv"."update_time" IS '����ʱ��';
COMMENT ON COLUMN "public"."carbon_ts_kv"."attribute_type" IS '�������ͣ�dd, mm, yy';
COMMENT ON TABLE "public"."carbon_ts_kv" IS '��ҵң�����ݻ���';

-- ----------------------------
-- Table structure for iot_carbon_energy_variety
-- ----------------------------
DROP TABLE IF EXISTS "public"."iot_carbon_energy_variety";
CREATE TABLE "public"."iot_carbon_energy_variety" (
  "id" int8 NOT NULL,
  "name" varchar(128) COLLATE "pg_catalog"."default",
  "code" varchar(128) COLLATE "pg_catalog"."default",
  "type" varchar(24) COLLATE "pg_catalog"."default",
  "is_default" varchar(2) COLLATE "pg_catalog"."default",
  "remarks" varchar(2028) COLLATE "pg_catalog"."default",
  "tenant_code" int8,
  "company_id" int8,
  "dept_id" int8,
  "creator" int8,
  "create_date" int8,
  "updater" int8,
  "update_date" int8
)
;
COMMENT ON COLUMN "public"."iot_carbon_energy_variety"."id" IS '��������id';
COMMENT ON COLUMN "public"."iot_carbon_energy_variety"."name" IS '��ԴƷ������
�磬ˮ����Ȼ��������...';
COMMENT ON COLUMN "public"."iot_carbon_energy_variety"."code" IS '��ԴƷ������
������ǰϵͳ���壬���-A29...';
COMMENT ON COLUMN "public"."iot_carbon_energy_variety"."type" IS '��Դ�ŷ���𣬻�����Դ  ������Դ';
COMMENT ON COLUMN "public"."iot_carbon_energy_variety"."is_default" IS '�Ƿ�Ĭ�ϣ�0Ĭ�ϣ�1�Զ��壬Ĭ������ֻ�й���Ա���Բ���';
COMMENT ON COLUMN "public"."iot_carbon_energy_variety"."remarks" IS '��ע';
COMMENT ON COLUMN "public"."iot_carbon_energy_variety"."tenant_code" IS '��ҵ����';
COMMENT ON COLUMN "public"."iot_carbon_energy_variety"."company_id" IS '��ҵ����id';
COMMENT ON COLUMN "public"."iot_carbon_energy_variety"."dept_id" IS '����id';
COMMENT ON COLUMN "public"."iot_carbon_energy_variety"."creator" IS '������id';
COMMENT ON COLUMN "public"."iot_carbon_energy_variety"."create_date" IS '����ʱ��';
COMMENT ON COLUMN "public"."iot_carbon_energy_variety"."updater" IS '������id';
COMMENT ON COLUMN "public"."iot_carbon_energy_variety"."update_date" IS '����ʱ��';
COMMENT ON TABLE "public"."iot_carbon_energy_variety" IS '��ԴƷ�ֻ�����Ϣ';

-- ----------------------------
-- Records of carbon_ts_kv
-- ----------------------------

-- ----------------------------
-- Uniques structure for table carbon_energy_dict_relation
-- ----------------------------
ALTER TABLE "public"."carbon_energy_dict_relation" ADD CONSTRAINT "unique_attr_code" UNIQUE ("attr_code");

-- ----------------------------
-- Primary Key structure for table carbon_energy_dict_relation
-- ----------------------------
ALTER TABLE "public"."carbon_energy_dict_relation" ADD CONSTRAINT "carbon_energy_dict_relation_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table alert_config
-- ----------------------------
ALTER TABLE "public"."alert_config" ADD CONSTRAINT "alert_config_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table alert_dispose_log
-- ----------------------------
ALTER TABLE "public"."alert_dispose_log" ADD CONSTRAINT "alert_dispose_log_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Uniques structure for table alert_log
-- ----------------------------
ALTER TABLE "public"."alert_log" ADD CONSTRAINT "alert_log_inx_cfg_id_time" UNIQUE ("config_id", "alert_time");

-- ----------------------------
-- Primary Key structure for table alert_log
-- ----------------------------
ALTER TABLE "public"."alert_log" ADD CONSTRAINT "alert_log_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Uniques structure for table calc_log
-- ----------------------------
ALTER TABLE "public"."calc_log" ADD CONSTRAINT "calc_log_uk" UNIQUE ("calc_target_config_id", "time");
COMMENT ON CONSTRAINT "calc_log_uk" ON "public"."calc_log" IS '�������־Ψһ��';

-- ----------------------------
-- Primary Key structure for table calc_log
-- ----------------------------
ALTER TABLE "public"."calc_log" ADD CONSTRAINT "calc_log_pk" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table calc_source_config
-- ----------------------------
ALTER TABLE "public"."calc_source_config" ADD CONSTRAINT "calc_source_config_pk" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table calc_target_config
-- ----------------------------
ALTER TABLE "public"."calc_target_config" ADD CONSTRAINT "calc_target_config_pk" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table eq_attacment
-- ----------------------------
ALTER TABLE "public"."eq_attacment" ADD CONSTRAINT "eq_attacment_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table eq_bx
-- ----------------------------
CREATE UNIQUE INDEX "bx_no" ON "public"."eq_bx" USING btree (
  "bx_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table eq_bx
-- ----------------------------
ALTER TABLE "public"."eq_bx" ADD CONSTRAINT "eq_bx_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table eq_by
-- ----------------------------
ALTER TABLE "public"."eq_by" ADD CONSTRAINT "eq_by_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table eq_by_detail
-- ----------------------------
ALTER TABLE "public"."eq_by_detail" ADD CONSTRAINT "eq_by_detail_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table eq_by_plan
-- ----------------------------
ALTER TABLE "public"."eq_by_plan" ADD CONSTRAINT "eq_by_plan_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table eq_by_plan_part
-- ----------------------------
ALTER TABLE "public"."eq_by_plan_part" ADD CONSTRAINT "eq_by_plan_part_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table eq_by_template
-- ----------------------------
ALTER TABLE "public"."eq_by_template" ADD CONSTRAINT "eq_by_template_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table eq_by_template_detail
-- ----------------------------
ALTER TABLE "public"."eq_by_template_detail" ADD CONSTRAINT "eq_by_template_detail_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table eq_check_result
-- ----------------------------
ALTER TABLE "public"."eq_check_result" ADD CONSTRAINT "check_result_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table eq_check_setting
-- ----------------------------
ALTER TABLE "public"."eq_check_setting" ADD CONSTRAINT "eq_check_setting_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table eq_check_standard
-- ----------------------------
ALTER TABLE "public"."eq_check_standard" ADD CONSTRAINT "eq_check_standard_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table eq_check_standard_detail
-- ----------------------------
ALTER TABLE "public"."eq_check_standard_detail" ADD CONSTRAINT "eq_check_standard_detail_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table eq_file_delete
-- ----------------------------
ALTER TABLE "public"."eq_file_delete" ADD CONSTRAINT "eq_file_delete_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table eq_file_manage
-- ----------------------------
ALTER TABLE "public"."eq_file_manage" ADD CONSTRAINT "file_manage_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table eq_part_record
-- ----------------------------
ALTER TABLE "public"."eq_part_record" ADD CONSTRAINT "eq_part_record_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table eq_patrol_check_plan
-- ----------------------------
ALTER TABLE "public"."eq_patrol_check_plan" ADD CONSTRAINT "eq_patrolcheck_plan_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table eq_patrol_check_record
-- ----------------------------
ALTER TABLE "public"."eq_patrol_check_record" ADD CONSTRAINT "eq_patrol_check_record_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table eq_plan_record
-- ----------------------------
ALTER TABLE "public"."eq_plan_record" ADD CONSTRAINT "eq_plan_record_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table eq_plan_remind_record
-- ----------------------------
ALTER TABLE "public"."eq_plan_remind_record" ADD CONSTRAINT "eq_plan_remind_record_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table eq_scrap
-- ----------------------------
ALTER TABLE "public"."eq_scrap" ADD CONSTRAINT "eq_scrap_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table eq_spot_check_plan
-- ----------------------------
ALTER TABLE "public"."eq_spot_check_plan" ADD CONSTRAINT "eq_spot_check_plan_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table eq_spot_check_record
-- ----------------------------
ALTER TABLE "public"."eq_spot_check_record" ADD CONSTRAINT "eq_spot_check_record_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table eq_user_group
-- ----------------------------
ALTER TABLE "public"."eq_user_group" ADD CONSTRAINT "eq_user_group_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table eq_wx
-- ----------------------------
ALTER TABLE "public"."eq_wx" ADD CONSTRAINT "eq_wx_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table eq_wx_plan
-- ----------------------------
CREATE UNIQUE INDEX "wx_no" ON "public"."eq_wx_plan" USING btree (
  "wx_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table eq_wx_plan
-- ----------------------------
ALTER TABLE "public"."eq_wx_plan" ADD CONSTRAINT "eq_wx_plan_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table eq_wx_replacement
-- ----------------------------
ALTER TABLE "public"."eq_wx_replacement" ADD CONSTRAINT "wx_change_replacement_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Uniques structure for table filter_log
-- ----------------------------
ALTER TABLE "public"."filter_log" ADD CONSTRAINT "filter_log_uk" UNIQUE ("filter_rule_id", "time");

-- ----------------------------
-- Primary Key structure for table gateway_component
-- ----------------------------
ALTER TABLE "public"."gateway_component" ADD CONSTRAINT "gateway_component_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table gateway_component_config
-- ----------------------------
ALTER TABLE "public"."gateway_component_config" ADD CONSTRAINT "gateway_component_config_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table gateway_component_config_detail
-- ----------------------------
ALTER TABLE "public"."gateway_component_config_detail" ADD CONSTRAINT "gateway_component_config_detail_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table gateway_component_instance
-- ----------------------------
ALTER TABLE "public"."gateway_component_instance" ADD CONSTRAINT "gateway_component_instance_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table gateway_component_log
-- ----------------------------
ALTER TABLE "public"."gateway_component_log" ADD CONSTRAINT "gateway_component_log_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table iot_device_auto_control_config
-- ----------------------------
ALTER TABLE "public"."iot_device_auto_control_config" ADD CONSTRAINT "iot_device_auto_control_config_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table iot_device_management
-- ----------------------------
ALTER TABLE "public"."iot_device_management" ADD CONSTRAINT "iot_device_management_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table iot_thing_base_info
-- ----------------------------
CREATE UNIQUE INDEX "thing_id" ON "public"."iot_thing_base_info" USING btree (
  "thing_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table iot_thing_base_info
-- ----------------------------
ALTER TABLE "public"."iot_thing_base_info" ADD CONSTRAINT "iot_thing_base_info_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Uniques structure for table iot_thing_entity
-- ----------------------------
ALTER TABLE "public"."iot_thing_entity" ADD CONSTRAINT "unique_code_tenant" UNIQUE ("code", "tenant_code");

-- ----------------------------
-- Primary Key structure for table iot_thing_entity
-- ----------------------------
ALTER TABLE "public"."iot_thing_entity" ADD CONSTRAINT "iot_thing_entity_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Uniques structure for table iot_thing_model
-- ----------------------------
ALTER TABLE "public"."iot_thing_model" ADD CONSTRAINT "iot_thing_model_code_key" UNIQUE ("code");

-- ----------------------------
-- Primary Key structure for table iot_thing_model
-- ----------------------------
ALTER TABLE "public"."iot_thing_model" ADD CONSTRAINT "iot_thing_model_pkey" PRIMARY KEY ("id", "code");

-- ----------------------------
-- Primary Key structure for table iot_thing_source
-- ----------------------------
ALTER TABLE "public"."iot_thing_source" ADD CONSTRAINT "iot_thing_source_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table iot_visual_group
-- ----------------------------
ALTER TABLE "public"."iot_visual_group" ADD CONSTRAINT "iot_visual_group_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table mock_data_config
-- ----------------------------
ALTER TABLE "public"."mock_data_config" ADD CONSTRAINT "mock_data_config_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Uniques structure for table mock_data_log
-- ----------------------------
ALTER TABLE "public"."mock_data_log" ADD CONSTRAINT "mock_data_log_uk" UNIQUE ("mock_config_id", "time");
COMMENT ON CONSTRAINT "mock_data_log_uk" ON "public"."mock_data_log" IS '�������־Ψһ��';

-- ----------------------------
-- Primary Key structure for table mock_data_log
-- ----------------------------
ALTER TABLE "public"."mock_data_log" ADD CONSTRAINT "mock_data_log_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table sys_energy_check
-- ----------------------------
ALTER TABLE "public"."sys_energy_check" ADD CONSTRAINT "sys_energy_check_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table sys_energy_project
-- ----------------------------
ALTER TABLE "public"."sys_energy_project" ADD CONSTRAINT "sys_energy_project_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Uniques structure for table thing_ts_kv
-- ----------------------------
ALTER TABLE "public"."thing_ts_kv" ADD CONSTRAINT "unique_thing_attr_ts" UNIQUE ("thing_code", "attr_key", "ts");

-- ----------------------------
-- Primary Key structure for table thing_ts_kv_external
-- ----------------------------
ALTER TABLE "public"."thing_ts_kv_external" ADD CONSTRAINT "ts_kv_pkey" PRIMARY KEY ("thing_code", "attr_key", "ts");

-- ----------------------------
-- Uniques structure for table ts_kv_latest
-- ----------------------------
ALTER TABLE "public"."ts_kv_latest" ADD CONSTRAINT "unique_thing_attr" UNIQUE ("thing_code", "attr_key");
