-- Table: public.data

DROP TABLE IF EXISTS public.data;

CREATE TABLE IF NOT EXISTS public.data
(
    id bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 9223372036854775807 CACHE 1 ),
    name character varying(225) COLLATE pg_catalog."default" DEFAULT ''::character varying,
    data_type character varying(225) COLLATE pg_catalog."default" DEFAULT ''::character varying,
    file_type character varying(225) COLLATE pg_catalog."default" DEFAULT ''::character varying,
    object_type character varying(225) COLLATE pg_catalog."default" DEFAULT ''::character varying,
    object_subtype character varying(225) COLLATE pg_catalog."default" DEFAULT ''::character varying,
    batch_num bigint,
    scene character varying(225) COLLATE pg_catalog."default" DEFAULT ''::character varying,
    data_source character varying(225) COLLATE pg_catalog."default" DEFAULT ''::character varying,
    gather_time timestamp without time zone,
    gather_spot character varying(225) COLLATE pg_catalog."default" DEFAULT ''::character varying,
    url character varying(225) COLLATE pg_catalog."default",
    increment character varying(225) COLLATE pg_catalog."default" DEFAULT ''::character varying,
    labeled boolean DEFAULT false,
    CONSTRAINT data_pkey PRIMARY KEY (id)
    )

    TABLESPACE pg_default;



COMMENT ON TABLE public.data
    IS '数据管理表';

COMMENT ON COLUMN public.data.id
    IS 'id';

COMMENT ON COLUMN public.data.name
    IS '名称';

COMMENT ON COLUMN public.data.data_type
    IS '数据类型';

COMMENT ON COLUMN public.data.file_type
    IS '文件类型';

COMMENT ON COLUMN public.data.object_type
    IS '目标类型';

COMMENT ON COLUMN public.data.object_subtype
    IS '目标子类型';

COMMENT ON COLUMN public.data.batch_num
    IS '批次号';

COMMENT ON COLUMN public.data.scene
    IS '场景';

COMMENT ON COLUMN public.data.data_source
    IS '数据源';

COMMENT ON COLUMN public.data.gather_time
    IS '采集时间';

COMMENT ON COLUMN public.data.gather_spot
    IS '采集地点';

COMMENT ON COLUMN public.data.url
    IS '图片url';

COMMENT ON COLUMN public.data.increment
    IS '扩增方式';

COMMENT ON COLUMN public.data.labeled
    IS '是否标注';

-- 菜单 SQL
INSERT INTO public.sys_menu (menu_id, menu_name, parent_id, order_num, path, component, component_name, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, version, create_by, create_time, update_by, update_time, remark) VALUES (2002, '数据管理查询', 2001, 1, NULL, '', NULL, NULL, '1', '0', 'F', '0', '0', 'demo:data:query', NULL, 0, 1, '2024-04-22 17:21:27.187713', 1, NULL, '');
INSERT INTO public.sys_menu (menu_id, menu_name, parent_id, order_num, path, component, component_name, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, version, create_by, create_time, update_by, update_time, remark) VALUES (2003, '数据管理新增', 2001, 2, NULL, '', NULL, NULL, '1', '0', 'F', '0', '0', 'demo:data:add', NULL, 0, 1, '2024-04-22 17:21:27.187713', 1, NULL, '');
INSERT INTO public.sys_menu (menu_id, menu_name, parent_id, order_num, path, component, component_name, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, version, create_by, create_time, update_by, update_time, remark) VALUES (2004, '数据管理修改', 2001, 3, NULL, '', NULL, NULL, '1', '0', 'F', '0', '0', 'demo:data:edit', NULL, 0, 1, '2024-04-22 17:21:27.187713', 1, NULL, '');
INSERT INTO public.sys_menu (menu_id, menu_name, parent_id, order_num, path, component, component_name, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, version, create_by, create_time, update_by, update_time, remark) VALUES (2005, '数据管理删除', 2001, 4, NULL, '', NULL, NULL, '1', '0', 'F', '0', '0', 'demo:data:remove', NULL, 0, 1, '2024-04-22 17:21:27.187713', 1, NULL, '');
INSERT INTO public.sys_menu (menu_id, menu_name, parent_id, order_num, path, component, component_name, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, version, create_by, create_time, update_by, update_time, remark) VALUES (2006, '数据管理导出', 2001, 5, NULL, '', NULL, NULL, '1', '0', 'F', '0', '0', 'demo:data:export', NULL, 0, 1, '2024-04-22 17:21:27.187713', 1, NULL, '');
INSERT INTO public.sys_menu (menu_id, menu_name, parent_id, order_num, path, component, component_name, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, version, create_by, create_time, update_by, update_time, remark) VALUES (2001, '数据管理', 2, 1, '/demo/data', 'demo/data/index', '数据管理', NULL, '1', '0', 'C', '0', '0', 'demo:data:list', NULL, 6, 1, '2024-04-22 17:21:27.187713', 1, '2024-04-23 20:38:36.673', '数据管理菜单');
INSERT INTO public.sys_menu (menu_id, menu_name, parent_id, order_num, path, component, component_name, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, version, create_by, create_time, update_by, update_time, remark) VALUES (2, '数据管理', 0, 2, 'data', NULL, NULL, NULL, '1', '0', 'M', '0', '0', NULL, 'data', 0, 1, NULL, 1, NULL, '数据管理目录');

-- 算法配置表
DROP TABLE IF EXISTS public.algorithm_config;

CREATE TABLE "public"."algorithm_config" (
 "id" "pg_catalog"."int8" NOT NULL,
 "subsystem" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" NOT NULL,
 "algorithm_name" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" NOT NULL,
 "algorithm_address" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" NOT NULL,
 "parameter_config" "pg_catalog"."text" COLLATE "pg_catalog"."default",
 "create_by" "pg_catalog"."int8",
 "create_time" "pg_catalog"."timestamp" DEFAULT CURRENT_TIMESTAMP,
 "update_by" "pg_catalog"."int8",
 "update_time" "pg_catalog"."timestamp" DEFAULT CURRENT_TIMESTAMP,
 "remarks" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
 "tenant_id" "pg_catalog"."int8" DEFAULT 0,
 version           integer                 DEFAULT 0,
 del_flag      smallint               DEFAULT '0'::smallint         NOT NULL,
 CONSTRAINT "algorithm_config_pkey" PRIMARY KEY ("id")
);

ALTER TABLE "public"."algorithm_config"
    OWNER TO "postgres";

COMMENT ON COLUMN "public"."algorithm_config"."id" IS '主键ID';

COMMENT ON COLUMN "public"."algorithm_config"."subsystem" IS '分系统';

COMMENT ON COLUMN "public"."algorithm_config"."algorithm_name" IS '算法名称';

COMMENT ON COLUMN "public"."algorithm_config"."algorithm_address" IS '算法地址';

COMMENT ON COLUMN "public"."algorithm_config"."parameter_config" IS '参数配置';

COMMENT ON COLUMN public.algorithm_config.version IS '乐观锁';

COMMENT ON COLUMN public.algorithm_config.tenant_id IS '租户编码';

COMMENT ON COLUMN public.algorithm_config.del_flag IS '逻辑删除标志（0代表存在 1代表删除）';

COMMENT ON COLUMN "public"."algorithm_config"."create_by" IS '创建人';

COMMENT ON COLUMN "public"."algorithm_config"."create_time" IS '创建时间';

COMMENT ON COLUMN "public"."algorithm_config"."update_by" IS '更新人';

COMMENT ON COLUMN "public"."algorithm_config"."update_time" IS '更新时间';

COMMENT ON COLUMN "public"."algorithm_config"."remarks" IS '备注';

COMMENT ON TABLE "public"."algorithm_config" IS '算法配置表';
-- 菜单 SQL
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values(2024052715012200, '算法配置', 152584418900430848, '1', 'agMange', 'biz/agMange/index', 1, 0, 'C', '0', '0', 'biz:agMange:list', '', 1, now(), 1, null, '算法配置菜单');

-- 按钮 SQL
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values(2024052715012201, '算法配置查询', 2024052715012200, '1',  '', '', 1, 0, 'F', '0', '0', 'biz:agMange:query',        '', 1, now(), 1, null, '');

insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values(2024052715012202, '算法配置新增', 2024052715012200, '2',  '', '', 1, 0, 'F', '0', '0', 'biz:agMange:add',          '', 1, now(), 1, null, '');

insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values(2024052715012203, '算法配置修改', 2024052715012200, '3',  '', '', 1, 0, 'F', '0', '0', 'biz:agMange:edit',         '', 1, now(), 1, null, '');

insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values(2024052715012204, '算法配置删除', 2024052715012200, '4',  '', '', 1, 0, 'F', '0', '0', 'biz:agMange:remove',       '', 1, now(), 1, null, '');

insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values(2024052715012205, '算法配置导出', 2024052715012200, '5',  '', '', 1, 0, 'F', '0', '0', 'biz:agMange:export',       '', 1, now(), 1, null, '');



